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!

Can't install new SW to a full Jail

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
spargopolis
NewUser
NewUser
Posts: 7
Joined: 03 Sep 2013 02:04
Location: Ottawa, Canada
Status: Offline

Can't install new SW to a full Jail

Post by spargopolis »

Fairly new to nas4free, freeBSD, and very new to Jails.

My host OS has nas4free 9.1 installed and running, I have a single hard drive mapped to /mnt running ZFS.

I installed the "theBrig". All seemed to go well. I have two jails both running nas4free 9.1. One is slim and the other is full. Both run, but I have stopped the slim one. The full jail is mapped to "/mnt/MediaPool0/Jail/gitJailFull" (if I understand correctly, this is where it's virtual "/" is. The full jail runs fine, web interface works, SSH works, SMB works, etc.

I believe that having a full jail will allow me to install addition S/W (since this is what I would like to do), but please correct me if I'm wrong. Specifically I want to install a git server and possibly other apps in the full jail. When I try, I get a similar behaviour to when I tried to install git on the host nas4free image, which is to say lots of errors. i.e.

Code: Select all

nas4free: git_pkgs # pkg_add -r git
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.1-release/Latest/git.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.1-release/All/perl-5.14.2_2.tbz...
/var: write failed, filesystem is full
lib/perl5/5.14.2/pod/perldiag.pod: Write failed
lib/perl5/5.14.2/pod/perldsc.pod: Write failed
lib/perl5/5.14.2/pod/perlebcdic.pod: Write to restore size failed
lib/perl5/5.14.2/pod/perlembed.pod: Write to restore size failed
lib/perl5/5.14.2/pod/perlepoc.pod: Write to restore size failed
... lots of these
What I don't understand are these "filesystem full" errors, when the entire jailed nas is supposedly mounted on "mnt/MediaPool0/Jail/gitJailFull", which should map to my physical hard drive, not the embedded USB stick? Note the hard drive reports 366 GB free.

Thanks for your interest. Any help would be appreciated.

spargopolis
NewUser
NewUser
Posts: 7
Joined: 03 Sep 2013 02:04
Location: Ottawa, Canada
Status: Offline

Re: Can't install new SW to a full Jail

Post by spargopolis »

A bit more info... which confirms the physical location of the full jail.

Code: Select all

hostnas: ~ # jls
   JID  IP Address      Hostname                      Path
     7  192.168.1.202   gitJailFull.local             /mnt/MediaPool0/Jail/gitJailFull

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Can't install new SW to a full Jail

Post by raulfg3 »

do you log inside your jail?

eg: jexec 7 csh in your example?
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: Can't install new SW to a full Jail

Post by alexey123 »

This line

Code: Select all

nas4free: git_pkgs # pkg_add -r git
say: You tried install software from main host. This way not correct. For install software into jail, you need type commands inside a jail
As Raul says - enter into jail

Code: Select all

jexec gitJailFull csh
and install software

Code: Select all

pkg_add -r git
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

spargopolis
NewUser
NewUser
Posts: 7
Joined: 03 Sep 2013 02:04
Location: Ottawa, Canada
Status: Offline

Re: Can't install new SW to a full Jail

Post by spargopolis »

Hi Guys,

Sorry for the slow reply; my Internet has been down.

Thanks for the suggestions. Earlier I thought by SSH'ing in the Jail IP address I would already be running inside the Jail. But apparently not.

I typed:

Code: Select all

spargonas: ~ # jls
   JID  IP Address      Hostname                      Path
     7  192.168.1.202   gitJailFull.local             /mnt/MediaPool0/Jail/gitJailFull
spargonas: ~ # jexec 7 csh
root@gitJailFull:/ # pwd
/
root@gitJailFull:/ # pkg_add -r git
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.1-release/Latest/git.tbz... Done.
...
Removing stale symlinks from /usr/bin...
    Skipping /usr/bin/perl
    Skipping /usr/bin/perl5
Done.
...
root@gitJailFull:/ # git --version
git version 1.8.0
So cool git is installed.

Which brings up the next question :-). The data I want to place under git source control physically resides on my hard disk here: "/mnt/media/...". Since my Jail is mounted/rooted at "/mnt/MediaPool0/Jail/gitJailFull", as far as I know I can't see the data. Is there any way to make the data accessable to this Jail (or another one I create), or does it need copied to under the root of the Jail? Would a symbolic link possibly work? Sorry for the noob question.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Can't install new SW to a full Jail

Post by raulfg3 »

spargopolis wrote: Is there any way to make the data accessable to this Jail
yes, configte fstab, see my example: viewtopic.php?f=79&t=3894#p20142
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: Can't install new SW to a full Jail

Post by alexey123 »

Also you can simple copy needed data from nas4free, if it have small size.
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

spargopolis
NewUser
NewUser
Posts: 7
Joined: 03 Sep 2013 02:04
Location: Ottawa, Canada
Status: Offline

Re: Can't install new SW to a full Jail

Post by spargopolis »

Hi,

My earlier question was a bit premature. It turns out I had added some mount points in the fstab already as per the instructions to install TheBrig... I had just forgotten, i.e.

Code: Select all

spargonas: ~ # ll /etc/fs*
-rw-r--r--  1 root  wheel   50 Oct  7 01:52 /etc/fstab
-rw-r--r--  1 root  wheel  376 Oct  7 05:42 /etc/fstab.gitJail
-rw-r--r--  1 root  wheel  308 Oct  7 05:42 /etc/fstab.gitJailFull
spargonas: ~ # cat /etc/fstab.gitJailFull
/mnt/media/pictures /mnt/media/Jail/gitJailFull/mnt/media/pictures nullfs rw 0 0
/mnt/media/videos /mnt/media/Jail/gitJailFull/mnt/media/videos nullfs rw 0 0 
/mnt/media/music /mnt/media/Jail/gitJailFull/mnt/media/music nullfs rw 0 0 
/mnt/MediaPool0/Jail/conf/ports/ /mnt/MediaPool0/Jail/gitJailFull/usr/ports/ nullfs ro 0 0
Note that I have many subfolders under each of these mount source points.. e.g.

Code: Select all

spargonas: ~ # ll /mnt/media/pictures/
total 17
drwxrwxrwx  45 root  wheel  45 Sep  7 03:42 2010/
drwxrwxrwx  43 root  wheel  43 Sep  7 04:39 2011/
drwxrwxrwx  79 root  wheel  79 Sep  7 08:49 2012/
drwxrwxrwx  58 root  wheel  58 Oct 13 02:51 2013/
drwxrwxrwx   2 root  wheel   2 Sep  4 06:50 2014/
Now when I enter the Jail, I do see the mount point, however I don't have any of the content below this. i.e.

Code: Select all

spargonas: ~ # jls
   JID  IP Address      Hostname                      Path
    1  192.168.1.202   gitJailFull.local             /mnt/MediaPool0/Jail/gitJailFull
spargonas: ~ # jexec 1 tcsh
root@gitJailFull:/ # ll /mnt/media/pictures/
total 0
Is there a way to create a recursive mount point, such that I see all the files/folders below the ? From what I understand of the mount command, this should be the default behaviour.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Can't install new SW to a full Jail

Post by raulfg3 »

fstab and jail are not equal:
/mnt/media/pictures /mnt/media/Jail/gitJailFull/mnt/media/pictures nullfs rw 0 0
see: /mnt/media/pictures is where you have your original share folder pictures.
/mnt/media/Jail/gitJailFull/mnt/media/pictures is the folder pictures inside the jail gitJailFull , where you want to mount pictures. (But is incorrect because is not in the correct path of jail)

but you say that do not see in: /mnt/MediaPool0/Jail/gitJailFull ; see MediaPool0


to work your fstab must be:

Code: Select all

/mnt/media /mnt/MediaPool0/Jail/gitJailFull/mnt/media nullfs rw 0 0
And you must create folder media prior to work:

Code: Select all

mkdir: /mnt/MediaPool0/Jail/gitJailFull/mnt/media
from shell outside the jail, once done , stop your jail and re-start.

this time inside the jail if you go to

Code: Select all

cd /mnt/media
and do

Code: Select all

ls- l
you can see your pictures, videos and music folders correctly mounted.
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

spargopolis
NewUser
NewUser
Posts: 7
Joined: 03 Sep 2013 02:04
Location: Ottawa, Canada
Status: Offline

Re: Can't install new SW to a full Jail

Post by spargopolis »

Hi,

Yes that was the problem, thanks very much! Now I can see all the media content inside the Jail, and have git installed.

Hopefully my last issue is this; I want to use git on my LAN to backup data. Therefore I require network access to the Jail. When I try:

Code: Select all

root@gitJailFull:/ # ping 192.168.1.101
ping: socket: Operation not permitted
root@gitJailFull:/ # whoami
root
root@gitJailFull:/ # which ping
/sbin/ping
root@gitJailFull:/ # 
I did do some Googling and I think I need to update my /etc/rc.conf file. It's currently set to:

Code: Select all

root@gitJailFull:/ # cat /etc/rc.conf 
sendmail_enable="NONE"
syslogd_flags="-ss"
rpc_bind="NO"
network_interfaces=""
cron_flags="$cron_flags -J 15"
root@gitJailFull:/ # 
A pointer to a thread on this subject would be great. Thanks very much for your help!

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Can't install new SW to a full Jail

Post by raulfg3 »

you need to active global atribute: Route only TCP/IP within a jail
in the brig webgui.
jail1.jpg
You do not have the required permissions to view the files attached to this post.
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

Post Reply

Return to “Jails”