Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redhat mirrorin..

Status
Not open for further replies.

ac325ci

MIS
Jan 16, 2004
128
US
how do i break a mirror using mdadm ?
 
To what end? Do you wish to have two copies of the data, or drop one of them permanently?

I tried it with two loopback devices just for fun...

[tt] # make some loopback devices
dd if=/dev/zero of=disk0 count=10240
dd if=/dev/zero of=disk1 count=10240
losetup /dev/loop0 /var/tmp/disk0
losetup /dev/loop1 /var/tmp/disk1
# create and mount the mirror
mdadm --create /dev/md0 -n 2 -l1 /dev/loop0 /dev/loop1
mke2fs /dev/md0
mkdir /mnt/md0
mount /dev/md0 /mnt/md0
cp a bunch of stuff /mnt/md0
# fail and then remove one of the devices
mdadm /dev/md0 -f /dev/loop1
mdadm -D /dev/md0
mdadm /dev/md0 -r /dev/loop1
mdadm -D /dev/md0
# mount the 'failed' device on a separate mountpoint
mkdir /mnt/loop1
mount /dev/loop1 /mnt/loop1[/tt]

Using that method I was effectively able to mount a snapshot of the original filesystem.

Annihilannic.
 
i'd like to keep two copies of the data while the mirror is broken.. if i do a failed of one i lose the data..
 
No you don't. I didn't with the test above, why would you? when I mounted the so-called 'failed' loop1 device it had all of the original data on it. Surprisingly it didn't even need an fsck to mount it!

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top