When booting from an NFS root volume, /etc/rc detects the NFS boot and runs /etc/rc.initdiskless. In this case, /etc and /var need to be memory backed file systems so that these directories are writable but the NFS root directory is read-only:
# chroot ${NFSROOTDIR}
# mkdir -p conf/base
# tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc
# tar -c -v -f conf/base/var.cpio.gz --format cpio --gzip var
chroot ${NFSROOTDIR}
and pkg add -y mc
but that didn't work either...Upates with pkg-add
pkg-add keeps a database of installed packages at /var/db/pkg. We do updates from a client machine with rw access to /pxeroot and the original freebsdboot:/pxeroot/var mounted as its /var.
Also triedchroot ${NFSROOTDIR}
andpkg add -y mc
but that didn't work either...
pkg install -y mc
instead.root@freenas:/ # chroot /mnt/nas/tftproot/FreeBSD
root@freenas:/ # pkg install -y mc
pkg: /var/db/pkg/local.sqlite permissions (0775) too lax
root@freenas:/ # pkg install -y mc
pkg: /var/db/pkg/local.sqlite wrong user or group ownership (expected 0/0 versus actual 65534/65534)
chmod
and chown
correctly and trying again I get:-oot@freenas:/ # pkg install -y mc
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
ld-elf.so.1: Shared object "libslang.so.2" not found, required by "mc"
Also it will be good to know your system versions in both of your system's root and your$NFSROOT
. And which way did you take to you make your$NFSROOT
-make buildworld installworld
,bsdinstall
or other.
$NFSROOT
.ld-elf.so.1: Shared object "libslang.so.2" not found, required by "mc"
I will try and create a script to detail exactly what I did, but in brief terms I just extracted kernel.txz and base.txz from https://download.freebsd.org/ftp/releases/amd64/12.0-RELEASE/ into$NFSROOT
.
amd64
arch requires it. You can try the script that I wrote for simple and fast installing of FreeBSD - on the new system or as a jail template or as the diskless root - you can take it in this thread: