Moving Filesystems

Just some commands to remind me how to move non-raid filesystems to mdadm raid1

Use fdisk to create two identical partitions of type fd – raid autodetect

Create the new array
mdadm –create –verbose /dev/md0 –level raid1 –raid-disks 2 /dev/hda1 /dev/hdb2

Mount the new filesystem
mkdir /mnt/newdisk
mount /dev/md0 /mnt/newdisk

Copy a filesystem to it
cp -ax /var /mnt/newdisk

After this, don’t forget to edit /etc/fstab so the system mounts the new filesystem on boot.

Leave a comment