1

I believe I understand how file copy/move operations work (or appear to work). My general understanding being that as long as files and directories are on the same device and filesystem, moving a file from one directory to another should happen nearly instantly. And a file copy operation takes longer as the data has to be replicated from each original inode to a new inode, etc,.

However, occasionally I run into a situation where I move a file and it takes as long as copying it and I have not been able to determine why.

I have a Raspberry Pi server (running OMV) set up for a partner and I to collaborate and share files over sftp and I have it so there is an incoming directory that we upload files to and when we are done working with them, I move them to an archive directory on the same physical drive and at the same hierarchical level. IE, both directories share the same parent directory. The file system is ext4.

For some reason when I move a file from this incoming directory to another directory above or beside it in the file "tree", it essentially seems to copy it to the new directory and then delete the original file as if I were moving it to another drive or file system. If I move the same file to a sub-directory of the incoming directory, the move happens instantly as expected.

The only difference I see between the two directories is that the incoming directory has ACLs applied to it.

So I experimented by creating a test directory and applying the same ACLs as the incoming directory has, one at a time to see if I could duplicate the behavior (and isolate the offending ACL) and I can not. To be clear, if I create a test directory with the same ACLs and permissions as the incoming directory, I can move files in and out of it nearly instantly unlike the incoming directory.

Clearly, I do not fully understand why my incoming directory is acting like it's on another drive and I have not had any luck on Google finding relevant information.

I am thinking that it has something to with the way OMV (Open Media Vault) handles file shares, ACLs and permissions. But in the past with other distros it seems this happens every now and then but I have been too lazy to troubleshoot.

I'm hoping someone with a better understanding of file systems might point out something I'm missing.

Here are some details:

$getfacl incoming
# file: incoming
# owner: root
# group: users
# flags: -s-
user::rwx
group::rwx
group:users:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:users:rwx
default:mask::rwx
default:other::r-x

getfacl testFolder2
# file: testFolder2
# owner: root
# group: users
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:users:rwx
default:mask::rwx
default:other::r-x

$ls -lah
drwxrwsr-x+   7 root users 4.0K Oct  3 20:12 incoming
drwxrwsr-x+   2 root users 4.0K Oct  4 19:51 testFolder2
drwxr-xr-x    2 root users 4.0K Oct  4 19:51 testFolder4

tree -L 1 /sharedfolders/
/sharedfolders/
├── incoming
├── testFolder2
└── testFolder4

File moves between testFolder2 and testFolder4 instantly, file moves between incoming and either testFolder2 or 4 happen at the speed of copying.

closed as off-topic by Milliways, Fred, joan, Darth Vader Oct 15 at 13:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Milliways, Fred, joan, Darth Vader
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This looks more like a detailed Linux/filesystems question than a Raspberry Pi specific one. You might have better luck on the Unix & Linux exchange. – Fred Oct 7 at 21:34
  • LOL. I originally tried to post it, I think there. But they down voted my question and pointed me over to this exchange. I get lost in these Stack Exchange sites. – Glenn Oct 7 at 22:37
1

In further troubleshooting... I noticed that when I ran the mount command to see what was listed, the directory for my incoming files was listed as a mounted file system as if it were a separate physical disk.

I now see that for each shared resource in OMV, whether it's a shared drive or folder, is using file system labeling methods (shown as dev-disk-by-label-storage) which I have never used/learned about.

The drive's "normal" file system is mounted inside of /srv/dev-disk-by-label-storage and if I access the directories there, I can move files between directories almost instantly as in a normal move operation.

Not the answer you're looking for? Browse other questions tagged or ask your own question.