Moving file from dataset to another dataset caused to move all files in a folder

I am not sure how many of you faced this issue in Truenas scale ZFS even I couldn’t reproduce.
Explaining Issue faced :-
There are 2 datasets “datasetA” and “datasetB” each in different pool. I have tried to move one file from “datasetA” to “datasetB” which moved file but also copied few folders and files from “datasetA” to “datasetB” which was not intended.

Also, if any existing file or folder deleted in “datasetA” it’s getting reflected in “datasetB”. I think kind of hardlink created between folder during mv command.

Not sure what caused it ? and what will happen if I delete folders that are copied in “datasetB” will it get deleted in “datasetA” also ?

Have anyone faced this issue before ?

Can you explain what you did exactly?

Was this via SMB? NFS? The command-line via SSH / Shell?

Hardlinks cannot exist between two different filesystems (“datasets”).

mv doesn’t have the capacity to create hardlinks (unless something has changed very recently that I’m not aware of).

In any case, deleting the hardlink (assuming that’s what they are, check if they have the same inode number ls -li see below.) will not delete the source file, no.

I am having a bit of a hard time understanding exactly what you mean though.

Two files on different datasets can have identical inode numbers without being the same file.

root@DRAGONFISH[/mnt/dozer]# stat NFS3
  File: NFS3
  Size: 3               Blocks: 1          IO Block: 512    directory
Device: 0,57    Inode: 34          Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-02-26 05:03:47.086584243 -0800
Modify: 2024-02-26 05:07:01.458974600 -0800
Change: 2024-02-26 05:07:01.458974600 -0800
 Birth: 2024-02-26 05:03:47.086584243 -0800

root@DRAGONFISH[/mnt/dozer]# stat NFS4
  File: NFS4
  Size: 3               Blocks: 1          IO Block: 512    directory
Device: 0,56    Inode: 34          Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-02-26 05:04:32.587611987 -0800
Modify: 2024-02-26 05:08:07.508466792 -0800
Change: 2024-02-26 05:08:07.508466792 -0800
 Birth: 2024-02-26 05:04:32.587611987 -0800

You can see this in evidence when you stat a dataset mountpoint.


Oversight on my part, cheers for the correction. Have updated my post to reflect that.

I think the most typical reason for people moving things they don’t intend to via shell is by not properly escaping spaces in file names.

1 Like

via SSH command run thru shell

File didn’t had any space.

I have verified stat of the folder each have different “Inodes”. But the problem is I have data replicated from one dataset to another. Deletes are syncing but not when new files created on original dataset.