Fill a partition entirely

Markus Hitter mah at
Sat Oct 25 11:52:30 UTC 2008

Hello all,

recently I received such a GEODE-based diskless desktop PC and now  
I'm attepting to get a minimum system onto it using (a heftily  
tweaked) tinyBSD. The plan is to put a memory based, read-only root  
file system onto a pen drive and to use the remaining part of the pen  
drive for user data.

In principle everything works, but when trying to optimise, I can't  
get this root file system to fill up to more tham about 60%, no  
matter how I set inode count, root reserved space and fragment size.  
This is the snippet for creating the partition:

   PART_ONE_SIZE=`du -s ${WORKDIR} | cut -f 1`
   # Fix: let PART_ONE_SIZE=${PART_ONE_SIZE}*2
   LABELFILE=`mktemp -t tinybsd`
   echo "a: ${PART_ONE_SIZE} * 4.2BSD"  > ${LABELFILE}
   echo "b: *                * 4.2BSD" >> ${LABELFILE}
   bsdlabel -R -B /dev/${MD} ${LABELFILE}
   rm -f ${LABELFILE}
   newfs -m 0 -n /dev/${MD}a

   mount /dev/${MD}a ${IMGMNT}

   tar -C ${WORKDIR} -cf- --exclude kernel . | \
     tar -C ${IMGMNT} -xf-

For some reason I can't imagine, the later "tar" starts complaining  
"No space left on device" half the way and the situation ends up with  
("df -i"):

Filesystem 1K-blocks Used Avail Capacity iused ifree %iused  Mounted on
/dev/md1a       6778 4596  2182    68%      22  1000    2%   /tmp/ 

To me, this doesn't look like "No space left on device" at all. What  
is missing here, how can I shrink the partition to just hold the  
needed files?


- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter

More information about the freebsd-embedded mailing list