Grow LVM in extended partition.
I couldn't find a HOWTO that always works (even with LVM in extended partition).
Here's one... Code:
First, shut down your VM and increase the disk size. Hope this is useful to somebody. |
It was very useful for me.
Thank you very much. |
Glad you liked it.
|
Unfortunately this doesn't work for me :(
After performing the steps above I get the following message when booting. Gave up waiting for root device. Common problems: - Boot args (cat /proc/cmdline) - Check rootdelay= (did the system wait long enough?) - Check root= (did the system wait for the right device?) - Missing modules (cat /proc/modules; ls /dev) ALERT! /dev/mapper/AhsayOBS-root does not exist. Dropping to a shell! BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) I'm running this Ubuntu 10.04.03 LTS on a XenServer v6.0 Any one else seen this? |
I presume you have created snapshot or backup of your VM?
Go back to it and start your VM (it should come up now). Can you post the output of "fdisk -u /dev/xvda" here? Assuming of course that /dev/xvda is the device you want to resize. |
Yes, that's correct. But I had to fix the space problem on that server immediately so had to solve it temporarily with mounting another partition into the filesystem to gain space where needed.
Although I've set up a similar Xen VM Guest server to continue tests on and it looked like this. Disk /dev/xvda: 75.2 GB, 75161927680 bytes 255 heads, 63 sectors/track, 9137 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: 0x00075641 Device Boot Start End Blocks Id System /dev/xvda1 1 32 248832 83 Linux Partition 1 does not end on cylinder boundary. /dev/xvda2 32 9138 73148417 5 Extended /dev/xvda5 32 9138 73148416 8e Linux LVM |
You are showing me cylinders instead of sectors. This is important. What unix/linux flavour do you have? Check the fdisk man page for listing sectors (usually this is '-u')
|
I'm running Ubuntu Lucid Lynx (10.04 LTS)
Okay, changed to sectors inside fdisk instead of on the command line which seems to work better. Changing display/entry units to sectors Command (m for help): p Disk /dev/xvda: 17.2 GB, 17179869184 bytes 255 heads, 63 sectors/track, 2088 cylinders, total 33554432 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00050338 Device Boot Start End Blocks Id System /dev/xvda1 2048 499711 248832 83 Linux Partition 1 does not end on cylinder boundary. /dev/xvda2 501758 33552383 16525313 5 Extended /dev/xvda5 501760 33552383 16525312 8e Linux LVM |
That was probably the problem.
If you now follow my first post (exactly of course :)) all should be fine. |
Thank You!
I know this is a really old post but I've been looking for the answer to this for a couple of days now and couldn't find it until I stumbled upon this! Thank's so much!
|
Thanks hansaplazt for the post! You are awesome!
|
Thanks a lot
Hello,
Your thread was very useful for me even 6 years before ;) Just wanted to note that on Debian 8 now some commands has changed that needs complete paths for LV (name is not enough anymore):
Thanks for your great post. |
For RHEL 7*
Try running a rescan on the iscsi bus after adding or extending a drive to a VM: echo "- - -" > /sys/class/scsi_host/host0/scan Most of the time it will work and prevent you from having to do a reboot. Since file systems have changed a bit, adding the following command for XFS since it doesn't use resize2fs: xfs_growfs /dev/mapper/rhel-root00 |
Still relevant in 2017.
Using Ubuntu 16.04.2 LTS (Server build). Thank you OP! |
Helped me in 2019, thank you very much!
|
All times are GMT -5. The time now is 06:34 PM. |