what does the mirroring process actually do ?

Hi guys,

I was wondering how come it takes such a long time to create a mirror from 2x 1.5 TB WD empty disks.

Every time I create a mirror and insert the 2nd disk, it starts doing something (I think mapping the sectors or blocks or something ...) but isn't this metadata ?

After 2 hours, it only completed 23%.

Box: FreeBSD 8.1, i386
 
It's copying the entire disk, not just the metadata. It's a mirror, which means you get an exact and full copy.

And yes, that will take a while. Even more if the filesystems are being used.
 
Yes, they take a while. But you get the benefit of uptime. It's also possible to reboot while a rebuild is in process.
 
It's probably making sure that they are empty by re-emptying them. Specifically it's probably block by block reading off one drive and copying whatever is there to the second drive. (Since there's nothing there, it's rezeroing.) It's the simplest way to be sure that both drives have identical information on them. 1/4 done after 2 hours sounds about right for 1.5TB SATA disks.
 
@SirDice: the disks are empty, fresh from the store shelf ...

Completely irrelevant. A full disk sync must occur which is roughly a little more time than what # dd if=/dev/disk1 of=/dev/disk2 bs=128k would take.

You can significantly reduce the time to resync a broken mirror if you put gjournal on top of gmirror(or graid3) and enable the UFS gjournal flags on the filesystem in the gjournal device.

since both gmirror and gjournal are block level type devices, the standard gmirror is dumb in the case of mirror breakage and full resync must happen to ensure integrity. When gjournal is coupled with it, gmirror is able to act much more intelligently and is kept in a consistent state without the need for a full resync.
 
@Galactic_Dominator: I was thinking about something similar too. Thx for the answer.
 
Back
Top