NanoBSD Build "FileSystem Full" error code

Hello all,

I am interested in building a NanoBSD system. I keep getting "FileSystem Full" error codes. I adjusted the custom settings file to NANO_MEDIASIZE=10000000 and I still got the error code. I issued the command of df and I am seeing 68% under Capacity for the /usr partition. So I am not running out of space there. To recap, the command that I am actually using is:

sh nanobsd.sh -c custom_file.txt

Error Code is:

Capture.PNG
 
There are many more setting regarding sizes. Here are a few I pulled from my nanobsd.cfg
NANO_SLICE_FAT_SIZE=32m
NANO_SLICE_CFG_SIZE=32m

NANO_RAM_ETCSIZE=8192
NANO_RAM_TMPVARSIZE=8192

So as you can see some are based on physical size (32m) and others are based on blocksize.

You might want to limit the build script to only one image until you get everything figured out
NANO_IMAGES=1
 
First, THANK YOU SO MUCH for the reply! I will systematically try each setting one by one and to see if I can isolate the solution.
 
What I do is use the file named common from the /nanobsd/embedded/ directory and include that in my nanobsd.cfg.
I modify it to suit my needs.
The /nanobsd/embedded directory has mainly Arm builds but the i386.cfg file is usable for general purpose builds.
Look at the README in that directory for further instructions.
That part has been more recently worked on and is not well documented.
It still uses the master nanobsd.sh build script but adds on to the work.

So I copy out /embedded/common to a new directory under /nanobsd (nanobsd/apu2 for example) and add my nanobsd.cfg.
You can copy i386.cfg and use as a template.
Then modify to suit my needs. i386.cfg can be given directives to override common or you can directly modify common.
I add packages to my nanobsd.cfg file with a custom function found in nanobsd (there are two different pkg fiunctions).

Here are the custom functions I use in my nanobsd.cfg.
#Customize Commands Here:
customize_cmd cust_comconsole
customize_cmd cust_allow_ssh_root
customize_cmd cust_install_files
customize_cmd cust_pkgng
customize_cmd cust_rootpasswd
customize_cmd cust_install_build_files
 
Last edited:
Again Phishfry, thank you for the help! Here is what I have done so far. I have read the README file in the embeded directory. I ran the exact command of:

sh ../nanobsd.sh -c i386.cnf

with 0 customizations. I am currently performing a build with the standard i386 file. My logic is that I want to see what happens. This will give me a foundation of troubleshooting, a zero point, and a little bit of possible success.

Before I ran the above command I lightly read the i386 file and I noted that it was importing the common file in the same dir. As a result, I copied the i386 and common file into the same dir as the nanobsd.sh file thinking it would work, nope. ha ha! I got an error code of: make: cannot open Makefile.inc1 So clearly the common file is doing a lot more than I realize.

FInally, you wrote a lot more information and that is recognized. I want to try and progress literately with something basic first and then read your customization stuff on your second post.
 
Using the i386.cfg file as a start is a good way to get started.
I deleted the post with all my customization's. It was for FreeBSD 11.2 and I don't want to lead you down the wrong path.
 
I just built stock FreeBSD 12.1 NanoBSD i386.cfg and it works fine.
00:30:36 # NanoBSD image i386 completed
For checking out my image /usr/embedded/images/_.disk.image.i386 I used mdconfig(8) to load my image into a file based memory disk.
cd /usr/embedded/images/
mdconfig -u md0 -f _.disk.image.i386
ls /dev/md*
/dev/md0 /dev/md0s1 /dev/md0s1a /dev/md0s3 /dev/mdctl
mount /dev/md0s1a /mnt
ls /mnt
 
The build only took 30 minutes?!!? I am jealous! It takes my virtual machine about 3 hours. I might need to add some hardware there. I was actually just moving the image to a USB stick by the dd command in the howto guide. Give me a minute to test and I will report back.
 
*sigh* I cannot get the USB to boot to NanoBSD after I dd the image to the USB stick. I performed the above steps you outlined and I see the FreeBSD folder structure as it should be. As a result, I am sure that the img file is correct. What am I missing?
 
The other possible issue is that the stock NanoBSD image only runs on Legacy BIOS, Not on UEFI.
So make sure that your BIOS is set to boot from Legacy or CSM.
 
I am using a SuperMicro X10SRi with 16GB RAM and a 20 core CPU. Samsung PM983 NVMe for storage.
The buildworld portion took 25 Minutes. The rest was fast.
Many cores and NVMe are the tricks to fast building.
CPU clockspeed and Memory are not that important.
 
I am pretty sure that the image that is created is for ada0, not for a USB device.
You can modify i386.cfg to superseded the common file directive to use da0 instead.
I just burned my image to USB disk and notice that /etc/fstab points to ada0

So change NANO_DRIVE to da0 in i386.cfg if you want to use a USB drive.
 
So, what I have done so far is that I decided to just wipe and reload my FreeBSD system. I wiped and reloaded and rebuilt the i386 WITHOUT the information from your last message. I am going to change what you recommended and report back.

I cannot thank you enough for all of your help so far! I built and ran NanoBSD a few years ago and I thought I would try my hand at it again. Apparently, there have been lots of changes.
 
Well you were right. I cannot get 12.1 build to startup. Just a blinking cursor.
So save yourself some hassle....
I am loading up FreeBSD 12.0 right now to see where that goes.
My last NanoBSD build was on FreeBSD-11.2 so I will drop back to FreeBSD-11.3 if FreeBSD-12.0 does not work either.
Will keep you advised. It is a Nano New Years party for me tonight.
 
I got it working on FreeBSD 11.3 with the addition of these lines to my i386.cfg
Code:
NANO_BOOTLOADER="/boot/boot0"
NANO_BOOT0CFG="-s 1 -m 3 da0"
NANO_BOOT_MBR="/boot/mbr"
 
So, here is what I am doing. WIth the FreeBSD 12.1 machine, I am using the rpi3.cfg standard file to see if the same thing happens as the i386 standard build. Meanwhile, I created another virtual machine and installed FreeBSD 11.3 and using your modifications so that should be good to go. I will let you know progress on both fronts.
 
The important setting here is NANO_BOOTLOADER="/boot/boot0".
The default setting in /nanobsd/embedded/common is NANO_BOOTLOADER="/boot/boot0sio".
This is meant for boards with a serial console available. So many boards do no have a 'Serial Redirect' feature and cannot use boot0sio.
Now for your RPI3 build you should use the default settings as found in /nanobsd/embedded/rpi3.cfg.

I did a diff on nanobsd.sh and common and found no major differences between versions.
So it really comes down to the settings for your build.

For this setting NANO_BOOT0CFG="-s 1 -m 3 da0" you may need to use slice 2 instead. I had it stop at mountroot and had to type:
ufs:/dev/da0s2a
So you may need to experiment with this line.
This may be more appropriate:
NANO_BOOT0CFG="-s 2 -m 3 da0"
 
The same thing happened to me at mountroot. I typed in: ufs:/dev/da0s2a and it looks like it froze on booting up. I am currently rebuilding i386 with your new recommended settings in the above post.
 
Yeah, I cannot get it to boot with the command of: ufs:/dev/da0s2a. I give up. This cannot and should not be this hard. lol
 
OK lets move back to using only the nanobsd script.

cd /usr/src/tools/tools/nanobsd

Create a config file with these settings.
/usr/src/tools/tools/nanobsd/build1.cfg
Code:
NANO_DRIVE="da0"
NANO_PMAKE="make -j $(sysctl -n hw.ncpu)"
NANO_IMAGES=2
NANO_MEDIASIZE=12000000
NANO_BOOTLOADER="boot/boot0"
NANO_IMGNAME="nanobsd_${NANO_NAME}_${NANO_DRIVE}.img"

Now run your config:
sh nanobsd.sh -c build1.cfg

Once complete you can write your image to trhe USB stick:
dd if=/usr/obj/nanobsd.full/nanobsd_full_da0.img of=/dev/da0 bs=1M conv=sync
 
If you want to make minor changes to your build you can rebuild without recompiling everything (saving massive time).
sh nanobsd.sh -bc build1.cfg
The -b flag allows you to keep your existing buildworld and buildkernel stages.

Let me know how it goes for you. I have tested this config. It does make an 5GB image with basically 2 full installs on slice s1a and s2a.
You can slim it down from here.

Some additional documentation.
 
I have re-invigorated my NanoBSD work with a fresh FreeBSD 12.1 build.
Here is my Gist file of a very minimal NanoBSD. Use at your own risk as it is very stripped out.
I like to start minimal and add things back as needed.
This build creates a 768 Megabyte image file with dual OS slices for a USB device.
There is 180 Megabytes free on each OS slice.
You could slim this build even more with a custom kernconf.


So for this config you need to make a separate directory for the build file:
mkdir /usr/src/tools/tools/nanobsd/custom
Now copy the Gist file into /usr/src/tools/tools/nanobsd/custom/custom.cfg
You run it with this command:
cd /usr/src/tools/tools/nanobsd/custom
sh ../nanobsd.sh -c custom.cfg

You also need (optionally) to create a directory for your desired packages:
mkdir /usr/src/tools/tools/nanobsd/Pkg
In this directory you must place any packages you want pre-installed.
They must be in the *.txz format and you must include all dependencies and put pkg.txz in there as well.
You can fetch these packages from here:
Use the All directory and place the files in the /usr/src/tools/tools/nanobsd/Pkg directory

I also include pre-built system config files in an overlay directory. So you need to create this:
mkdir /usr/src/tools/tools/nanobsd/custom/overlay
Treat this directory as your builds uppermost or "/" directory.

For a custom rc.conf you need to build the directory structure:
mkdir /usr/src/tools/tools/nanobsd/custom/overlay/etc
Now create an rc.conf in this directory. It will be used in your NanoBSD build.

For loader.conf
mkdir /usr/src/tools/tools/nanobsd/custom/overlay/boot
Now create your custom loader.conf in this directory.

As you can see from the config file the root user 'freebsd' password is created.

A sample /usr/src/tools/tools/nanobsd/custom/overlay/etc/rc.conf
Code:
hostname="custom"
sshd_enable="YES"
dumpdev="NO"
ifconfig_DEFAULT="DHCP"

A sample /usr/src/tools/tools/nanobsd/custom/overlay/boot/loader.conf
Code:
autoboot_delay="-1"
 
Back
Top