I drank my brains for breakfast

William Bravin

Contributor
Joined
Mar 16, 2016
Messages
195
Hello all

Sorry to say this , I am embarrassed to say that i really screwed up.

my servers are configured that same way.

pool is named media and is has the following datasets
- documents
- music
- iocage
- movies
- tv shows
All my datasets are owned by wbravin

In performing a rsync task, i inadvertently copied all the music and movies content on the second server and the files landed in root directory "media" and not in the respective dataset.

In windows i would know what to. I would go to the root directory and delete all the files

In truenas i know that i need to go to the shell however once i am there i do not know what to do.

in the shell I logged in as my user (wbravin) however when i go to ../media i get i do not permission

I tried to login as root but it wont let me

from the root@freenas2 [~]# what do i do?

thank you in advance for responding
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
so my guess from this viewpoint would be that the path to the mounted root of your pool is /mnt/media

So starting with:
cd /mnt/media

Would be the first thing to try.

If you can then:
ls -l
there, you would expect to see your datasets and all of the accidentally copied files.
 

William Bravin

Contributor
Joined
Mar 16, 2016
Messages
195
thank you @sretalla for responding no i can see all the files that have been copied. be sale out there
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
So you have two problems...
1) You cannot access as root.
2) You need to know how to remove files.

First of all, what version of FreeNAS are you using? Your signature says TrueNAS 12.

1) Let's work the first one and we will keep it simple for now, if you can open the GUI for FreeNAS then you can open the Shell. From there you can run the remove commands manually, but lets focus on problem #2 before you get crazy about using root access.

If you are unable to access root via terminal then go read the User Guide on how to enable this access, but for now you do not need to do this, but I will tell you that I always prefer to use Putty over the GUI Shell.

2) So you already know how to find the files but now you need to start deleting them. You have two ways you can do this and it depends on your backups.
a) If your main system has all your files and your second system (where you copied the files to the wrong place) is just a backup, you can then just delete everything in the /mnt/media directory and then run rsync again to copy all your files from server 1 to server 2.
b) You could manually delete each file individually via the GUI.
c) You could share your entire pool via SMB and then use your Windows system to delete selected files.

My personal favorite is to use option "c", it could be much faster and lets you manually do it from Windoze. If you prefer to manually do it via the GUI then you need to search the internet for "freebsd remove command recursive" and be warned that it's very easy to delete everything in an instant.

So option "c" would have you just setup your pool as a share, just as you have setup any other SMB shares. I had to stop and start my SMB service to get Windoze to see the new share quickly.

Good Luck!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
c) You could share your entire pool via SMB and then use your Windows system to delete selected files.
I'm not sure that remains a valid option, though my memory is hazy on that subject. If the service will let you, that's probably easiest. If not, probably the easiest way to handle the files at the CLI is with Midnight Commander. Run mc at the command line (ideally via SSH rather than the web GUI's "shell").
 

William Bravin

Contributor
Joined
Mar 16, 2016
Messages
195
Hello all

1st tank you all for responding

Option C from @joeschmuck is my preferred option and the once i would be more comfortable with and in my opinion simpler and faster.
I did share /mnt/media/ via smb. and it does show up in my windows explorer. Great I learned something new.

I see all the mess i created. its not small:frown:

when i go to delete the offending data I see that i need user/root permission. So I go to edit permission and i get a simple screen showing me the parameters of media. The edit file system (acl) like for the datasets is not an option available.
The only parameter that i see that could affect this is the SID on that screen It is currently set at S-1-1-0 which is the same to the other datasets

the standard edit permission options is greyed out

or is there a different solution

I amended my signature to truenas core 12.0

I don 't find any case on the net for this, Sorry

Thank you for your patience
 
Last edited:
Top