0

I ran mv /folder1/folder2/folder3/ /folderA/FolderB/FolderC/. Then I added more files and folders to /folder1/folder2/folder3/ during the move. It seems all of the files I added after I started the mv command are gone. I thought they would either be moved with the mv command or left alone. This is technically FreeNAS (FreeBSD), though this shouldn't make a difference.

Can anyone please help?

Thank you

1 Answers1

0

I guess mv was between filesystems. I recreated the issue in Debian.

In such case mv is not atomic. What your command did was like:

cp -a /folder1/folder2/folder3/ /folderA/FolderB/FolderC/ &&
rm -rf /folder1/folder2/folder3/

The first part (cp-like) is not required to check if some new file appears while it copies the old ones.

The missing files and directories are gone. The situation is technically the same as if you'd accidentally deleted them. Stop using the disk where the files used to be, so nothing overwrites the relevant blocks and data recovery tools (e.g. testdisk, photorec) can do their job (it may be too late though).

See How to recover a removed file under Linux? and research this topic.