Friday, December 5, 2008

MD create, overwrite question

We had an argue today with my friend DeepM,
does making software raid1 with mdadm overwrites the partition or at least garbages its superblock / partition table / file system, if someone bumps to this question one day in ones life, here is the answer: NO, it does not.
I took two sata partitions sda3 and sdb3, mkfs.ext3, copy some stuff to both of them.
In picture 1, you can see the contents.
Next i create md device using both partitions with command:

mdadm -Cv /dev/md1 -l1 -n2 /dev/sda3 /dev/sdb3

Mdadm kindly warns me, that partition, contains
file system with (probably) files in it. Thank you, i know what i'm doing. Just press "y".
Resync process starts, 1.5G takes a few seconds to resync.
Picture 3 below: resync in progress.
After process is done, i remount newly created md1 device, check its contents and VOILA - everything is in place.

No comments: