Is there a way to dismount a volume (with open files on it) or cause kernel panic if IO error occurs on underlying disk? OS is Linux. This is needed to prevent data corruption in case of storage availability problems.


Set the appropriate errors mount option, e.g. in /etc/fstab. See the mount(8) man page.

              Define the behaviour when  an  error  is  encountered.   (Either
              ignore  errors  and  just mark the filesystem erroneous and con‐
              tinue, or remount the filesystem read-only, or  panic  and  halt
              the  system.)   The default is set in the filesystem superblock,
              and can be changed using tune2fs(8).

For example:

/dev/mapper/storage-libvirt /var/lib/libvirt        ext4    errors=panic     1 2
  • This is about filesystem errors, not about IO errors. I have tried this and it doesn't help if errors are encountered during access to data blocks (blocks containing files, not filesystem itself).
    – DavisNT
    Nov 8 '13 at 20:14
  • Then you need to rewrite your question, because as it stands, it's all about IO errors. Nov 9 '13 at 0:17
  • I mean your answer is about filesystem errors only.
    – DavisNT
    Nov 10 '13 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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