Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Dec 2016 20:42:56 -0600
From:      Kevin Day <toasty@dragondata.com>
To:        "Julian H. Stacey" <jhs@berklix.com>
Cc:        "freebsd-fs@FreeBSD.org Filesystems" <freebsd-fs@freebsd.org>
Subject:   Re: when ufs is 99% full, current seems to limit creat to 28672 bytes
Message-ID:  <AA0042EB-7EF2-468C-8EC6-82794FF1EFAD@dragondata.com>
In-Reply-To: <201612292039.uBTKdGR4033963@fire.js.berklix.net>
References:  <201612292039.uBTKdGR4033963@fire.js.berklix.net>

next in thread | previous in thread | raw e-mail | index | archive | help

> 
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AA0042EB-7EF2-468C-8EC6-82794FF1EFAD>