zfs-inplace-rebalancing icon indicating copy to clipboard operation
zfs-inplace-rebalancing copied to clipboard

Handle Hardlinks

Open nickdemise opened this issue 6 months ago • 1 comments

Hi all,

I would like to discuss, and expand my knowledge, about potentially enhancing the script to handle hardlinks, rather than simply ignoring them.

In #22 johnpyp mentions "(data) can't be trivially un-hardlinked after without knowledge of which path is in the "balance target" vdev." I don't quite understand this, could you please expand? Lets say we don't know the path of the balance target vdev and pick a path at random, in the end would it not average out ?

Lets say i have 2vdevs, and they are 60% populated, with files that each have one or more hardlinks, which is balanced 50-50 data usage. I now add a new empty equal size vdev to the pool and wish to rebalance.

We look at file_1, its got two hardlinks (50%-50%-0) Could i copy file_1 --> file_1_tmp Delete the two hardlinks & file_1 Create two new hardlinks to file_1_tmp Rename file_1_tmp

What does the end data result look like? (15%-15%-70% or so?)

I understand i could be quite naive/crude in this approach, but wish to understand and hope to resolve this, as i'm sure alot of people with similar *arr media setups would appreciate such a feature.

Thanks, NickyD

nickdemise avatar Aug 10 '24 14:08 nickdemise