# NanoBSD 10 Error while creating the image



## allan_sundry (Jan 24, 2014)

Hi,

I encountered an error when creating the image NanoBSD 10:

```
[root@marseilles /usr/src/tools/tools/nanobsd]# sh nanobsd.sh -b -c nanobsd.conf.X
00:00:00 # NanoBSD image full build starting
00:00:00 ## Skipping buildworld (as instructed)
00:00:00 ## Skipping buildkernel (as instructed)
00:00:00 ## Clean and create world directory (/usr/obj/nanobsd.full//_.w)
00:00:03 ## Construct install make.conf (/usr/obj/nanobsd.full//make.conf.install)
00:00:03 ## installworld
00:00:03 ### log: /usr/obj/nanobsd.full//_.iw
00:01:45 ## install /etc
00:01:45 ### log: /usr/obj/nanobsd.full//_.etc
00:01:47 ## configure nanobsd /etc
00:01:47 ## install kernel (MY_KERNEL)
00:01:47 ### log: /usr/obj/nanobsd.full//_.ik
00:02:39 ## run customize scripts
00:02:39 ## customize "add_pkg"
00:02:39 ### log: /usr/obj/nanobsd.full//_.cust.add_pkg
00:02:42 ## customize "add_port_net-mgmt_net-snmp"
00:02:42 ### log: /usr/obj/nanobsd.full//_.cust.add_port_net-mgmt_net-snmp
00:15:54 ## configure nanobsd setup
00:15:54 ### log: /usr/obj/nanobsd.full//_.dl
00:15:58 ## run late customize scripts
00:15:58 ## build diskimage
00:15:58 ### log: /usr/obj/nanobsd.full//_.di
[root@marseilles /usr/src/tools/tools/nanobsd]# cat /usr/obj/nanobsd.full//_.di
...
/usr/obj/nanobsd.full//_.mnt/./conf/default/etc/remount
1067922 blocks
Filesystem  512-blocks    Used   Avail Capacity iused  ifree %iused  Mounted on
/dev/md1s1a    7597976 1095244 5894894    16%   18640 469326    4%   /usr/obj/nanobsd.full/_.mnt
Generating mtree...
Duplicating to second image...
dd: /dev/md1s2: Invalid argument
60368+1 records in
60368+0 records out
3956277248 bytes transferred in 66.175378 secs (59784732 bytes/sec)
Running exit trap code
Filesystem  512-blocks     Used      Avail Capacity iused    ifree %iused  Mounted on
/dev/ada0p2 1411749208 32196080 1266613192     2%  598352 90652718    1%   /
umount: /usr/obj/nanobsd.full//_.mnt: not a file system root directory
```

My configuration file:

```
# 8GB
NANO_MEDIASIZE=15665140
#NANO_MEDIASIZE=15687680

NANO_DRIVE=da0

NANO_KERNEL=MY_KERNEL

# Kernel modules to build; default is none
NANO_MODULES="3dfx 3dfx_linux aac aacraid accf_data accf_dns accf_http acl_nfs4 acl_posix1e acpi ae aesni age agp aha ahb ahci aic aic7xxx aio alc ale alq amdsbwd amdtemp amr an aout apm arcmsr arcnet asmc asr ata ath ath_pci bce bfe bge bios bktr bridgestp bwi bwn bxe cam cardbus carp cas cbb cc cd9660 cd9660_iconv ce ciss cm cmx coff coretemp cp cpuctl cpufreq crypto cryptodev cs ctau ctl cxgb cxgbe cyclic dc dcons dcons_crom de dpms dpt drm drm2 dtrace dummynet ed elink em en ep esp et ex exca ext2fs fatm fdc fdescfs fe filemon firewire firmware fuse fxp gem geom glxiic glxsb hatm hifn hme hpt27xx hptiop hptmv hptnr hptrr hwpmc hyperv i2c ibcs2 ichwd ida ie if_bridge if_disc if_edsc if_ef if_epair if_faith if_gif if_gre if_lagg if_ndis if_stf if_tap if_tun if_vlan igb iir io ip6_mroute_mod ip_mroute_mod ipdivert ipfilter ipfw ipfw_nat ipmi ips ipw ipwfw isci iscsi iscsi_initiator isp ispfw iwi iwifw iwn iwnfw ixgb ixgbe jme joy kbdmux kgssapi kgssapi_krb5 khelp krpc ksyms le lge libalias libiconv libmbpool libmchain lindev linprocfs linsysfs linux lmc lpt mac_biba mac_bsdextended mac_ifoff mac_lomac mac_mls mac_none mac_partition mac_portacl mac_seeotheruids mac_stub mac_test malo mcd md mem mfi mii mlx mly mmc mmcsd mps mpt mqueue msdosfs msdosfs_iconv mse msk mvs mwl mwlfw mxge my ncv ndis netgraph nfe nfs_common nfscl nfsclient nfscommon nfsd nfslock nfslockd nfsserver nfssvc nge nmdm nsp nullfs nvd nve nvme nvram nxge oce opensolaris padlock patm pccard pcfclock pcn pf pflog pfsync plip ppbus ppc ppi pps procfs pseudofs pst pty puc ral ralfw random rc4 rdma re reiserfs rl s3 safe sbni scc scd scsi_low sdhci sdhci_pci sem send sf sge siba_bwn siftr siis sis sk smbfs sn snp sound speaker splash sppp ste stg stge streams svr4 sym syscons sysvipc ti tl tmpfs toecore tpm trm twa twe tws tx txp uart ubsec udf udf_iconv ufs unionfs usb utopia vesa vge viawd virtio vkbd vmware vpo vr vte vx vxge wb wbwd wi wlan wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt wlan_tkip wlan_wep wlan_xauth wpi wpifw x86bios xe xl zfs zlib"

# Size of configuration file system in 512 bytes sectors
NANO_CONFSIZE=204800

# Size of the /etc ramdisk in 512 bytes sectors
NANO_RAM_ETCSIZE=204800

# Size of the /tmp+/var ramdisk in 512 bytes sectors
NANO_RAM_TMPVARSIZE=204800

# TRANSCEND TYPICAL FLASH - 15820800 512 byte sectors: 255H 63S/T 984C
NANO_SECTS=63
NANO_HEADS=255

# VGA BOOTLOADER
NANO_BOOTLOADER="boot/boot0"

# -----------------------------------------------------------------------------
# PKG
# -----------------------------------------------------------------------------

add_pkg() {
  cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf
  chroot ${NANO_WORLDDIR} /bin/sh -exc \
    'env ASSUME_ALWAYS_YES=YES pkg bootstrap'
  rm ${NANO_WORLDDIR}/etc/resolv.conf
}

customize_cmd add_pkg

# -----------------------------------------------------------------------------
# ADD PORTS
# -----------------------------------------------------------------------------

add_port () {
        port=`echo $1 | sed -e 's/\//_/'`
        eval "
        add_port_${port} () {
                mkdir -p \${NANO_WORLDDIR}/usr/ports
                mount -t unionfs -o noatime /usr/src \
                        \${NANO_WORLDDIR}/usr/src
                mount -t unionfs -o noatime /usr/ports \
                        \${NANO_WORLDDIR}/usr/ports
                mkdir -p \${NANO_WORLDDIR}/dev
                mount -t devfs devfs \${NANO_WORLDDIR}/dev
                mkdir -p \${NANO_WORLDDIR}/usr/pobj
                mkdir -p \${NANO_WORLDDIR}/usr/workdir
                cp /etc/resolv.conf \${NANO_WORLDDIR}/etc/resolv.conf
                chroot \${NANO_WORLDDIR} /bin/sh -exc \
                        'make WRKDIRPREFIX=/usr/workdir -C /usr/ports/$1 \
                        install BATCH=yes $2'
                rm \${NANO_WORLDDIR}/etc/resolv.conf
                rm -rf \${NANO_WORLDDIR}/usr/obj
                rm -rf \${NANO_WORLDDIR}/usr/pobj
                rm -rf \${NANO_WORLDDIR}/usr/workdir
                umount \${NANO_WORLDDIR}/dev
                umount \${NANO_WORLDDIR}/usr/ports
                umount \${NANO_WORLDDIR}/usr/src
                rmdir \${NANO_WORLDDIR}/usr/ports
                }
        customize_cmd add_port_${port}
        "
        }

# -----------------------------------------------------------------------------
# PORTS
# -----------------------------------------------------------------------------

# Add net-snmp (An extendable SNMP implementation)
add_port "net-mgmt/net-snmp"
```

The image NanoBSD 10 built successful using parameters:

```
NANO_IMAGES = 1
```

For the successful installation of ports, you need to install pkg:

```
# -----------------------------------------------------------------------------
# PKG
# -----------------------------------------------------------------------------

add_pkg() {
  cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf
  chroot ${NANO_WORLDDIR} /bin/sh -exc \
    'env ASSUME_ALWAYS_YES=YES pkg bootstrap'
  rm ${NANO_WORLDDIR}/etc/resolv.conf
}

customize_cmd add_pkg
```


----------



## allan_sundry (Jan 27, 2014)

The image is going without errors in the absence of a configuration file.  If you add in the way of all kernel modules - there is an overflow of the file system.  If you increase the value NANO_MEDIASIZE you get the error described in the first post.


----------



## thomas@ (May 1, 2014)

The error you are seeing is caused by PR bin/189174. A fix is in preparation.


----------



## allan_sundry (May 1, 2014)

thomas@ said:
			
		

> The error you are seeing is caused by PR bin/189174. A fix is in preparation.



Thank you! I'll wait for the fix in 10-STABLE.


----------

