3

Is there a file system for linux where it's possible (and safe) to perform a file system check while it's mounted read write or which does not need to be checked periodically ?

E.g. a file system whose check first 'grabs' the entire file system and then releases those parts which have been checked already.

(I'm looking for file systems with capabilities like ext2 or better, i.e. something I could use as a replacement for a root or /home file system on a PC)

Andre Holzner
  • 529
  • 2
  • 4
  • 14
  • You should include why you want this feature. My first thought is you're asking the wrong question. Is fsck taking too long, so you want something faster? – Steven Jan 29 '11 at 19:05

3 Answers3

1

Is there a file system for linux where it's possible (and safe) to perform a file system check while it's mounted read write

Don't run fsck on a mounted file system. fsck on a mounted filesystem can data corruption.

E.g. a file system whose check first 'grabs' the entire file system and then releases those parts which have been checked already.

btrfs:

  • Online filesystem check
  • Very fast offline filesystem check
  • Checksums on data and metadata (multiple algorithms available)
alvosu
  • 8,357
  • 24
  • 22
1

I don't quite feel comfortable using btrfs yet. Its too new.

I've been using xfs for many years, because fsck takes seconds for any sized filesystem. The other reason is that expanding the filesystem online also takes seconds.

Steven
  • 3,009
  • 18
  • 18
0

You could online fsck a filesystem snapshot. See my answer for a similar question.

knweiss
  • 3,955
  • 23
  • 20
  • I'm not sure I fully understand: if I the check of the snapshot did not need any correction, the 'live' system (which might have been modified before the check of the snapshot completes) is most likely ok as well. But if the snapshot had errors which needed to be corrected, I would have to run fsck on the live file system (i.e. mount it in readonly mode at least) ? – Andre Holzner Jan 29 '11 at 19:03
  • Yes, if the file system has errors you will have to take it offline. ZFS can do everything online but its status on Linux is complicated... – knweiss Jan 29 '11 at 19:36