trapexit / mergerfs-tools

Optional tools to help manage data in a mergerfs pool
ISC License
385 stars 44 forks source link

Naive question about mergerfs.balance and hardlinks #75

Closed FlorentLM closed 5 years ago

FlorentLM commented 5 years ago

Hi,

I have a naive question about how balance handles hardlinks.

Let's say I have the following structure:

sda | | Folder A | Folder A2

sdb | | Folder B | Folder B2

Where files in folder A and A2 point to the same inodes (same story for B and B2).

If I do a mergerfs.balance on the sda-sdb merge, what will happen to my files? If, for example, content from B is moved to sda, will the corresponding hardlinks in B2 be broken? Will they be moved? If yes, to a newly created B2 directory into sda?

Many thanks in advance!

trapexit commented 5 years ago

It doesn't do anything special about files with >1 link count.

Links aren't "broken." The name is removed and the link count is reduced.

FlorentLM commented 5 years ago

So the actual data will be copied and may live on both drives?

trapexit commented 5 years ago

Yes