Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 01:29:09 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Lars Eighner <luvbeastie@larseighner.com>
Cc:        Yuri <yuri@rawbw.com>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: "fsck -y /" keeps saying "Disk is still dirty" no matter how many times I run it
Message-ID:  <20160109012909.6e9b257e.freebsd@edvax.de>
In-Reply-To: <alpine.BSF.2.20.1601081810070.15411@abbf.ynefrvtuareubzr.pbz>
References:  <569017FF.9060509@rawbw.com> <alpine.BSF.2.20.1601081810070.15411@abbf.ynefrvtuareubzr.pbz>

next in thread | previous in thread | raw e-mail | index | archive | help
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 
> dirty.

It's probably still possible to mount it read-only and recover
the majority of files (depending on how much impact the defects
have).



> 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... :-)


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160109012909.6e9b257e.freebsd>