First, you can resize the logical volume while you're still running off the root partition. You can look in /etc/fstab to help figure out the logical volume name. Look for the filesystem mounted on /. My entry looked like:
/dev/mapper/lvmvolume-lucid64root / ext4 errors=remount-ro 0 1
The corresponding logical volume name is /dev/lvmvolume/lucid64root. You can use lvdisplay to verify:
ubuntu@ubuntu:~$ sudo lvdisplayYou can extend the logical volume without unmounting (see lvm howto):
--- Logical volume ---
LV Name /dev/lvmvolume/lucid64root
VG Name lvmvolume
LV UUID xbW7iN-x9Ri-gGHG-rwpp-iLu1-gIsf-ycT6dc
LV Write Access read/write
LV Status NOT available
LV Size 12.00 GiB
Current LE 3072
Segments 2
Allocation inherit
Read ahead sectors auto
ubuntu@ubuntu:~$ sudo lvextend -L12G /dev/lvmvolume/lucid64root
You'll need to use the same logical volume name later when you resize the filesystem. Now boot into the live cd. Since the Ubuntu 10.04 live cd I used doesn't have lvm support, the first step is to intall it:
ubuntu@ubuntu:~$ sudo apt-get install lvm2Then make your logical volumes available:
ubuntu@ubuntu:~$ sudo vgchange -a yThen resize the filesystem. The default size is to just fill the partition.
ubuntu@ubuntu:~$ sudo resize2fs /dev/lvmvolume/lucid64rootIt might ask you to run e2fck first:
ubuntu@ubuntu:~$ sudo e2fsck -f /dev/lvmvolume/lucid64rootDone. Now just reboot to your newly resized root partition.
No comments:
Post a Comment