Synchronization mirror disks

Status
Not open for further replies.

muzak

Dabbler
Joined
Nov 26, 2013
Messages
22
Hello all

I have currently set up a raid mirror UFS with two disks, respectively, 250 and 500 gb using FreeNAS 9.1.1.

I need to figure out how to sync / match data between two disks in case I change or add data only in one and the other is unplugged.

I did a test by unplugging a disk and adding a file in the other connected, but once I plugged in the second disk i couldn't see that file.
In a few words so I was wondering if there is a mechanism for automatic synchronization/parity just in case you are working on only one disk at the moment and in a second time adding the second one of RAID mirror set up.

Thanks in advance.
 

muzak

Dabbler
Joined
Nov 26, 2013
Messages
22
Pleaz...is there a method to syncronize only the file that has been changed in one of the mirror set up?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Muzak,

Sorry but I don't know how to help you. UFS support is being removed after 9.2.0, so you might want to look at moving to ZFS. There aren't that many people using UFS and since you can't use it with the plugins or jails feature its being abandoned.

With ZFS a scrub is now you synchronize files when one disk was left out. With UFS I really don't know what to use. I haven't used UFS with FreeNAS because ZFS has so many benefits over UFS.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
No. Mirroring is for data protection, not for enabling stupid storage tricks. The mirroring system is not a system to track changed blocks and then repopulate them on a disk that's deliberately been made missing. It is a system to allow you to have a copy of your data when one disk suddenly fails and you need to replace it. What you are doing is just broken.

What you need to do is to have two different filesystems, and then you can synchronize files between them using rsync or Unison or whatever.

I would further note that this shouldn't be attempted under ZFS, either, despite what cyberjock seems to imply. Temporarily removing disks and then adding them back later creates significant problems for a storage system. Do not do this.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah. I'm not saying you should do that. Just that if you accidentally leave one unplugged and realize it after bootup you can shutdown, add the disk back to the system, bootup, and scrub to fix your "damage".
 

muzak

Dabbler
Joined
Nov 26, 2013
Messages
22
Thanks for replies

No. Mirroring is for data protection, not for enabling stupid storage tricks. The mirroring system is not a system to track changed blocks and then repopulate them on a disk that's deliberately been made missing. It is a system to allow you to have a copy of your data when one disk suddenly fails and you need to replace it. What you are doing is just broken.

I'm new to NAS system but to me the situation described is not a stupid storage tricks because my NAS is in work environment, one disk must be unplugged every day for safe reason and, you know, someone can forget it at home.

With ZFS a scrub is now you synchronize files when one disk was left out.
So this is a solution but it's not recommended, right?

I need a third disk to synchronize with mirror or just use two disks in stripe mode and synchronize each other simulating a sort of "mirror", isn'it?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I'm new to NAS system but to me the situation described is not a stupid storage tricks because my NAS is in work environment, one disk must be unplugged every day for safe reason and, you know, someone can forget it at home.


So this is a solution but it's not recommended, right?

I live on one of the Great Lakes and it is sometimes nice to go boating. But if I forget my boat, I can just caulk up all the cracks and firewall openings in my car and drive on into the lake, yeah?

No. Trying to abuse the mechanism you describe in the way that you suggest is disaster. It does not matter WHY you want to do that. There is no automatic way to resynchronize the data, and trying to do it manually puts both disks at risk. The mirror is designed as protection against component failure. There is no long term changed block tracking. Put differently, tell me, if you mirror two new disks, unplug one, write a bunch of stuff to the filesystem, then plug the other disk back in, and reboot, what happens? Does the system believe what's on disk 0, disk 1, or does it not even realize the disks have different content, and proceed to return blocks from both disks? (hint: last answer is correct).

I need a third disk to synchronize with mirror or just use two disks in stripe mode and synchronize each other simulating a sort of "mirror", isn'it?

Mirror two disks AND NEVER MESS WITH THEM. Then take a third (and additional if you are paranoid!) disk and rsync your pool data to it as often as you would like to be comfortable. Using rsync in that manner has massive benefits. You wind up with lots of benefits but it costs an extra disk (or two) to do.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I should have said filesystem data, not pool data. Insufficient coffee error.
 

ZFS Noob

Contributor
Joined
Nov 27, 2013
Messages
129
So, essentially what you're trying to do is create a mirror, then break it to take a copy of your data off-site, then swap back in the drive you removed the previous week (or whenever) and have it sync back up. Is that correct? So you've got one drive that stays in the server as part of the mirror, and multiple additional drives that "walk" from the office to some off-site location?

First, if you were going to do this I'd suggest a 3-way mirror instead of a 2-way mirror.

Even better: VPN devices are cheap and internet connections are ubiquitous. Why not set up an off-site server and push ZFS snapshots to it instead? This might work better than the suggestion you're currently looking at because you can push snapshot updates more frequently than you can carry a drive home. So if you're breaking a mirror like this and carrying it home every week then you're looking at ~ 2.5 days of data loss if you have a failure and need to recover. If you're pushing snapshots every hour, then that drops to ~ 30 minutes data loss on average instead.

Plus, it's the way the system is designed to be used, so you don't run the risk of trying to outsmart the system and later discovering you didn't fully understand the problem...
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Because he's using UFS and the GUI does not support 3 way mirrors for UFS, even if that solved his problem, which it doesn't.
 

muzak

Dabbler
Joined
Nov 26, 2013
Messages
22
As said I'm new to all this and i don't want to abuse the system just know.
So using one disk of setup few times at week (if it happens) is a bad idea at all.
Ok

I'm using UFS just to try because actually don't have two disks of same size to enable ZFS mirror but definitively I'm going to use ZFS and 3 way mirror can be a solution.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
No, ZFS isn't designed to do this either, even with three disks.
 

ZFS Noob

Contributor
Joined
Nov 27, 2013
Messages
129
Yeah, maybe I shouldn't have mentioned that. If you're doing that hardware RAID makes more sense, but even that's not perfect.

Is my guess as to the use case correct? Is this about moving critical data off-site to protect against site failures? Is so, why not push snapshots to a secondary server (after reading the discussions on the importance of ECC RAM, of course...)
 

muzak

Dabbler
Joined
Nov 26, 2013
Messages
22
ah, right of course.

Maybe a ZFS two disks mirror and the third synchronized to mirror. This is right?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Make a two disk mirror. Then use a portable disk to make another filesystem that is totally separate. Use rsync to copy data from the mirror to the portable. You can have one, several, or many portables. This is safe, easy, reliable technology. There should be no further reason to discuss broken mirror designs.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
By the way, it is not mandatory to mirror your data disks on the NAS, just a really good idea. If you can live with losing changes between the last rsync to a portable and the moment of failure, then all is good...
 
Status
Not open for further replies.
Top