LVM progress update cont.
Friday, January 18th, 2008OK so we’re successfully booted off the new LVM based root filesystem.
Now i want to move everything back onto the dm softraid array. So we delete the old home and root partitions and make them into a new big partition with an LVM label,(I justed yast to do this coz i couldn’t have been arsed looking up the commands.
Now we convert this new big partition into a LVM physical volume:
pvcreate isw_cggibjcgah_Raid_part5
And then add it to the system volume group.
vgextend system isw_cggibjcgah_Raid_part5.
Now we can actually start moving stuff over (on the fly) to the array.
/dev/sda1 is the physical volume we want to release, its currently where root and home is. But this command will move the partitions to any other free physical volumes, which there is only one, the array, system isw_cggibjcgah_Raid_part5.
pvmove /dev/sda1
But i got an error saying the mirroring module isnt loaded, so we load that:
modprobe dm-mirror
And after this the command will run successfully, It takes a while, depending on the size of your disks.
Now we have a free sda1 physical volume that we can remove out of the volume group.
vgreduce system /dev/sda1
And then make it a non physical volume using
pvremove /dev/sda1.
And that should be it. A successful conversion from standard linux block device to Logical volumes without loosing any data!
Two things to note that may render your system unbootable are these:
- Don’t touch your/boot partition/device, grub needs this and cannot read from a logical volume!
- Leave your swap space as an ordinary partition too, although the system will attempt to boot even though it cant access any swap space.