*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[HowTo] Install Packages On N4F Embedded

XigmaNAS Packages
Forum rules
Set-Up GuideFAQsForum Rules
zakroma
Starter
Starter
Posts: 22
Joined: 26 Jun 2012 07:43
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#31

Post by zakroma » 01 Nov 2012 11:14

daoyama wrote:
raulfg3 wrote:Yes, open a shell and use chmod and chown if necesary

Code: Select all

chmod 777 /tmp
chmod 777 /var/tmp
This is wrong. Try
chmod 1777 /tmp
chmod 1777 /var/tmp
chmod 1777 /var/tmp/ftmp

You can mount any point of course. but you must run chmod after mount!
Thanks a lot! That did the trick!

cp.engr
Starter
Starter
Posts: 22
Joined: 09 Jul 2012 03:55
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#32

Post by cp.engr » 27 Nov 2012 05:48

I used this guide a while ago, but now I'm wondering: are union-mounts dangerous?

The question is most relevant to this thread. I'd really like some help answering it, thanks.

alexplatform
Starter
Starter
Posts: 38
Joined: 26 Jun 2012 21:21
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#33

Post by alexplatform » 10 Dec 2012 01:05

unionfs mounts can be dangerous generally in the sense that they can cause split brains (data committed to separate locations for the same file) but as long as you're using them on one read only resource and one dynamic, the worst thing that can happen is that changes can disappear if the dynamic member is corrupted or modified when detached. In context of this method this is not really a big risk as your NAS system locations should not be molested much (or at all) following initial configuration.

The post in question really doesn't delve into any of that, it simply notes that neither the developers of unionfs or NAS4free stand behind the code, and you're pretty much on your own if it doesn't work/corrupts your data/eats your children. Its really a standard disclaimer for all free code.

All that said, I've abandoned the unionfs_mount to a zfs dataset method as I've never been able to control disk spindown on the disks housing the dataset. Instead I'm using a thumbdrive with a UFS file system- still with unionfs mounts for /var/db and /usr/local. The proper way to accomplish this should really be with a full jailed environment, but I havent been motivated to build that yet.

Laynezilla
NewUser
NewUser
Posts: 2
Joined: 06 Jan 2013 00:17
Status: Offline

Re: [HowTo] Install Additional Packages On N4F Embedded

#34

Post by Laynezilla » 06 Jan 2013 00:25

alexplatform wrote:If you are using a ZFS pool for your mounted data, you will need to create a UFS formatted container for the unionFS mount.
Bubulein wrote: if you use ZFS following workaround should help.

Code: Select all

zfs create -V 2G heaven/opt # create a 2GB zvol named ufs0 on pool heaven
newfs /dev/zvol/tank/opt # format zvol
mkdir /mnt/opt 
mount /dev/zvol/heaven/opt /mnt/opt # mount the UFS formated zvol
To mount the zvol on boot add the "mkdir and mount command" to System|Advanced|Command scripts

bubulein

Screencast - zfs create -V

So I'm going through this tutorial and I'm stuck here. I have 3 hdds in zfs1 and my file structure is /mnt/pool0/data0/. I'm very fresh to all of this and I have a couple of questions:
How should I change those 4 lines to accurately reflect my file structure?
Where did the names "heaven" and "tank" come from?
Is the zvol automatically named "ufs0"?

Thanks for the help!

Edit: I ended up just trying a bunch of different substitutions. The one that seemed to work was using:

Code: Select all

zfs create -V 2G pool0/opt
newfs /dev/zvol/pool0/opt
mkdir /mnt/opt 
mount /dev/zvol/pool0/opt /mnt/opt
and subsiquently changing all the "/mnt/data/opt" to just "/mnt/opt". If it works, I'll update this.
NAS4Free 9.1.0.1 r775 x64 Embedded on USB
AMD C-60, 8GB Ram, 3X 2TB WD Red in RAID-Z1

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

Re: [HowTo] Install Packages On N4F Embedded

#35

Post by raulfg3 » 06 Jan 2013 09:19

are you consider to use jail instead unionfs to install packages in your embeded Nas4Free?.

Jails is the prefered / recomended way to install in full / embeded Nas4Free.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

Laynezilla
NewUser
NewUser
Posts: 2
Joined: 06 Jan 2013 00:17
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#36

Post by Laynezilla » 06 Jan 2013 18:16

Hmm, I haven't really looked into jails very much. I want to get rtorrent and rutorrent working so I was following this guide. I saw your earlier link recommending the NAS4Free jail setup and am looking into that now. What is the significant difference in the two methods (unionfs and a jail) and would it change the install of rtorrent? Thanks
NAS4Free 9.1.0.1 r775 x64 Embedded on USB
AMD C-60, 8GB Ram, 3X 2TB WD Red in RAID-Z1

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

Re: [HowTo] Install Packages On N4F Embedded

#37

Post by raulfg3 » 06 Jan 2013 18:47

Laynezilla wrote:What is the significant difference in the two methods (unionfs and a jail) and would it change the install of rtorrent? Thanks
the significant diference is that jails do not afect the anfitrion OS ( BSD on Nas4Free), so if not work, do not affect to nas4Free.

And you can update or upgrade Nas4Free and still jails can work, but unionfs perhaps not because diferent version of lib and dependencies.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

dottybee
NewUser
NewUser
Posts: 4
Joined: 20 Oct 2015 21:22
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#38

Post by dottybee » 21 Oct 2015 13:39

Hi folks,
When I try and add a new package using 'pkg_add', I get a Command not found error? I am using nas4FREE 10.2, embedded. I am really struggling to find a solution to this one anywhere on the internet, anyone else have that problem??

Many thanks
Josh

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

Re: [HowTo] Install Packages On N4F Embedded

#39

Post by raulfg3 » 21 Oct 2015 15:55

dottybee wrote:Hi folks,
When I try and add a new package using 'pkg_add', I get a Command not found error? I am using nas4FREE 10.2, embedded. I am really struggling to find a solution to this one anywhere on the internet, anyone else have that problem??

Many thanks
Josh
pkg_add is deprecated, now pkg do the same please google about this change in BSD
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

dottybee
NewUser
NewUser
Posts: 4
Joined: 20 Oct 2015 21:22
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#40

Post by dottybee » 21 Oct 2015 16:32

Hi, thanks. I tried pkg and got command not found error as well. I will try it again tonight!!

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1153
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#41

Post by JoseMR » 21 Oct 2015 17:18

dottybee wrote:Hi, thanks. I tried pkg and got command not found error as well. I will try it again tonight!!
Hello, you can follow this guide as usual, but please don't mount whole /var directory, just mount /var/db, also fix the /usr_local to /usr/local, see the recommended way in the example below:

Code: Select all

# mount_unionfs /mnt/data/opt/usr/local /usr/local
# mount_unionfs /mnt/data/opt/var/db /var/db
To install MC use:

Code: Select all

# pkg install mc-light
Regards
System: FreeBSD 12 RootOnZFS, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
Addons at GitHub
JoseMRPubServ
Boot Environments Intro

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

Re: [HowTo] Install Packages On N4F Embedded

#42

Post by raulfg3 » 21 Oct 2015 17:42

as JoseMR show pkg install works on BSD 10.

https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=7

And my recomendation is still valid, do not use unionfs unless you are a power user and understand what you are doing, better if use jails (or a full N4F install to avoid use of unionfs to install packages)
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

SenseiBulba
NewUser
NewUser
Posts: 2
Joined: 22 Dec 2015 13:29
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#43

Post by SenseiBulba » 22 Dec 2015 14:01

I must be dense but my pkg binary doesn't appear to be doing anything. I keep getting pkg: Command not found. Some reading is showing that it likely isn't included in the base image and needs to bootstrap but it should do this on first run. I just installed the latest build of NAS4Free last night.

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

Re: [HowTo] Install Packages On N4F Embedded

#44

Post by raulfg3 » 22 Dec 2015 15:54

SenseiBulba wrote:I must be dense but my pkg binary doesn't appear to be doing anything. I keep getting pkg: Command not found. Some reading is showing that it likely isn't included in the base image and needs to bootstrap but it should do this on first run. I just installed the latest build of NAS4Free last night.
please copy & paste what you are doing.

this is my NAS and the latest version:

Code: Select all

 rnas: ~# uname -a
FreeBSD rnas.local 10.2-RELEASE-p8 FreeBSD 10.2-RELEASE-p8 #0 r292129M: Fri Dec 11 23:47:42 CET 2015     root@dev.nas4free.org:/usr/obj/nas4free/usr/src/sys/NAS4FREE-amd64  amd64
 rnas: ~# pkg
pkg: not enough arguments
Usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>|-r <rootdir>] [-C <configuration file>] [-R <repo config dir>] [-o var=value] [-4|-6] <command> [<args>]

For more information on available commands and options see 'pkg help'.
 rnas: ~#
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

SenseiBulba
NewUser
NewUser
Posts: 2
Joined: 22 Dec 2015 13:29
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#45

Post by SenseiBulba » 23 Dec 2015 01:01

I think I will probably creating a new thread for whatever is going on on my installation. the webconsole and all inbound connections seem to stop accepting connections. I'm planning on rolling the settings back to factory (recent upgrade so I'm wondering if it's anything I brought over.) As for what I'm doing i'm just sshing into the box and running pkg and getting pkg: command not found.

Chris_DA-DJ-MC
NewUser
NewUser
Posts: 8
Joined: 07 May 2016 14:19
Status: Offline

Re: [HowTo] Install Packages On N4F Embedded

#46

Post by Chris_DA-DJ-MC » 23 May 2016 00:00

Hi N4F guys,

oh… found this rather old threat, so I’ll post my findings here, and its solved, but maybe useful for someone else.

I am facing a problem you may can help me solve in a „clean“ matter.
I use the embedded version - 10.2.0.2 - Prester (revision 2545).
I use unionfs to merge-mount /var and /usr/local over to a persistent place, to be able to install additional packages…
The problem is the start of N4F Web GUI and AFTERWARDS the mounting of the this 2 filesystems.
Why?
Because lighttp creates 2 “files” under /var/tmp/fastcgi/
12 srwxr-xr-x 1 root wheel 0 May 22 15:06 php.socket-0
3 srwxr-xr-x 1 root wheel 0 May 22 15:06 php.socket-1
These “files” are gone after I do:
mount_unionfs /mnt/ssd/opt/var /var
mount_unionfs /mnt/ssd/opt/usr/local /usr/local
so unionfs cannot handle such “socket mapping files”(?) (just have problems with this 2 s(!!!)rwxr-xr-x files…)
(they are not gone, but overmounted… after a unmount everything is working well again, ah… the problem: Web GUI is showing error 503 - Service Not AvailableI..
As I cannot influence the start of lighttp (and therefore the Web GUI) to happen AFTER the mount_unionfs, I am not quite sure how to fix this…
The unionfs mount happens as a postinit script (preinit isn’t possible as unionfs seams not present directly after loading the kernel.)
If I start lighttp whith the already mounted unionfs filesystem itrs working fine.
So I could do a postinit script stopping lighttp, mounting filesystems, starting lighttp…
But that’s not elegant, why start lighttp anyway in the first place… also I cant stop lighttp proper, I have to kill -9 it…

Any ideas…?

Solution:
For package maintainig just mount_unionfs on /var/db (besides /usr/local), not the whole /var/ including the tricky files containing /var/tmp…
or I use jails, havent done anything with jails yet...


thanks, bye & good night.

Chris

Post Reply

Return to “Packages”