4

My kern.log file advises me to run e2fsck.

Aug 30 14:10:11 ubuntu kernel: [  122.378292] EXT4-fs (sda11): warning: maximal mount count reached, running e2fsck is recommended
Aug 30 14:10:11 ubuntu kernel: [  122.387488] EXT4-fs (sda11): mounted filesystem with ordered data mode. Opts: (null)

/dev/sda11 is not mounted in my current OS (Ubuntu 10.04)

I have read that e2fsck is a dangerous command to run on the root partition which is on the same hard disk as sda11. I would trust in this solution better than others Can I run fsck or e2fsck when Linux file system is mounted?

Zanna
  • 70,465
Salvador
  • 473

2 Answers2

4

Unless you have done something unusual with your system configuration, Ubuntu will automatically run the appropriate fsck (FileSystem ChecK) command when you next reboot.

The generic 'fsck' command will attempt to detect the filesystem type, or it will accept parameters specifying the type. 'e2fsck' is essentially a shortcut saying it's an ext2 filesystem. They all behave the same way and check the filesystem for errors.

You're correct that they can be dangerous - never run fsck on any mounted filesystem (root partition or otherwise), as it can lead to data loss. Reboot and it will be done safely without you needing to run any commands manually.

Update: The message you saw does not mean there is damage, it is just logging the preventative maintenance that will be done automatically.

  • Whenever my system is damaged is it much safe to boot with the recovery mode, umount the root partition and run fsck? Which would be the required options to check the root partition (e.g. /dev/sda3)? In the opposite, is it much safe to boot with a LiveCD? – Salvador Aug 30 '12 at 16:09
  • 1
    the filesystem checks will be run automatically the next time you reboot your ubuntu machine normally - you do not need to use a livecd or recovery mode. – ImaginaryRobots Aug 30 '12 at 16:21
  • I have detected at my boot.log a filesystem checks, later I tried to get more info with srs@ubuntu:~$ fsck -N fsck from util-linux-ng 2.17.2 [/sbin/fsck.ext4 (1) -- /] fsck.ext4 /dev/sda6 – Salvador Aug 30 '12 at 20:43
  • e2fsck - check a Linux ext2/ext3/ext4 file system. fsck - check and repair a Linux file system. – Ahmad Ismail Nov 14 '18 at 12:39
2

As far as I know fsck is just a wrapper around individual filesystem file system check binaries:

/sbin/dosfsck
/sbin/e2fsck
/sbin/fsck
/sbin/fsck.cramfs
/sbin/fsck.ext2
/sbin/fsck.ext3
/sbin/fsck.ext4
/sbin/fsck.ext4dev
/sbin/fsck.minix
/sbin/fsck.msdos
/sbin/fsck.nfs
/sbin/fsck.vfat

e2fsck, fsck on an ext2 volume, and fsck.ext2 should all accomplish the same thing.

RobotHumans
  • 29,530
  • I have run palimpsest without any error. Should I run also e2fsck, which command options should I use? – Salvador Aug 30 '12 at 15:39
  • it says it's an ext4 volume. i'ld run fsck.ext4 against the device when it's NOT mounted -- possibly from live media – RobotHumans Aug 30 '12 at 15:40