Thank you Arwen
Arwen wrote:
The fastest why to move files around, would be to log into the TrueNAS via SSH, use TMUX.
I must assume that you are recommending TMUX because you have experienced an unwanted SSH session disconnection in the past.
I have not noticed this. I have left SSH sessions idle for several days to return to a blinking cursor.
Now I am worried. I don't ever want an SSH session to timeout and abort on its own.
But, I find nothing in the SSH service settings that controls a timeout function.
I see that TMUX permits opening multiple prompts but, I don't understand why it's used.
If I need another prompt, I simply start another SSH session. I have had 4 or 5 SSH sessions open at the same time.
Is that incorrect procedure?
I feel like I should explain what got me here in the first place.
All of the files in /mnt/pool/eds/video had somehow been deleted and an automatic snapshot had already been created after the deletion.
I deleted that current snapshot of the empty "video" dataset.
I expected the "video" dataset to be returned to yesterday's snapshot with all of the files back.
The "video" dataset remained empty.
Then I tried to ROLLBACK that now last, good snapshot, taken that day before the files were deleted and nothing happened.
The "video" dataset remained empty.
Since snapshot removal and then ROLLBACK did not work, I tried CLONE on that good, one-day-old snapshot of the "video" dataset.
I cloned that snapshot of /mnt/pool/eds/video to /mnt/pool/eds/video-clone.
I ssh'd in, then su -, then I mv'd each folder from /mnt/pool/eds/video-clone/folder-name to /mnt/pool/eds/video one folder at a time.
Used Space rose from 58% to 94% during the move. It took about 28 hours to move the full 23.9TB.
It's surprising to me that it took 28 hours to manipulate the snapshots concerned since, the move should have created no new data.
The "video-clone" dataset was emptied and all of the data was correctly moved to the "video" dataset.
I thought, wrongly.
I then went to the GUI and deleted the empty "video-clone" dataset.
I never made a snapshot of the video-clone dataset so I expected the Used Space to return to 58% but, it remained at 94%.
I automatically make and retain snapshots for one week.
Ten days after the data move, all snapshots made before the data move had been automatically removed from the system.
Yet, I was still stuck at 94% Used Space.
winnielinnie wrote:
My suspicion is that at one point you have the dataset pool/eds, and populated it with folders and files. One of these "folders"
shares the same name with a new child dataset you create under pool/eds. Upon creation of this new dataset, it is automatically mounted at the path
/mnt/pool/eds/name. If
"name" is the same as the folder name, then it will "overlap" it, which causes confusion. The original folder under the dataset pool/eds still contains the files; yet
you cannot access nor see them because it is currently being "overlapped" by an actual mounted dataset that
shares the same name as the folder.
Winnielinnie was correct. I found a folder underneath each dataset with the same name.
I did; "zfs unmount /mnt/pool/eds/video" to find a folder named "video" with the 24TB of moved data in it.
I renamed the video folder to "video_dir" and rebooted TrueNAS.
After verifying that all the datasets were correct, I opened an SSH session and started an "rm -R video_dir".
This returned me to 58% Used Space and did not affect the data in the "video" dataset.
I waited another week for all snapshots and replications to my 2nd TrueNAS box to stabilize.
Everything looks perfect now.
I've done some experimentation on this dataset vs underlying folder of the same name issue.
Here are my results.
Code:
root@shed[/mnt/pool/eds]# ls -l
total 339
drwxrwxrwx+ 16 root wheel 18 Apr 30 19:37 backup
drwxrwxrwx+ 20 root wheel 20 Jun 5 2018 common
drwxrwxrwx+ 40 root wheel 40 Dec 4 2019 drivers
drwxrwxrwx+ 33 root wheel 33 Mar 26 2021 fixes
drwxrwxrwx+ 9 root wheel 9 Jan 7 2021 games
drwxrwxrwx+ 2 root wheel 3 Jun 14 16:22 keepass
drwxrwxrwx+ 29 root wheel 32 Nov 21 2019 lib
drwxrwxrwx+ 17 root wheel 19 Mar 30 00:13 music
drwxrwxrwx+ 5 root wheel 5 Dec 2 2021 rch-ec
drwxrwxrwx+ 8 root wheel 8 May 5 2019 sm
drwxrwxrwx+ 7 root wheel 7 Oct 23 2021 software
drwxrwxrwx+ 9 root wheel 9 Jun 21 07:53 urb
drwxrwxrwx 7 root wheel 7 May 10 05:35 user
drwxrwxrwx+ 7 root wheel 7 Jun 4 01:02 video
Above is a directory listing of the "/mnt/pool/eds" dataset.
Every item listed above is also a dataset.
Code:
root@shed[/mnt/pool/eds]# cd video
root@shed[/mnt/pool/eds/video]# ls -l
total 205
drwxrwxrwx+ 6 root wheel 6 Apr 18 2022 Classics
drwxrwxrwx+ 28 root wheel 28 Feb 11 2022 Movies
drwxrwxrwx+ 12 root wheel 12 Apr 18 2022 Music Videos
drwxrwxrwx+ 18 root wheel 22 May 14 17:24 Tutorials
drwxrwxrwx+ 5 root wheel 5 Mar 13 16:43 TV Shows
Above is a directory listing of the "/mnt/pool/eds/video" dataset.
Every item listed above is a folder.
Notice that reading these two listings gives no clue as to what is a folder and what is a dataset.
Now I unmount the "video" dataset.
Code:
root@shed[/mnt/pool/eds/video]# cd ..
root@shed[/mnt/pool/eds]# zfs unmount /mnt/pool/eds/video
root@shed[/mnt/pool/eds]# ls -l
total 303
drwxrwxrwx+ 16 root wheel 18 Apr 30 19:37 backup
drwxrwxrwx+ 20 root wheel 20 Jun 5 2018 common
drwxrwxrwx+ 40 root wheel 40 Dec 4 2019 drivers
drwxrwxrwx+ 33 root wheel 33 Mar 26 2021 fixes
drwxrwxrwx+ 9 root wheel 9 Jan 7 2021 games
drwxrwxrwx+ 2 root wheel 3 Jun 14 16:22 keepass
drwxrwxrwx+ 29 root wheel 32 Nov 21 2019 lib
drwxrwxrwx+ 17 root wheel 19 Mar 30 00:13 music
drwxrwxrwx+ 5 root wheel 5 Dec 2 2021 rch-ec
drwxrwxrwx+ 8 root wheel 8 May 5 2019 sm
drwxrwxrwx+ 7 root wheel 7 Oct 23 2021 software
drwxrwxrwx+ 9 root wheel 9 Jun 21 07:53 urb
drwxrwxrwx 7 root wheel 7 May 10 05:35 user
drwxrwxrwx+ 2 root wheel 2 Jun 19 10:10 video
Again the directory listing.
Notice that there is no way to tell from the above listing that the "video" item is no longer a dataset.
The "video" item is now a folder.
Code:
root@shed[/mnt/pool/eds]# cd video
root@shed[/mnt/pool/eds/video]# ls -l
total 0
root@shed[/mnt/pool/eds/video]#
The directory listing above for the "video"
folder is empty.
I reboot "shed" and all is back to normal.
Despite winnielinnie's suspicion, I was sure that I had not populated the "eds" dataset with folders and files before I created datasets in "eds".
By the way "eds" is short for "Encrypted Data Set" which is passphrase encrypted.
Now I can see quite starkly that TrueNAS creates an empty folder underneath every dataset.
Try it for yourself, SSH in and "zfs unmount" a dataset then do an "ls -l" that dataset's name is still there but, now it is not a dataset.
It is an empty folder that TrueNAS put there.
"rm -R" the empty folder and "ls -l" will show that it is gone.
Reboot TrueNAS and all is back to normal.
Then "zfs unmount" and "ls -l" to see that the empty folder is back.
So now, I am absolutely sure that I did not initially create folders under the "eds" dataset before creating the child datasets.
TrueNAS creates them.
So now, back to the giant 24TB dataset that I want to split up.
I want to split it up because I know only heartbreak when it comes to moving data between datasets.
As the dataset continues to grow there will come a day when there will not be enough storage space to CLONE the dataset to a new dataset to effect repairs.
I have no idea why the "mv" from the "video-clone" dataset moved the data to the "video"
folder underneath the "video" dataset.
Therefor, I must assume that it will happen again.
That is why I wished to know the best practice for moving some of the folders from the "video" dataset to a newly created "video2" dataset.
Now that I have wrestled with this issue for several weeks it comes to me that it would be less disturbance to users to change the 5 folders that reside in the "video" dataset into 5 datasets.
Users would see no difference.
Then I could perform maintenance on any one of the 5 smaller datasets in the "video" dataset as opposed to having to deal with the entire 24TB in one dataset.
This leads to another question.
Can a windows box via samba delete a dataset, or will TrueNAS refuse?
I know that a windows box can delete the files in a folder or an entire folder through samba.
I created a new "test" dataset below the "video" dataset to test if I can delete it from windows.
It does not show up when I view the "video" dataset from windows.
Now I see why.
Code:
root@plum[/mnt/pool/eds/video]# ls -l
total 224
drwxrwxrwx+ 6 root wheel 6 Apr 18 2022 Classics
drwxrwxrwx+ 28 root wheel 28 Feb 11 2022 Movies
drwxrwxrwx+ 12 root wheel 12 Apr 18 2022 Music Videos
d---------+ 2 root wheel 2 Jun 21 19:58 test
drwxrwxrwx+ 18 root wheel 22 May 14 17:24 Tutorials
drwxrwxrwx+ 5 root wheel 5 Mar 13 16:43 TV Shows
root@plum[/mnt/pool/eds/video]#
The "test" dataset has no BSD permissions.
I also have gained no understanding of what to expect for BSD permissions of newly created files, folders or datasets.
All I can say for sure is that it never seems to acquire the parents permissions.
So I try:
Code:
root@plum[/mnt/pool/eds/video]# chmod -R 777 test
chmod: test: Operation not permitted
root@plum[/mnt/pool/eds/video]#
Nada, I can't change the BSD permissions.
So I have no choice but to delete the "test" dataset and get no closer to the answer to my question.
I'll just chalk it up as another failure in the trial and error world of TrueNAS.
Perhaps someone knows, can a windows box via samba delete a dataset, or will TrueNAS refuse?
And at this point I still know nothing about the best practices to reduce the size of a single dataset.
Thank You
All for now