Move and Remove old files
Boot data is now where we want them: on the boot partition md0.
And all the rest (root) is on the logical volume (virtual disk) 'root'.
We have to clean the unused boot directory in root.
We may want to organize some more, like
to separate /var from the root filesystem,
a sparated /home directory, etc.
Whatever you want.
As examples (and because it was necessary) only /boot and /var are
documented here.
boot
After transferring the Operaing System to mirrored disks,
data is copied to the root filesystem,
and to the new boot filesystem (where it now belongs) as well.
The boot directory on the root filesystem must be removed.
But the new boot filesystem is mounted over that directory,
so be carefull !
- umount /boot we need access to directory /boot
- cd /boot ; rm -rf * Not directory /boot is empty
- mount -a now /dev/md0 is visible as /boot again.
var
You may want /var in a separate partition to protect the rest of your computer
from a full filesystem.
So we create a logical volume for it, and mount it,
moving the data from the old /var to the new logicl volume.
- lvcreate --stripes 4 --stripesize 32 --size 250G --name var /dev/all_disks
where 4 = the number of paritions inside the volume group
(count the output of pvdisplay).
- mkfs -t ext3 /dev/all_disks/var make a filesystem in the virtual disk.
- edit a line into /etc/fstab like:
/dev/all_disks/var /var ext3 relatime,errors=remount-ro 1 2
- mount /dev/all_disks/var /mnt now /mnt contains your future /var.
- cd /var ; find . -xdev | cpio -pdum /mnt copy /var to new virtual disk 'var'.
- rm -rf * remove old content of /var. Some directories will not
dissapear (run, lock) because they are in use.
Don't bother, the're just 2 empty directories.
- umount /mnt unmount /dev/all_disks/var as /mnt.
- mount -a mount /dev/all_disks/var as /var.