[linux-lvm] LVM question on move and resize
John Koshi
jkoshi at yahoo.com
Fri Jul 14 15:15:23 UTC 2006
Hi Dieter,
Thanks for your e-mail. I did go through the steps as
mentioned, including the resize2fs after the fsck, and
everything worked fine. The one other thing I had to do
was to initially create the new partition in the empty
space, first as ext2, and then move to type 8e/LVM.
You're right about the W95 extended partition. It is
pretty ugly! But I had to consider the /dev/hda2 Linux
partition at the end of the disk, which handles the
quick-play feature of the HP laptop. I did not want to
lose that in the process of adding Linux/dual-boot, so
I went with Partition Magic for this.
Actually I do have a large USB disk (Seagate 160GB)
and had considered using it during this expansion of
the Linux installation. I'm interested in seeing your
solution, in this case.
Thanks again.
regards,
John
--- Dieter Stüken <stueken at conterra.de> wrote:
> John Koshi wrote:
> > I assume the next steps will be (from a rescue CD):
> >
> > 1) Use fdisk to format the unused 25 Gb space in the
> > extended partition, to a new type 8E partition.
> > 2) Use pvcreate to create a new physical vol there.
> > 3) Use vgextend to extend VolGroup00 to include the
> > new physical volume.
> > 4) Use lvextend to extend LogVol00 by the XX Gb.
> > 5) Do a file system check of LogVol00.
> >
> > Does this look right? Am I missing any steps?
>
> after you grow LogVol00 you also have to expand the
> ext2/ext2 filesystem inside (step 4a)
>
> resize2fs -p /dev/mapper/VolGroup00-LogVol00
>
> This actually does the real work. resize2fs recommends
> to perform an fsck before. If you are in doubt, do it,
> else you may skip this using "resize2fs -f -p".
>
> You don't have to supply a size, resize2fs will find
> the current size of the extended volume auomatically
>
> Will you perform this while booting from a rescue CD?
> If this is your root filesystem you have to, anyway.
> Else you possibly have to reboot, after changing the
> partition table, because it may be locked by the system
> while it is in use.
>
> Tip: you may rename your VG and your LVs to get expressive
> names like "/dev/mapper/Sonota-Root". Imo this is less
> error prone than working with technical names like "LogVol42".
>
> > Disk /dev/hda: 80.0 GB, 80026361856 bytes
> > 255 heads, 63 sectors/track, 9729 cylinders
> > Units = cylinders of 16065 * 512 = 8225280 bytes
> > Device Boot Start End Blocks Id System
> > /dev/hda1 * 1 5201 41777001 7 HPFS/NTFS
> > /dev/hda2 9704 9729 208845 88 Linux plaintext
> > /dev/hda3 5202 5214 104422+ 83 Linux
> > /dev/hda4 5215 9703 36057892+ f W95 Ext'd (LBA)
> > /dev/hda5 8425 9703 10273536 8e Linux LVM
> > Partition table entries are not in disk order
>
> So you end up with an extended partition containing your LVM.
> Even if this works, it is an ugly solution. This Win95 extended
> partition hack is something like a poor-mans LVM with partition
> magic as its management tool.
>
> It would be much better, to REPLACE the extended partition by LVM.
> Unfortunately I don't see any easy migration path without an external
> disk. If you have any spare disk, to temporary hold the 8.2Gb root
> volume, I may point out an other solution.
>
> Dieter.
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
More information about the linux-lvm
mailing list