This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

Strip down proto jail

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
Mizma
experienced User
experienced User
Posts: 79
Joined: 02 Feb 2013 15:53
Status: Offline

Strip down proto jail

Post by Mizma »

I have followed the guide to strip down proto jail. http://wiki.nas4free.org/doku.php?id=do ... owto:jails

My issue is that it seems all those source files thats being downloaded and used isn't erraces after buildword is done so I end up with a bigger directory than the one i started with. Is it supposed to be this way or shall I remove some temp direcory after im done?

Second when it comes to make a new jail by this building world way. Could someone explain what seems to be obvius for everyone else but me what to whrite
in DESTDIR=/mnt in an embedded install.
Installworld to the www jail mounted on /mnt:

proto# cd /usr/src
proto# make installworld DESTDIR=/mnt

It should be clear what DESTDIR= means:

proto# make distribution DESTDIR=/mnt

fsbruva
Advanced User
Advanced User
Posts: 378
Joined: 21 Sep 2012 14:50
Status: Offline

Re: Strip down proto jail

Post by fsbruva »

In order to strip down the jail, you are rebuilding the entire world (all the userland programs). Rebuilding is actually parlance for recompiling all of the programs that make up the standard FreeBSD from scratch, using the source code that you downloaded with the cvsup. (Which reminds me, I gotta change the wiki to use svn). Once the source code is downloaded, it doesn't get deleted. After you have completed the installworld and installation builds, you can delete the contents of /usr/src.

In a normal Nas4Free embedded installation, / represents the root of the directory tree. Once you are inside a jail, / represents the root of the JAIL's directory tree. So, as far as the jail in concerned, / is the root. But, if you followed the wiki, / within the jail actually lives at /jail/proto in the real world (Nas4Free). That's why you did a mount_nulls command. So, for doing the buildworld, you will mount a real-life, persistent, Nas4Free location (/mnt/zpool4/jail/albatross) to a location within the jail. Now, the jail will think the mountpoint is /mnt/alby, but in real life, that is located at /jail/proto/mnt/alby. So, you will create a directory called "alby" at /jail/proto/mnt from Nas4free. Then, from Nas4free, you will mount_nullfs where the jail will actually live (/mnt/zpool4/jail/albatross) to the mountpoint (/jail/proto/mnt/alby).

Mizma
experienced User
experienced User
Posts: 79
Joined: 02 Feb 2013 15:53
Status: Offline

Re: Strip down proto jail

Post by Mizma »

Oki I see
Then how do i remove those files rmdir just sais directory not empty. is there a commado to just remve all, do i have to change any permition flags.

I'll play aroud a bit more build world to understand how it works.

Mizma
experienced User
experienced User
Posts: 79
Joined: 02 Feb 2013 15:53
Status: Offline

Re: Strip down proto jail

Post by Mizma »

After I deleted the cotents of /usr/src the usr folder still contains 42 583 files at a total of 1,20 GB this compared to a clean install where I haven't downloaded FreeBSD and rebuilt the usr folder contains 41 770 files at a total of 1,62 GB.

fsbruva
Advanced User
Advanced User
Posts: 378
Joined: 21 Sep 2012 14:50
Status: Offline

Re: Strip down proto jail

Post by fsbruva »

rm -r is the command you want. That will remove (recursively) all the files and the directories contained within.

Mizma
experienced User
experienced User
Posts: 79
Joined: 02 Feb 2013 15:53
Status: Offline

Re: Strip down proto jail

Post by Mizma »

I used
chflags -R noschg src
rm -rf src

Post Reply

Return to “Jails”