when ufs is 99% full, current seems to limit creat to 28672 bytes

Gary Jennejohn gljennjohn at gmail.com
Sun Dec 25 10:11:54 UTC 2016


On Sun, 25 Dec 2016 04:30:49 +0100
"Julian H. Stacey" <jhs at berklix.com> wrote:

> A puzzle below, that I think I've solved, but comments welcome:
> When ufs is 99% full, current limits creat to 28672 bytes.
> 
> On current,
> mount
> /dev/ada0s4f on /data (ufs, NFS exported, local, soft-updates)
> 
> /bin/df /data
> Filesystem   1K-blocks      Used   Avail Capacity  Mounted on
> /dev/ada0s4f 868629268 863272592 5356676    99%    /data
> 
> csh
> foreach i ( `cd /host/fire/0s4/ftp/pub/FreeBSD/mail/ports ; /bin/ls -1 [0-9]*`)
> 	# Above just a trick to generate 3000 numeric names.
> 	# ( testblock -v -b 512 tb.$i ) 	# My little C program
> 	#   http://berklix.com/~jhs/src/bsd/jhs/bin/public/testblock/
> 	# OR a simpler standard dd ...
> 	( dd if=/dev/zero of=dd.$i )
> 	end
> 
> Produces loads of little files of size 28672 bytes = 0x7000
> 
> A foreground fsck of FS shows no errors.  No ZFS in use.  Where
> does all the extra space come from ?  Why does it keep allowing
> more little files ?  But not files bigger than 7K ?
> 
> The last 5 Gig seems unusable space not in the meta space of normal
> free blocks for big files. Presumably instead in the payload of
> initial data space pre allocated along with each unused inode ? So
> 1K for inode & 7K data ?
> 
> ffsinfo | more
> 	bsize             int32_t          0x00008000
> 	fsize             int32_t          0x00001000
> 
> 
> df -i /dev/ada0s4f
> Filesystem   1K-blocks Used      Avail   Capacity iused   ifree     %iused
> /dev/ada0s4f 868629268 863272592 5356676    99%   9595016 102683126 9%   
> 
> dc 102683126 28672 * p	# 2 944 130 588 672	
> 3G not 5.3G as above from df, but seems not too dissimilar.
> 
> If this 0x7K phenomena is not documented in manuals somewhere ?  it
> perhaps should be ? 
> 
> How I noticed:
>   I wanted to soak up every last block on FS, (cos Ive been having
>   block device errors, so I wanted to force a read write on all
>   unused blocks to hopefully get IDE drive to re-allocate anything flakey.)
>   ada0: 953869MB (1953525168 512 byte sectors)
> 
> Tips very welcome on [usb scsi] Commands/Manuals/ ports/ to either:
>   rescan partition
> 	(I could achive a crude reallocation of discovered bad blocks,
> 	 using drivers inside disk or FreeBSD, by writing new test data 
> 	 on my partition with dd or my testblock -b 60k /dev/ada0s4f 
>   reformat disk.
> 	Maybe man fsck See Also should ref camcontrol ?
> 

I suspect this ia a result of how UFS is designed.  Did you use the
standard options for block and fragment size?  How about inodes?

Is the file system UFS1 or UFS2?

UFS is a very compex bit of software and I imagine there are all
kinds of interesting surprises when the file system is 99% full.

Anyway, the newfs man page may provide some clues.  Or look at
Wikipedia, there's a UFS entry there, but it doesn't go into the gorey
details.

-- 
Gary Jennejohn


More information about the freebsd-fs mailing list