LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   vmware / linux / expanded drive space (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/vmware-linux-expanded-drive-space-4175528360/)

jeepin81 12-15-2014 03:57 PM

vmware / linux / expanded drive space
 
Hello All,

This is my first time on this forum... nice to meet you!

We added additional drive space to our VMware virtual server that has Linux on it. It appears Linux isn't recognizing that additional space we added.

Any thoughts on how to get Linux to see that additional space on that virtual box.

Here's our setup:

VMware 5.5
Ubuntu Server 12.04


I appreciate any insight.

michaelk 12-15-2014 04:18 PM

Welcome to LinuxQuestions.

Did you restart the guest?
By what means are you using to verify that the additional space is not recognised?

jeepin81 12-15-2014 04:48 PM

Thanks for the reply.

We did do a restart and we can confirm via VMware the additional space is available but when we run:

[root@oursys ~]# df -h


It doesn't show the newly allocated disk space. Sorry if that is vague I am Linux newbie.

syg00 12-15-2014 04:52 PM

That shows filesystems space, not actual disk space availablity. Post the output of the following (run as root)
Code:

df -hT
parted -l


jeepin81 12-15-2014 05:11 PM

Code:

root@sugar:~# df -hT
Filesystem            Type      Size  Used Avail Use% Mounted on
/dev/mapper/sugar-root ext4      46G  37G  6.7G  85% /
udev                  devtmpfs  3.9G  4.0K  3.9G  1% /dev
tmpfs                  tmpfs    1.6G  232K  1.6G  1% /run
none                  tmpfs    5.0M    0  5.0M  0% /run/lock
none                  tmpfs    3.9G    0  3.9G  0% /run/shm
/dev/sda1              ext2      228M  27M  189M  13% /boot

Code:

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 107GB
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  53.7GB  53.4GB  extended
 5      257MB  53.7GB  53.4GB  logical                lvm


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

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


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

Number  Start  End    Size    File system  Flags
 1      0.00B  49.1GB  49.1GB  ext4

We should have 100GB and that's what VMware is showing us.

jeepin81 12-15-2014 05:14 PM

What we want to do is have a 100GB for the Disk w/ the sugar-root.

michaelk 12-15-2014 06:03 PM

As stated the added space is unallocated.

I would resize the extended partition to include the newly added space. It might be easier to then add a logical partition and add it to your sugar-root like the following then mess with resizing the existing space.

http://blog.chapus.net/ubuntu-server...se-disk-space/

syg00 12-15-2014 08:23 PM

Agreed, looks like a useful article.
Might make sense in future to add a second disk to the guest, then pvcreate on that disk (unpartitioned). Then if that disk is later enlarged, a simple pvresize will make things a lot easier.

jeepin81 12-16-2014 08:48 AM

Thanks for that info.. We'll check out that link and report back.

jeepin81 12-16-2014 10:55 AM

We followed that document and everything was looking good until we got to the point that extends the LV. Here is the error we get at the bottom. We were thinking maybe it had something to do w/ this command:

"lvextend -l 100%FREE /dev/sugar/root"




Code:

root@sugar:~# lvextend -l 11712 /dev/sugar/root
  New size given (11712 extents) not larger than existing size (12808 extents)
  Run `lvextend --help' for more information.
root@sugar:~# root@sugar:~# lvdisplay
  LV Name                /dev/sugar/root
  VG Name                sugar
  LV UUID                adBm9C-bTLu-stVk-oVGo-UtIO-9VPo-jpanrT
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                50.03 GiB
  Current LE            12808
  Segments              3
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          252:0

  --- Logical volume ---
  LV Name                /dev/sugar/swap_1
  VG Name                sugar
  LV UUID                S8yNjq-zol0-FX77-L338-iPyo-JUTT-N3LfYu
  LV Write Access        read/write
  LV Status              available
  # open                2
  LV Size                3.98 GiB
  Current LE            1018
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          252:1

root@sugar:~# vgdisplay
  --- Volume group ---
  VG Name              sugar
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access            read/write
  VG Status            resizable
  MAX LV                0
  Cur LV                2
  Open LV              2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size              99.76 GiB
  PE Size              4.00 MiB
  Total PE              25538
  Alloc PE / Size      13826 / 54.01 GiB
  Free  PE / Size      11712 / 45.75 GiB
  VG UUID              B5IY2a-CzoR-TT2j-0Gwt-bXy6-G6Z7-WdDL2a

root@sugar:~# vgextend sugar /dev/sda6
  Physical volume '/dev/sda6' is already in volume group 'sugar'
  Unable to add physical volume '/dev/sda6' to volume group 'sugar'.
root@sugar:~# lvdisplay
  --- Logical volume ---
  LV Name                /dev/sugar/root
  VG Name                sugar
  LV UUID                adBm9C-bTLu-stVk-oVGo-UtIO-9VPo-jpanrT
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                50.03 GiB
  Current LE            12808
  Segments              3
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          252:0

  --- Logical volume ---
  LV Name                /dev/sugar/swap_1
  VG Name                sugar
  LV UUID                S8yNjq-zol0-FX77-L338-iPyo-JUTT-N3LfYu
  LV Write Access        read/write
  LV Status              available
  # open                2
  LV Size                3.98 GiB
  Current LE            1018
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          252:1

root@sugar:~# lvextend -l 100%FREE /dev/sugar/root
  New size given (11712 extents) not larger than existing size (12808 extents)
  Run `lvextend --help' for more information.
root@sugar:~# lvextend --help
  lvextend: Add space to a logical volume


jeepin81 12-16-2014 01:03 PM

Okay... we got it figured out. Looks like it was something to do w/ that 100%FREE. We used:

lvextend -L +45G /dev/sugar/root

and everything seems to be correct.

I appreciate the help and I'll mark this thread resolved.

sgrlscz 12-17-2014 11:17 AM

Quote:

Originally Posted by jeepin81 (Post 5285652)
Okay... we got it figured out. Looks like it was something to do w/ that 100%FREE. We used:

lvextend -L +45G /dev/sugar/root

and everything seems to be correct.

I appreciate the help and I'll mark this thread resolved.

The problem with the 100%FREE was that you didn't specify it correctly. You needed it to be '-l +100%FREE' - that will add 100% of the free space. Without the '+', you are saying to extend to a size equal to the free space, which was less than the current size.

jeepin81 12-17-2014 11:42 AM

Thanks sgrlscz..... we'll add that to our documentation. Appreciated.


All times are GMT -5. The time now is 12:26 PM.