Skip to contentSkip to conversation

creating RAID-1 - in which direction will the sync be made?

DISCUSSION Tomasz Chmielewski 2 participants 3 messages Jul 14, 2010 – Jul 15, 2010 MD RAID

lore
Share & tools
lore
#0 lore raw

In which direction will the devices be synchronized, if I create a new RAID-1 array with an external bitmap?

Assuming I use this command line:

mdadm --create /dev/md11 --level=1 --bitmap=/mnt/src/bitmap --raid-devices 2 /dev/storage/origin /dev/esata/copy

Should I expect /dev/storage/origin being written to /dev/esata/copy?

Or perhaps, /dev/esata/copy will be written onto /dev/storage/origin?

I couldn't find it explained in the fine manual, so perhaps creating an array with a missing device:

mdadm --create /dev/md11 --level=1 --bitmap=/mnt/src/bitmap --raid-devices 2 /dev/storage/origin missing

and adding a second device later will be safer...

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#1 lore raw
Quoted 11 lines · Tomasz Chmielewski

In which direction will the devices be synchronized, if I create a new RAID-1 array with an external bitmap?

Assuming I use this command line:

mdadm --create /dev/md11 --level=1 --bitmap=/mnt/src/bitmap --raid-devices 2 /dev/storage/origin /dev/esata/copy

Should I expect /dev/storage/origin being written to /dev/esata/copy?

Quoted 8 lines

Or perhaps, /dev/esata/copy will be written onto /dev/storage/origin?

I couldn't find it explained in the fine manual, so perhaps creating an array with a missing device:

mdadm --create /dev/md11 --level=1 --bitmap=/mnt/src/bitmap --raid-devices 2 /dev/storage/origin missing

and adding a second device later will be safer...

Looks like the first device in the command line will be synced onto the second. However, I'd like someone to confirm this.

And that I should use "build" to sync the devices, otherwise, I'll write a superblock on each of them ;)

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#2 lore raw
Quoted 17 lines · On Wed, 14 Jul 2010 15:48:39 +0200 Tomasz Chmielewski <[email protected]> wrote:
Quoted 16 lines · Tomasz Chmielewski

In which direction will the devices be synchronized, if I create a new RAID-1 array with an external bitmap?

Assuming I use this command line:

mdadm --create /dev/md11 --level=1 --bitmap=/mnt/src/bitmap --raid-devices 2 /dev/storage/origin /dev/esata/copy

Should I expect /dev/storage/origin being written to /dev/esata/copy?

Or perhaps, /dev/esata/copy will be written onto /dev/storage/origin?

I couldn't find it explained in the fine manual, so perhaps creating an array with a missing device:

Quoted 7 lines
Quoted 3 lines

mdadm --create /dev/md11 --level=1 --bitmap=/mnt/src/bitmap --raid-devices 2 /dev/storage/origin missing

and adding a second device later will be safer...

Looks like the first device in the command line will be synced onto the second.
However, I'd like someone to confirm this.

If it matter to you, then you are doing the wrong thing.

If you have data on one device and want to copy it to the other device, then you should - as you suggest - create the array with the 'origin' device and 'missing', then add the 'copy' device as a spare - it will rebuild

Quoted 5 lines

And that I should use "build" to sync the devices, otherwise, I'll write a superblock on each of them ;)

Possibly. But you then need to keep track of which devices is up-to-date, and md has no metadata area to record this information in.

If you were to explain the big picture of what you were trying to do, I/we might be able to be more specific in answers.

NeilBrown