jails cleanup

Status
Not open for further replies.

hank

Dabbler
Joined
Aug 28, 2013
Messages
19
hi, for practice i created some jails and then deleted them (keeping a working one). but the Reporting screen still shows graphs of all those deleted jails diskspace and wardens. in the NAS file 'manager' view, you still see all of those jail folders, such as .jail.meta, .plugins, .warden-files-cache and so on. of course they can not be deleted from here. i suppose i need to delete them through CLI? if so, could someone show me how to move around to the right folder and the commands to delete them? if there're other ways to clean these up, please share also.

thanks in advance.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
i like to know the way how to clean up the jail as well.
i will keep me eyes on this post.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I don't know if there will be an easy solution. One thing I was thinking about trying was creating on a separate flash drive, a new FreeNAS installation and then restore my backup file. With a lot of luck the bogus information will be dropped. I don't know if I will get to this today though. There is no risk really to doing this either so long as you have a backup of your settings and if you're like me, a minimal setup that would require me about 30 minutes to set it back up from scratch (reboots are the time killer), there is even less risk. I could just do a factory reset myself but since I have extra flash drives set aside for my FreeNAS project, I personally think it's best practice to use them anytime you have a problem where you suspect the flash drive as a problem.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Do this to get rid of the old Reporting graphs:
  1. /usr/local/etc/rc.d/collectd stop
  2. go to /var/db/collectd/rrd/localhost/ and delete directories for graphs you want to remove (the diskspace graph directories start with df-)
  3. /usr/local/etc/rc.d/collectd start
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
Do this to get rid of the old Reporting graphs:
  1. /usr/local/etc/rc.d/collectd stop
  2. go to /var/db/collectd/rrd/localhost/ and delete directories for graphs you want to remove (the diskspace graph directories start with df-)
  3. /usr/local/etc/rc.d/collectd start

I really noob at this instructions

Where do I get into my freenas to type these lines? Shell? Do I have to enable SSH?

Still learning... Everyday...

Thanks for the reply
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Yes, use the shell.
To delete use the "rm" command and "cd" to change directories.

This did in fact work for me.

Thanks for the help!
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
umm, step by step guide please... i am too new to use shell... thanks
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Open the shell, type in step 1.
Google "freebsd cd" and use on step 2.
Google "freebsd rm" look for the -rP commands and delete the files you do not want.
Type in step 3.
Type "exit" and you are done. Now look at your Reporting Tab.

Sorry, you need to learn these very basic commands, it will help you a lot. I would also recommend you review all the basic Linux/FreeBSD commands.
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
will do :P study time... never work this hard back then when i was in school
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
Open the shell, type in step 1.
Google "freebsd cd" and use on step 2.
Google "freebsd rm" look for the -rP commands and delete the files you do not want.
Type in step 3.
Type "exit" and you are done. Now look at your Reporting Tab.

Sorry, you need to learn these very basic commands, it will help you a lot. I would also recommend you review all the basic Linux/FreeBSD commands.

ok, i got problem remove the files. what should i do?
rm: df-mnt-mydata-data: is a directory

 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
got it done now.

must use rm and rmdir command

all good now. but got 1 more question those epair1a, epair2a, epair3a are empty as well.. can i delete them as well?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Yes. Those are the graphs for the virtual jail network interfaces.
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You could have used "rm -rP df-mnt-mydata-data" vice rmdir but both work.

It sucks at times learning a new thing when all you want to do it make it work but trust me, you will help yourself if you stick with FreeNAS and then you can reference this on any other UNIX/BSD/Linux thing that happens across your path.
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
Thanks for your help!

What does -rP means?

Remove all content in directory and the directory?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
http://www.freebsd.org/cgi/man.cgi?manpath=freebsd-release-ports&query=rm
[PANEL]-d Attempt to remove directories as well as other types of files.

-P Overwrite regular files before deleting them. Files are overwritten three times, first with the byte pattern 0xff, then 0x00, and then 0xff again, before they are deleted. Files with multiple links will not be overwritten nor deleted and a warning will be issued. If the -f option is specified, files with multiple links will also be overwritten and deleted. No warning will be issued.

Specifying this flag for a read only file will cause rm to generate an error message and exit. The file will not be removed or overwritten.

N.B.: The -P flag is not considered a security feature (see BUGS).

-R Attempt to remove the file hierarchy rooted in each file argument. The -R option implies the -d option. If the -i option is specified, the user is prompted for confirmation before each directory's contents are processed (as well as before the attempt is made to remove the directory). If the user does not respond affirmatively, the file hierarchy rooted in that directory is skipped.

-r Equivalent to -R.[/PANEL]
So, -r means recursive delete (it asks rm to delete the directory and its content), but I have really no idea why Joe suggests -P...
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I don't know why I use it, I guess I always have. Maybe I'll try it without it next time. Linux is not my language, still learning and will be for a long time to come.
 
Status
Not open for further replies.
Top