500GB drive fitted, only 50GB showing in Virtualmin

5 posts / 0 new
Last post
#1 Thu, 01/24/2013 - 10:12
loyalwhite

500GB drive fitted, only 50GB showing in Virtualmin

Hi all,

I have set up an HP Proline server with a 500GB drive with Centos 6.2 and Virtualmin 3.97.

Having restored a few servers from backups, I have noticed that I am nearly out of disk space. Virtualmin reports "Local disk space 49.69 GB total, 46.74 GB used"

The output of df -h is:

Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_vm1-lv_root 50G 45G 2.6G 95% / tmpfs 1.9G 0 1.9G 0% /dev/shm /dev/sda1 485M 51M 409M 12% /boot

Any ideas how I can start to troubleshoot where my other 450GB went?

Thu, 01/24/2013 - 11:17
andreychek

Howdy,

Are you under the impression that your server only has one drive, and that drive is 500GB?

Or are there multiple drives?

Out of curiosity, what output do you receive if you run this command:

fdisk -l /dev/sda

Fri, 01/25/2013 - 03:51
loyalwhite

Hi Eric,

I'm under the impression that there is only one drive and that drive is 500GB. Unless there's another drive in there that was not mentioned in the server spec. Doubt that though - it's one of those rackmounting Proline servers where all the drive bays are accessible from the front, and there's certainly only one drive there, and it's certainly 500GB.

Output of fdisk -l /dev/sda is :

Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000bac0c   Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 60802 487873536 8e Linux LVM

I can see from that output that it is recognising the 500GB drive. Do I have a partitioning issue, do you think?

Fri, 01/25/2013 - 09:20
andreychek

Howdy,

It looks like you're running LVM there... your partition is setup for 500GB, but the LVM volume that's mounted is only 50GB.

So that suggests that there's either another volume group, or that the currently mounted volume group was never setup for the full space.

You can use vgscan and vgdisplay to figure that out.

There's documentation on using those commands on CentOS here:

http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/VG_disp...

Wed, 01/30/2013 - 03:57
loyalwhite

Thanks very much Eric. From that link, I was able to expand my logical volume and then do an online update to the filesystem. I've added 200GB to the available space, thereby keeping 250GB in case I ever need it for something else.

And I learned a whole lot about VLM along the way.

For anyone finding this thread in the future, I first expanded the logical volume by:

lvextend -L+200G /dev/vg_vm1/lv_root

Which extends that logical volume by 200GB. Once that's done, it's also necessary to extend the associated filesystem to match. The ideal way to do this is to unmount the volume first, but of course if, as in my setup, your system is booted from that volume, that's not an option, so you have to do an online update. This is done by running:

resize2fs -p /dev/mapper/vg_vm1-lv_root

(Or whatever the name of your filesystem is.)

This online update takes a while; adding 200GB to mine took about 20 mins.