0

I have VMware server installed on Ubuntu Server 10.04. I managed to get to the VMware Infrastructure Web Access interface, however I didn't allocate enough space on my LVM initially to start adding virtual machines.

I just resized using lvresize to 360GB, as shown using lvdisplay (Size 357.80 GiB). But the standard datastore in the VMware Infrastructure Web Access interface still says it has a 17.52 GB capacity.

Is resizing the LVM enough or do I have to resize something else to get this to work? Or is it simply that VMware hasn't updated for some reason? I already tried restarting the vmware services and that didn't work... anyone have any suggestions?

user29600
  • 399
  • 5
  • 16
  • 29
  • Have you tried restarting vmware services? Rebooted the machine? – Vick Vega Apr 13 '11 at 21:08
  • Trying a machine reboot right now... no dice. – user29600 Apr 13 '11 at 21:13
  • When logging in after rebooting it says "Usage of /: 14.3% of 17.52GB"... looks like that's where my problem is, it didn't actually resize the partition. I did the lvresize on /dev/hostname/root and the lvdisplay on /dev/hostname/root and it says 357.80 GiB... – user29600 Apr 13 '11 at 21:21

1 Answers1

1

Your lvm has been extended, but the filesystem on top of it is still the size of the old disk.

Unmount the partition (probably shutting down the VMware services beforehand):

/etc/init.d/vmware stop
umount /dev/mapper/volumename

Then extend the filesystem; the command to do the extend depends on which filesystem is running.

For ext4, the default on Ubuntu 10.04:

resize4fs /dev/mapper/volumename

Or, for ext2/3:

resize2fs /dev/mapper/volumename
Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • Thanks! It is ext4. Does it matter if it's root I'd need to unmount? – user29600 Apr 14 '11 at 14:42
  • @user29600 Yup, that won't work. In that case, you'll want to boot to something else to make the needed change. I'll recommend [System Rescue CD](http://www.sysresccd.org). – Shane Madden Apr 14 '11 at 14:59
  • Uh... I'm looking in gparted using System Rescue CD and it says my /dev/Hostname/root isn't in there are a partition. It only lists /dev/sda1, /dev/sda2 > /dev/sda5, and unallocated. – user29600 Apr 14 '11 at 15:45
  • @user29600 Gparted doesn't support LVM; you'll want to just use the normal ol' command prompt. – Shane Madden Apr 14 '11 at 15:59
  • Sorry to continue this for so long, I appreciate the help. I'm out of gparted. root@sysresccd /root % fdisk -l, still lists the same as above. lvdisplay and vgdisplay say "No volume groups found". ideas? – user29600 Apr 14 '11 at 16:17
  • How about `pvscan`, `lvscan`? – Shane Madden Apr 14 '11 at 16:17
  • Nothing. I'm reading http://www.sysresccd.org/Sysresccd-LVM-EN-How-the-logical-volume-manager-works : How LVM Works and http://www.sysresccd.org/Sysresccd-LVM-EN-Booting-linux-from-LVM-volumes : Booting Linux from LVM Volumes. Not sure if I'm off or not, but it seems like this is related to my situation, that the LVM isn't seen because it wasn't booted from? – user29600 Apr 14 '11 at 16:26
  • Booting is complicated, but just mapping it should be simple. I forgot one; try `vgscan`? – Shane Madden Apr 14 '11 at 16:30
  • Still nothing. So you think it's just a matter of mapping it and not booting from LVM? – user29600 Apr 14 '11 at 16:34
  • Yeah, you're booted to the rescue CD; you don't need to boot to the LVM to modify the filesystem. Are the physical devices of the LVM showing in `fdisk -l`? – Shane Madden Apr 14 '11 at 16:39
  • not sure. fdisk -l gives me Disk /dev/sda: 498.8 GB with /dev/sda1, /dev/sda2, /dev/sda5 and Disk /dev/sdb: 16.0 GB with /dev/sdb1 – user29600 Apr 14 '11 at 16:42
  • Ok, those are probably in there, then. Let's get verbose; `vgscan -a -v`. What's the output on that? – Shane Madden Apr 14 '11 at 16:51
  • "vgscan: invalid option -- 'a' Error during parsing..." Just tried vgscan -v and it still says no volumes found. Would it be a problem if the /dev/sda5 is encrypted? I had chosen LVM encrypted when I first set up the computer and it usually for a password to mount it each time I start up the system – user29600 Apr 14 '11 at 17:02
  • Yes indeed! The procedure outlined [here](http://ubuntuforums.org/showthread.php?t=611165) should cover it; the only stumbling block there is that you'll need to know which device the LVM is on. `fdisk -l` should help; look for a partition with an "Id" of `8e`, which indicates that it's for LVM. – Shane Madden Apr 14 '11 at 17:09
  • Awesome, should've mentioned that before I guess. /dev/sda5 has an Id of `83`, not `8e`.. same thing? resize4fs gives command not found. – user29600 Apr 14 '11 at 17:25
  • `83` is for a standard Linux partition; while `8e` is for an LVM partition. Try `resize2fs` instead. – Shane Madden Apr 14 '11 at 17:39
  • There aren't any with Id `8e`. `/dev/sda2` is Id `5`, but all the others are `83`. `resize2fs` on `/dev/sda5` gives the message of "Bad magic number in super-block while trying to open /dev /sda5" "Couldn't find valid filesystem superblock." – user29600 Apr 14 '11 at 17:48
  • Maybe I should just start from scratch; reinstall the system and set it to the size I need? – user29600 Apr 14 '11 at 17:49
  • @user29600 You'll need to run the resize on the LVM after it's mapped using the encrypted LVM rescue procedure that I linked. Probably the best option at this point would be to hop back into the normal boot and find out which physical device you need to work with by running `vgscan -p -v`. – Shane Madden Apr 14 '11 at 17:52
  • @user29600 Starting from scratch would work as well :) – Shane Madden Apr 14 '11 at 17:52
  • Oh, I didn't see the link. I thought you meant your original post. apt-get isn't working in sysresccd terminal... maybe I'll try a regular Ubuntu Live CD and go from there? apt-get should work if i do that right? – user29600 Apr 14 '11 at 18:01
  • Ignore those lines, and ignore the `sudo` on the front of each line too; all the necessary tools should be on the rescue CD. But , that procedure requires knowledge of which physical device your LVM is on, which is a problem. – Shane Madden Apr 14 '11 at 18:03
  • k checking physical device first with `vgscan -p -v` in normal boot. – user29600 Apr 14 '11 at 18:16
  • Progress, it's asking for a passphase! Entering the passphrase gives "device-mapper: remove ioctl failed: Device or resource is busy".I went on to the next step and it says it found the volume group though. Gonna continue on. – user29600 Apr 14 '11 at 18:27
  • Good stuff! Should be able to get it mapped now. – Shane Madden Apr 14 '11 at 18:35
  • gggggggggenius! Thanks, you're a life saver! Wish I could upvote more than once or donate rep.. (Did e2fsck then resize2fs and it worked perfectly) – user29600 Apr 14 '11 at 18:50
  • Nice! Glad it worked. – Shane Madden Apr 14 '11 at 18:52