ZFS advice on mirror creation

Hi, I'want to make regulars backups of my media(photos,videos,etc) , but I dont have another Cpu to make ZFS snapshots , so, I'will connect 2 hard disks in my machine(same sata port,same order) to make the backup,shutdown the machine and storage the sata disks in a safe place..

Is a safe way create a mirror in this mode? (2 2TB hardisks)
Connect the 2 disks, make a ZFS pool in one, and make a mirror in the second one,and from to time to time,connect the 2,make the backup and disconnect from the machine
 
Depends what you mean by safe. You'll lose redundancy during the time that they're apart and during resilvering you won't have that backup. And the more you do this the more likely it is that you'll run into issues related to typing something stupid. You also won't get any protection against changes between times when you sync things up.

You can do that, it would be functionally the same as if you have to replace a failed drive, but if you've got a 3rd disk, it's a lot safer as now you've got some ability to repair damage between swaps, even though the additional disk wouldn't be an actual backup.

In the past when I've had mirrored systems, I'll pull one of the disks out when I'm about to do something major like an upgrade as it's a bit faster to recover from if something does go wrong and I'm able to avoid the uncertainty of whether I really did back everything up.

Personally, I found the whole thing to be more of a hassle than it was really worth and now I collocate a drive offsite that gets the deduplicated backups with borgbackup.

EDIT: You may be better off just getting a cheap single board computer and sending the backups directly to an attached disk.
 
Depends what you mean by safe. You'll lose redundancy during the time that they're apart and during resilvering you won't have that backup. And the more you do this the more likely it is that you'll run into issues related to typing something stupid. You also won't get any protection against changes between times when you sync things up.

You can do that, it would be functionally the same as if you have to replace a failed drive, but if you've got a 3rd disk, it's a lot safer as now you've got some ability to repair damage between swaps, even though the additional disk wouldn't be an actual backup.

In the past when I've had mirrored systems, I'll pull one of the disks out when I'm about to do something major like an upgrade as it's a bit faster to recover from if something does go wrong and I'm able to avoid the uncertainty of whether I really did back everything up.

Personally, I found the whole thing to be more of a hassle than it was really worth and now I collocate a drive offsite that gets the deduplicated backups with borgbackup.

EDIT: You may be better off just getting a cheap single board computer and sending the backups directly to an attached disk.

you right, is not safe , time to get a old board and make a fixed fbsd instalation, a "backup box"
 
you right, is not safe , time to get a old board and make a fixed fbsd instalation, a "backup box"
If it weren't for backups, it would probably be fine. There's stuff like marking the drive physically and using glabel to give it a matching name to make it less risky, but I wouldn't personally be comfortable having to do this on a regular basis as my backup strategy.
 
I don't like it ... in the sense that it is not a good solution.
But I do like it: It is a decent solution, and at least you're trying to make backups.

Why isn't it a good solution? It requires too much human intervention, you have to move disks back and forth, you have to type too many commands, and those commands have to be run as root. There is too much potential for mistakes here, and given that mistakes might be "pull the wrong disk out" or "type a command wrong as root", that's just too dangerous for my taste.

Here would be my suggestion: Don't make the second disk a mirror. Instead make it a second file system, and update it with ZFS send and receive, or with rsync. And try to set up the permissions so the process of backing up is NOT CAPABLE OF modifying the live disk. How you do that depends on your usage, your requirements, and what workflow / software you want to use.

To the point that "human mistakes are dangerous": My previous employer (IBM, at the time the largest computer company in the world) actually did accurate studies of what causes data loss on IBM-serviced storage systems. And the absolute largest contribution was human error. With the classic example being: The hardware of a storage system (which is in practice always using redundant storage) reports a disk failure; the system continues working fine due to redundancy, and a field service technician is sent to replace the failed disk. The service technician arrives, promptly pulls out the wrong disk (the one that is still working fine and contains good and valid data), throws it in the trash (as he should), leaves the dead disk in the system which is now down and has suffered data loss, and happily leaves and drives to the next customer. Big oops, but happens all the time. The fix? Very clearly labeling and numbering the disks and the slots they go into (with big letters or numbers); adding blinking lights so the good disk has a nice green light, and the dead disk has an angry flashing red light; giving instantaneous feedback, if you pull the wrong disk the system immediately starts beeping and the lights start flashing blue and red; and lots of training and attitude adjustment. And making it so less maintenance is requires, since every maintenance operation has a high risk of mistakes; one example is called "fail in place", leaving dead disks in the system, so there is no chance to remove the wrong disk.

In turn, this leads to the old joke: To administer a computer, you need to hire a man and a dog. The man is there to feed the dog. The dog is there to bite the man if he tries to touch the computer.

So the moral of these jokes: Think about how to simplify and automate your workflow, and reduce the risk of doing the wrong thing, like mirroring from the backup disk (which has outdated information) back to the live disk.
 
Using a mirror as a backup is not optimal. The problem is that if you want to update the backup it takes very long to resync. It is not incremental.

You don't need a second computer to do snapshot send and receive. If you have ZFS it is a good way to go.
 
First of all, backups better being automated, not done manually.
All regular semi-manually fumbling increases the risk of fatfingering, and to be forgotten to be done, so backups are not recent enough. And frequent fumbling with hardware increases the risk of hardware damage.

Install the medium you want to backup to into a safe place (temperature🌡️☝️), and don't touch it unless you have to.
Then see how to automate your backups: find some BU software that suits your needs or write some scripts yourself.

Distinguish:
Files need to be stored safely.
Backups are to save your time you worked on something.
What you need to backup is your /home, /etc, /usr/local/etc (X11 config, and others) and all your production directories you do work in: the documents or the source code you write (➡️ version control system & backup the repository), the pictures you create, the music you compose... - the work you do, the files you spend on time editing them.
That needs to be backupped regulary, automatically into a safe storage.

But if
my media(photos,videos,etc)
means your mediathek - your "porn collection" - PDFs you downloaded, pictures from vacations, parties, family reunions, movies, music or image files you downloaded, bought or got by other sources... -
IMO those don't need to be backupped, at least not regulary, above all not frequently, but to be stored safely, only.

You see, those files are not going to change. You may add new ones, sometimes delete some, and sort them - but you don't work on those files, you don't change them. So, IMO it makes no sense to run a daily or even more frequent BU routine updating files on the BU medium to match the ones on the working storage, when there is nothing to update, because they don't change.
Just save them to a safe storage place where you have access to from your desktop machine: Add another ZFS pool to your machine, or get an additional machine for this job you can access to over LAN (NFS, ssh, maybe samba). Any used, old, still working junk without keyboard, GPU and monitor will do. Only the drives are important. Those must be aces. The rest of the machine may conk out anytime, doesn't matter.
Maybe manually do additional redundnat BUs of that quarterly to a single extra drive, but if the storage is redundant enough this ain't neccessary against hardware failures.

A mirror consisting of two drives was bare minimum - IMO too few for a safe storage. For a safe storage I recommend more redundancy than one drive may fail and then there is only a single drive as the last one left.
When a drive is replaced in a ZFS pool resilvering is done. That's a full load job for the drives. Depending on the size of the drives and the amount stored this can last a few hours. Imagine you replace one of your drives failed by becoming old. All your data is now on one single last drive left. And then this one needs to run full power for a couple of hours. 😱

Depending on the size of the drives you have, what you can afford, how much space you need (avoid over 80% capacity used), how much places you have (a PCIe card providing more SATA ports cost a couple of bucks), and how valuable the files are to you (how much effort it takes, to get them again), if even I would recommend at least a three drives mirror as the barest minimum, but not optimal. Not really good.
Better use 4 drives and create a raidz2 pool.
Anyway boths ways you can afford to lose two drives without data loss.

A raidz3 pool can afford to lose 3 drives, but you need at least 5 drives to realize it.

A raid10 pool also needs at least for drives, but IMO makes only sense with >=8 drives, when lots of drives are needed at most possible redundancy. Half the drives may fail, but it provides the least storage capacity available you get by the drives you add.
 
Back
Top