Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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)

share|improve this question
    
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 Answers 3

up vote 1 down vote accepted

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)
share|improve this answer
    
btrfs looks indeed exciting ! –  Andre Holzner Jan 29 '11 at 19:07
    
Its still early development, but yes, btrfs (speak butter-fs or btree-fs) looks exciting. –  coredump Jan 29 '11 at 19:12

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.

share|improve this answer
    
I had similar thoughts about the stability/maturity after reading the first part of the wikipedia article... –  Andre Holzner Jan 29 '11 at 19:47

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

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.