7

I have a file system that has some "unlinked inodes" and for this reason it was mounted as read-only. As I understood, to get this device into rw-mode, I need to perform partition check with fsck. All the advices I found state, that I should first unmount the device.

Is it necessary? Can one scan (and repair) with fsck a read-only partition? The server is used for smb-exports, and most of the users would be much happier if they, at least, would have a read-access.

2 Answers 2

5

Fsck would change on-disk data w/o notifying kernel's VFS layer, so even reading of disk data can be inconsistent and can't be relied on. In short — don't do, it's a flaw way.

Longer and smarter: you should have been using LVM-2. Thus you would make a snapshot, mount it R/O providing access of your users to it, fsck'ed original volume and then mount it R/W instead.

3

You can fsck a read-only mounted file system, but it may/will be problematic if there are repairs to be made.

See: this answer to "Linux: Force fsck of a read-only mounted filesystem?" on Server Fault

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .