2

I created a ubuntu server vm with 64GB provisioned storage. I remember that I specified 30GB to be used for the vm. When I do df -h, I get

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/analysis--db-root<br/>
                       28G   25G  904M  97% /
udev                  2.0G  4.0K  2.0G   1% /dev
tmpfs                 793M  228K  793M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  2.0G     0  2.0G   0% /run/shm
/dev/sda1             228M   45M  171M  21% /boot

The disk is almost full, how can I use my other 30GB from the provisioned storage?

Also, when i type in 'sudo parted -l' :

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  256MB   255MB   primary   ext2         boot
 2      257MB   64.4GB  64.2GB  extended
 5      257MB   64.4GB  64.2GB  logical                lvm


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/analysis--db-swap_1: 533MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system     Flags
 1      0.00B  533MB  533MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/analysis--db-root: 29.5GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  29.5GB  29.5GB  ext4
2
  • I think the answer to this lies in the virtualisation software, not the Ubuntu guest... What steps did you take to provision 64GB, and then to specify 30GB? Nov 24, 2011 at 2:44
  • I created 64GB .vmdk, and I think one of the step when installing the ubuntu server asks me how much do i want to allocate to it or something like that, and i put in 30GB eventhough i know that I have 64GB. I installed this ubuntu server a while ago, so i don't quite remember.. I have been trying to get the 30GB+ for this past few hours and still no luck..
    – gita
    Nov 24, 2011 at 6:11

1 Answer 1

1

I have solved this by refering to http://ezunix.org/index.php/Extend_existing_LVM_root_partition_without_rebooting. I just need to extend the logical volume, then extend the filesystem.

twadmin@analysis-db:~$ sudo  lvextend -l +100%FREE /dev/analysis-db/root
  Extending logical volume root to 59.26 GiB
  Logical volume root successfully resized

twadmin@analysis-db:~$ sudo resize2fs /dev/mapper/analysis--db-root
resize2fs 1.41.14 (22-Dec-2010)
Filesystem at /dev/mapper/analysis--db-root is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 4
Performing an on-line resize of /dev/mapper/analysis--db-root to 15535104 (4k) blocks.
The filesystem on /dev/mapper/analysis--db-root is now 15535104 blocks long.

twadmin@analysis-db:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/analysis--db-root
                       59G   25G   31G  45% /
udev                  2.0G  4.0K  2.0G   1% /dev
tmpfs                 793M  228K  793M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  2.0G     0  2.0G   0% /run/shm
/dev/sda1             228M   45M  171M  21% /boot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .