ZFS Question re copies property

Greetings all,

I would like to increase a chance of recovering certain data in case of single drive (laptop) gradually failing, i.e., bad sectors, bit flips, accidental overwriting of a portion of the block device, and the like, but before it completely fails. I have found a copies property, which I understand can be selectively turned on or off for a specific zfs filesystem.

What I cannot quite understand is the usage. From the zfs() is unclear whether copies=1 means an original data and one copy, or just (one) original data.

The other thing I am wondering about is whether there is a manner of setting the spatial diversity of the copied data to improve RAS.

Any insight would be appreciated.

Kindest regards,

M
 
Setting copies to 1 is the default. There will be 1 piece of the data, i.e. one copy. Setting copies=2 will have 2 copies, one original and one additional, i.e two copies.
 
Hi SirDice,

first, thank you for your reply. But, without being argumentative, how can you tell from the the zfs() (emphasis to citation supplied):

"copies=1 | 2 | 3
Controls the number of copies of data stored for this dataset. These
copies are in addition to any redundancy provided by the pool, for
example, mirroring or RAID-Z. The copies are stored on different
disks, if possible. The space used by multiple copies is charged to
the associated file and dataset, changing the usedproperty and
counting against quotas and reservations."

Thus for copies=1 the italicized portion will read"the one copy of data stored for this dataset", therefore, the original data and one copy of the original data. Have you practically tested the property?

Kindest regards,

M
 
Thus for copies=1 the italicized portion will read"the one copy of data stored for this dataset", therefore, the original data and one copy of the original data.
No, you're misunderstanding it. The copies property provides redundancy in addition to the redundancy provided by a RAID set. One copy simply means the file is written once. A RAID set is then required to provide the redundancy. If you don't have a RAID set (single drive or a striped set) copies can provide the redundancy by writing a single file more than once (copies > 1). Think of single copy as a copy of the data from memory to disk.

It's fairly simple to test. Try and set copies to 0. If you are right, this is possible (because only the original would be written to disk). If I'm right, it's not possible (because copies=0 means NO data is ever written to disk).
 
SirDice,

thank you again. I guess since English is not my mother's tongue, I understand the term copy as "a thing made to be similar or identical to another", hence my incorrect interpretation.

Unfortunately, I cannot perform the test as I am waiting on a new hard drive.

Kindest regards,

M
 
I guess since English is not my mother's tongue, I understand the term copy as "a thing made to be similar or identical to another", hence my incorrect interpretation.
Yes, that's completely understandable. The word "copy" however also has the meaning "an individual example". Hence copies=1 has the meaning of a single version of the file.
 
Back
Top