From owner-freebsd-questions@freebsd.org Sat Jan 9 00:34:55 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3035A68D21 for ; Sat, 9 Jan 2016 00:34:55 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 756CD1359 for ; Sat, 9 Jan 2016 00:34:54 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-21-51.dynamic.qsc.de [92.195.21.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 3CC4E277DD; Sat, 9 Jan 2016 01:29:09 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u090T9Qf004377; Sat, 9 Jan 2016 01:29:09 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 9 Jan 2016 01:29:09 +0100 From: Polytropon To: Lars Eighner Cc: Yuri , FreeBSD Questions 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: References: <569017FF.9060509@rawbw.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:34:55 -0000 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, ...