Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2012 07:16:09 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        dmitry@zhigulinet.ru, freebsd-questions@freebsd.org
Subject:   Re: fsck on a mounted fs as read-only
Message-ID:  <alpine.BSF.2.00.1205310711590.81499@wonkity.com>
In-Reply-To: <20120531134636.e070cef2.freebsd@edvax.de>
References:  <546749752.20120531141933@zhigulinet.ru> <20120531134636.e070cef2.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 31 May 2012, Polytropon wrote:

> On Thu, 31 May 2012 14:19:33 +0400, dmitry@zhigulinet.ru wrote:
>> Good afternoon.
>> Could not tell whether you can run fsck on checking mounted
>> file system as read-only, if prior to that with which the parameters
>>
>>
>> ftp # mount
>> ...
>> / dev/aacd0 on / var / ftp (ufs, NFS exported, local, read-only)
>>
>> Launched with these parameters and this is what gives
>>
>> ftp # fsck -yf / dev/aacd0
>> ** / Dev/aacd0 (NO WRITE)
>> ** Last Mounted on / var / ftp
>> ** Phase 1 - Check Blocks and Sizes
>>
>> As I understand it does not fix the fsck filesystem.
>
> Correct. For file system modifications the file system may not
> be mounted because "lower level operations" maybe will take
> place. In your current setting, only checks will be performed,
> but _if_ something needs to be modified, it will not happen.
> The reason: It _might_ affect the file system to change, even
> if it's "just" in read-only state.
>
> Solution: Unmount the file system and re-run fsck.

fsck(8) can work on filesystems mounted read only.  If, say, 
graphics/cairo causes X to crash the machine, rebooting into single-user 
mode and running
# fsck -y -t ufs
will clean up the read-only mounted / also.  Agreed that this should be 
avoided if possible, but sometimes it is necessary.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1205310711590.81499>