trying to remove movie folders from root pool

Joined
Oct 4, 2018
Messages
2
Hi everyone, I'm very stuck on a problem.
when I setup my Truenas pool I didn't setup correctly. I have place all my movie files into the root pool call "freenas1" without creating a correct dataset for that pool.
So now I have created a dataset "movie1" and have copy all movie to that dataset.
so my problem is how can I delete all the movies folders (each movie have its own folders) from that "freenas1" root pool without deleting my newly created dataset and other folders in that pool?
I have try many days and have use google to solve this problem but with no luck! hope someone can help
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
You can use the rm command form the shell/command line. However this can be a very dangerous command if you do not know what you are doing. In order to give you the correct answer we will need to know the layout of the directory. From the Shell (GUI) or CLI (SSH), you can 'cd' into each directory and then use 'rm' and the name of the file. If you have a lot of content to delete, it could take you a long time to do this. This is the safe way if you are unsure what you are doing. If you have your content in a single directory, for example see below, let's say all my content in in the directory MOVIES. (I created MOVIES for this only, I will delete it when done)

Sample.png


I could delete this folder and all data within it with a single command rm -rf /MOVIES and it will be all gone.
WARNING !!! I say again, this is a dangerous command. If you are not 100% certain of what you are doing, then do not do it.

If you are truly in the root pool as you call it then you would want the command to be rm /mnt/freenas1/MOVIES to specify the full path.

Now if you have a lot of directories in the root folder to remove, you can use the same command for each directory you desire deleted. It will take time but that is your only option that I can see from the limited amount of information provided.

If you are not quite comfortable yet, post the output of ls -all /mnt/freenas1 here and I will try to provide you an exact command. You can also send me a private message if there is information in that listing you would rather not share with everyone.
 
Joined
Oct 22, 2019
Messages
3,641
WARNING !!! I say again, this is a dangerous command. If you are not 100% certain of what you are doing, then do not do it.

@raymondxcheung
Make a habit of this failsafe:
Code:
zpool checkpoint freenas1

After you're done doing what you need to do, and it's a success, delete the checkpoint:
Code:
zpool checkpoint -d freenas1


(Wish TrueNAS had this in the GUI.)
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
@winnielinnie And what is the command for if the OP screws it up and wants to recover?

I have a new system build I hope to have my hands on tomorrow, I will want to give this command a test while I'm putting the new system through its paces.
 
Joined
Oct 22, 2019
Messages
3,641
No means to do it in the GUI.

But they would export the pool, and then when they import it, they need to specify the checkpoint. (You have to use the command-line and bypass the GUI for this part):
Code:
zpool import --rewind-to-checkpoint freenas1


There is a major caveat to this. You will lose everything that was created/modified after the checkpoint. (EVERYTHING.)

That's why it's a bad idea to "keep using your pool like normal" after you create a checkpoint, naively thinking "I can always rewind if something goes wrong!" Unlike snapshots, checkpoints are designed to be used as a one-event pool-wide failsafe.

Either you immediately rewind to it or you discard it if your "risky stuff" was a success. You have to make a decision soon after you do the risky stuff. Otherwise, you'll be sitting on a checkpoint that is useless if you end up using your pool for days and weeks, since those additions will be lost if you need to rewind to the checkpoint.


I will want to give this command a test while I'm putting the new system through its paces.
I'd be curious to know. I tested this on a Linux system playground pool and it worked as expected. (However, I never tested this out on TrueNAS, but I assume it should work the same. It's not clear if the GUI import tool does any magic to correctly report to the middleware. I don't think the middleware should care if you import via the command-line and use this option. But I've been surprised before...)


EDIT: Perhaps I should file a feature request in Jira to add two more options to the GUI:
  • A button on the pool's status page to view, create, and delete the checkpoint
  • An option in the import wizard to rewind to the checkpoint

Of course, there should be a disclaimer in the tooltip and documentation. If someone creates a checkpoint but forgets to delete it, they might be confused by the extra space consumed after some time, since they cannot pinpoint it to their snapshots or datasets. There should also be a disclaimer on how to properly use and understand what a checkpoint is, and how it differs from a snapshot. I.e, it's "one-event" nature.
 
Last edited:
Joined
Oct 4, 2018
Messages
2
thanks guys for your help!
looks like I have to delete it manually using @joechmuck method. I have completely setup freenas wrongly from the start, but creating 2 root pools and copying movie files to it without separating it using dataset.
here is a image of my setup. before upgrading to Truenas I still have access to the pool on my Mac using SMB connection (read and write), but now after the upgrade to the latest Truenas I don't have write permission. Which is part of my problems.... I have tried to attached a photo of my truenas pools but don't know how. lol.

so would have to explain using words. I click the 3 dots on each of my pools the "edit permissions" is blankout, is this normal?


 
Joined
Oct 22, 2019
Messages
3,641
I click the 3 dots on each of my pools the "edit permissions" is blankout, is this normal?
You cannot (nor should you) edit permissions on the root dataset.

They intentionally disable it.
 
Top