Ok, I thought may I'd give it a try and loaded up FC6 on a 40gig drive using LVM .
Then, I moved it to a 80gig drive.
You may be tempted to use a thingy called
pvmove but, I wouldn't recommend that unless you have a special insite on how to use it or your are into some sort of self abuse.
About half an hour for a empty swap partition ( and still not done ) convinced me to try something else.
I did some modifications to the notes at
http://forums.fedoraforum.org/showthread.php?t=41706 and here is what I came up with and it worked for me.
The original 40gig drive is sda
/dev/sda1 ----> /boot
/dev/sda2 ----> VolGroup00
Inside VolGroup00 is Log_Swap and LogVol00
On the new drive, I created a different Volume Group so it wouldn't conflict with the existing one.
/dev/sdb1 ----> /boot2
/dev/sdb2 ----> VolGroup01
Inside VolGroup01 is Log_Swap and LogVol00
# Partition new hard drive
fdisk /dev/sdb
The setup for the partitions should be:
primary partition 1 (/boot) - this is a standard linux partition (id 83). I made it 100MB, you can pick whatever.
primary partition 2 (for LVM) - the rest of the disk space. Regardless of how you want your partitions set up, this is the rest of the disk space. You can change the type to 8e (lvm) if you want, although I think that is only required if you are using LVM1.
# Format /boot
mkfs.ext3 /dev/sdb1
e2label /dev/sdb1 /boot2
# Setup lvm
pvcreate /dev/sdb2
vgcreate VolGroup01 /dev/sdb2
vgchange -a y VolGroup01
# Add logical volumes to it.
lvcreate -L 600 -n Log_Swap VolGroup01
(repeat as needed for other partitions)
# Then, a root volume filling the rest of the disk:
vgdisplay VolGroup01 | grep "Total PE"
# A single line should be displayed: "Total PE" and then a number.
# Use this number in the next command:
# Use a lower case L ( l ) this time.
lvcreate -l (Whatever Total PE was) -n LogVol00 VolGroup01
#Note: If that pops an error about the size, use the number which it gives you.
# The logical volumes are created as: /dev/(volume group name)/(logical volume name)
# Now format the other partitions you created.
mkswap /dev/VolGroup01/Log_Swap
mkfs.ext3 /dev/VolGroup01/LogVol00
# Mount the new partitions
mkdir /mnt/new_boot /mnt/new_root
mount /dev/sdb1 /mnt/new_boot
mount /dev/VolGroup01/LogVol00 /mnt/new_root
# Copy over your existing files using rsync or cp
rsync -xav / /mnt/new_root
rsync -xav /boot/* /mnt/new_boot
# cp -xav / /mnt/new_root
# cp -xav /boot/* /mnt/new_boot
# Edit the /mnt/new_root/etc/fstab
Code:
/dev/VolGroup01/LogVol00 / ext3 defaults 1 1
LABEL=/boot2 /boot ext3 defaults 1 2
/dev/VolGroup01/Log_Swap swap swap defaults 0 0
# The LABEL= comes from using the e2label on partitions.
# Edit the /mnt/new_boot/grub/grub.conf to add the the new image:
# In this case, root (hd0,0) is where the /boot folder is located.
Code:
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.18-1.2849.fc6)LVM
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2849.fc6 ro root=/dev/VolGroup01/LogVol00 rhgb quiet
initrd /initrd-2.6.18-1.2849.fc6.img
# Install grub on the new drive.
grub-install /dev/sdb
# Remove the original drive and make sure the bios properly detects the new drive.
# NOTE: The new system may not boot until you reinstall initrd as follows.
# Bootup with CD#1 into linux rescue and mount the LVM system
# Chroot to new drive
chroot /mnt/sysimage
cd boot
# Use the initrd numbers which you have on your system.
mkinitrd -v -f initrd-2.6.18-1.2849.fc6.img 2.6.18-1.2849.fc6
# This would be a good time to make sure grub is setup for this drive.
grub
grub> root (hd0,0)
grub> setup (hd0)
exit
exit