Another out of room thread.

Status
Not open for further replies.

the_owl

Dabbler
Joined
Jan 13, 2015
Messages
27
I'm not much of a FreeBSD user, I built a Freenas box for media. Movies, music etc for home use.
I use newsgroups sometimes to download. The other day a corrupt nzb file caused the article grabber to start creating hundreds of thousands of 204mb files in the cache directory. It filled up my freenas box. I know I'm a bad admin for not setting a policy to restrict this, but I didn't think Id be filling up a 21tb zfs!
I don't know how to delete some of these folders exactly. I'm worried about losing my data. I have gone in via ftp, but I also get the "No space left on device" error.
How can I safely delete folders and sub files ?
Thanks
 

the_owl

Dabbler
Joined
Jan 13, 2015
Messages
27
I can get in viaputty , is the shell in the gui the same thing? What command would delete folders with subs? thanks
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I can get in viaputty , is the shell in the gui the same thing? What command would delete folders with subs? thanks
No the GUI shell is not the same as getting in via ssh.
Code:
find /pathToYourParentFolderContainingYourSubFiles  -name "*.sub" -type f -delete
Make sure -delete is the last argument or it will delete everything. OR
Code:
find /pathToYourParentFolderContainingYourSubFiles -name "*.sub" -type f -exec rm {} \;


The above commands will delete all the files that have a .sub extension.

It won't delete the folders though. If the names of all the folders have a similar pattern then you can choose to include that in the command to delete everything in the same command. -type f is what only selects files and not folders. If you remove that flag, it will delete folders as well, but then again only folders with .sub extension.

Let us know if there is a pattern to the naming of the folders and files and I can give you a better command that will do what you need to do.
 
Last edited:

the_owl

Dabbler
Joined
Jan 13, 2015
Messages
27
Actually none of the files have extensions. I just want to delete the entire folder and its contents. They are all random 10 character names with some numbers. really weird.
How does that command look?
 

Mirfster

Doesn't know what he's talking about
Joined
Oct 2, 2015
Messages
3,215
Here is an example of me using "ls" to list items. Then I drill down to locate the directory called "DeleteAllOfMe". From there I issue the command to delete that entire directory and all subfolders/files.

*** Be Careful and Work Intelligently, You do NOT want to accidentally delete the wrong folders! ***

P.S. From within Putty you can start to type the name and hit [TAB] to have it try to autocomplete the remaining name

Using Putty:

Code:
[root@ALS-FN01] ~# ls /mnt
./			 ../			ALS-CIFS-V01/  ALS-ISCSI-V01/ md_size
[root@ALS-FN01] ~# ls /mnt/ALS-CIFS-V01/
./				AD-DATAVOL-DS01/  AD-USERSVOL-DS01/
../			   AD-SYSVOL-DS01/
[root@ALS-FN01] ~# ls /mnt/ALS-CIFS-V01/AD-DATAVOL-DS01/
./				   CreatorOwner/		VisibleToAll/
../				  DeleteAllOfMe/	   WriteableByAll/
.recycle/			Software/			aLias-Drobo/
.windows*			VisibleToAdminsOnly/
[root@ALS-FN01] ~# rm -rf /mnt/ALS-CIFS-V01/AD-DATAVOL-DS01/DeleteAllOfMe/
[root@ALS-FN01] ~#


For reference, here is a screenshot of it as well:
upload_2018-5-24_9-36-0.png
 

the_owl

Dabbler
Joined
Jan 13, 2015
Messages
27
hmm, maybe I cant ssh into it. Seems like its not working now. Other than enabling ssh in the gui, could the disk space be preventing ssh access?
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
hmm, maybe I can't ssh into it. Seems like its not working now. Other than enabling ssh in the gui, could the disk space be preventing ssh access?
You previously mentioned you were able to SSH into it. So what changed?

I doubt disk space would prevent SSH access to a box.
 

Mirfster

Doesn't know what he's talking about
Joined
Oct 2, 2015
Messages
3,215
I'm not sure. says network error. connection refused. Strange
Well, if your system is truly 100% full, then strange things can happen...

If you can get in via the Web GUI and choose [Shell]; then you can still perform the same commands.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Here is an example of me using "ls" to list items.
...or you might find using the Midnight Commander to be a bit easier. Just run mc.
 

Mirfster

Doesn't know what he's talking about
Joined
Oct 2, 2015
Messages
3,215

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

the_owl

Dabbler
Joined
Jan 13, 2015
Messages
27
thanks for the help. SSH was turned off in services for some reason. I was able to delete the folder and carry on.
 

the_owl

Dabbler
Joined
Jan 13, 2015
Messages
27
Hello again. Well my lovely freenas filled up again. Totally my fault too.
It appears I cant even run this command:
Code:
 rm -rf /mnt/ARRAY/DOWNLOAD/Cache/4IEQkPQpCDItA3bHlFHYfau No space left on device

This is via ssh
 
Joined
Jul 10, 2016
Messages
521
No -rf, just the echo as above with the path to a specific file (not a directory)
 
Status
Not open for further replies.
Top