Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Then start your VM and go to the console.
# fdisk -u /dev/xvda
(-u shows sectors instead of cylinders. This is important)(Make a note of the start sector of the LVM partition)
Command (m for help): p
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 16775167 8136705 5 Extended
/dev/xvda5 501760 16775167 8136704 8e Linux LVM
(delete the LVM and/or Extended partition)
Command (m for help): d
Partition number (1-5): 2
(Create a new partition)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p (I choose primary but you may choose extended)
Partition number (1-4): 2 (choose one that's available)(Fill in the start sector of the LVM partition we deleted above)
First sector (63-16777215, default 63): 501760
Last sector, +sectors or +size{K,M,G} (501760-16777215, default 16777215): (Enter)(change created partition to Linux LVM)
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): p
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 499711 248832 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2 501760 16777215 8137728 8e Linux LVM
Command (m for help): w (write)
# reboot
(Resize physical volume)
# pvresize /dev/xvda2
(make a note of the VG "Free PE")
# vgdisplay
(make a note of the "LV Name" of the LV you want to resize)
# lvdisplay
(Resize LV. Fill in the found "Free PE" and "LV Name" (without the brackets))
# lvresize -l +[Free PE] [LV Name]
(resize the file system)
# resize2fs [LV Name]
# reboot
Thats all..
Hope this is useful to somebody.
Last edited by hansaplazt; 01-21-2011 at 07:47 PM.
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
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.
Last edited by hansaplazt; 12-05-2011 at 08:06 AM.
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.
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')
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
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.