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

Kevin Day toasty at dragondata.com
Fri Dec 30 02:42:58 UTC 2016


> 
> It was really a temporary cludge of mine to tickle for bad blocks,
> working from inside the file system. I'd better do it properly,
> unmount & experiment with eg camcontrol on the partition or whole
> disk, or search ports/ &/or write  a little C prog that reads blocks
> from a file (aka dev name of partition or whole disk, stores, to
> memory, & writes back blocks)
> 

If you don’t mind losing everything:

dd if=/dev/zero of=/dev/daXXX
(write blocks of zeros to drive, starting at the first sector and going until the end)

then

dd of=/dev/null if=/dev/daXXX
(read everything back and throw it away)

If both complete without error, you’re good. Call newfs and start over.


If you have space somewhere else to fit the entire drive and don’t want to lose everything:

dd if=/dev/daXXX of=/path/to/giant/file
(copy the entire drive to /path/to/giant/file)

dd if=/path/to/giant/file of=/dev/daXXX
(copy it back to the drive)



If any of those do produce errors and you want dd to continue just skipping the errored sector(s) add “conv=sync,noerror” and instead of a bad sector being a fatal error, it’ll replace it with all NULs and keep going.

— Kevin



More information about the freebsd-fs mailing list