"fsck -y /" keeps saying "Disk is still dirty" no matter how many times I run it
freebsd at edvax.de
Sat Jan 9 00:34:55 UTC 2016
On Fri, 8 Jan 2016 18:15:20 -0600 (CST), Lars Eighner wrote:
> On Fri, 8 Jan 2016, Yuri wrote:
> > As a result of the power outage I needed to run fsck on UFS disk with
> > soft-updates.
> > But every time the command 'fsck -y /' says that it corrected a lot of
> > problems, but it still leaves the disk dirty. I ran it at least 15 times -
> > same result.
> Most likely you have a bad sector on your disk. fsck cannot fix this. When
> you write to the disk, hopefully the disk will mark the sector bad, and
> basically hide it.
The disk should do this automatically. As soon as you can
see errors "bubbling up", the disk is out of spare sectors
and cannot remap anymore. In this case, it's usually a good
move to decommission the disk and replace it with a new one.
However, if this is _not_ the case and fsck can repair the
disk, it can be kept in use. I would still suggest to run
periodic checks with "smartctl" and _always_ have a recent
backup ready to go.
> Unfortunately, you cannot mount it to write if it is
It's probably still possible to mount it read-only and recover
the majority of files (depending on how much impact the defects
> You can only newfs it, which means goodbye to everything since your
> last backup. After you newfs, you can restore from your backup.
Also have a look at "man badsect" if this is still relevant.
If the disk is "not that broken", maybe it can still serve
for a while (with the defective and unmappable sectors marked
properly). I know disks that have been "formatted smaller",
from 80 MB to 40 MB that continued working for decades... :-)
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions