Announcement

Collapse
No announcement yet.

Don't understand boot-time fsck

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Don't understand boot-time fsck

    My system does not seem to run a boot-time fsck at all since my last upgrade. I have looked at how it _should_ work, but the following results seem strange to me:

    $ cat /etc/fstab
    ...
    # / was on /dev/sda6 during installation
    UUID=331af706-41b2-404e-a771-be1acddd4c39 / ext4 errors=remount-ro 0 1
    # swap was on /dev/sda5 during installation
    UUID=0587d558-16bd-4354-b265-11aba02fc051 none swap sw 0 0
    # swap was on /dev/sdb2 during installation
    UUID=3a02d80c-7c7f-4d5f-a875-dbb6c9cdf97f none swap sw 0 0
    # swap was on /dev/sdc3 during installation
    UUID=0c26d059-2639-4f77-bf7f-6dc30e402854 none swap sw 0 0
    /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
    #
    /dev/sdc7 /home/jon/music_mp3 ext3 defaults 0 2
    /dev/sdb3 /home/jon/our-pix ext4 defaults 0 2
    /dev/sda2 /mnt/win_c ntfs defaults,nls=utf8,umask=007,uid=0,gid=46,auto,rw,n ouser 0 1
    /dev/sda3 /mnt/win_d ntfs defaults,nls=utf8,umask=007,uid=0,gid=46,auto,rw,n ouser 0 1
    #
    /dev/sdc6 /home ext3 defaults 0 2
    /dev/sdc5 /tmp ext3 defaults 0 2
    /dev/sdc9 /samba-transfer ext3 defaults 0 2
    /dev/sdb5 /home/jon/music-mp3 ntfs defaults,nls=utf8,umask=007,uid=0,gid=46,auto,rw,n ouser 0 1

    What is all that "# / was on /dev/sda6 during installation" stuff? But the final params which govern fsck look ok, at least to me.

    For my root file system:

    $ sudo dumpe2fs -h /dev/sda6 | grep -i 'mount count'
    dumpe2fs 1.42.5 (29-Jul-2012)
    Mount count: 54
    Maximum mount count: -1

    MINUS one? Some others look like this:

    $ sudo dumpe2fs -h /dev/sdc7 | grep -i 'mount count'
    dumpe2fs 1.42.5 (29-Jul-2012)
    Mount count: 28
    Maximum mount count: 38
    $ sudo dumpe2fs -h /dev/sdb3 | grep -i 'mount count'
    dumpe2fs 1.42.5 (29-Jul-2012)
    Mount count: 146
    Maximum mount count: -1
    $ sudo dumpe2fs -h /dev/sdb5 | grep -i 'mount count'
    dumpe2fs 1.42.5 (29-Jul-2012)
    dumpe2fs: Numéro magique invalide dans le super-bloc lors de la tentative d'ouverture de /dev/sdb5

    Sorry about the french; that is another problem. I wish it were in english, like:

    $ ls no-file-of-this-name
    ls: cannot access no-file-of-this-name: No such file or directory

    So what gives with fsck at boot and all those strange max mount counts?

    Thanks in advance.
    'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

    #2
    The entry in your fstab regarding sda6 is meaningless if you have added or removed a disk since installation. As you are using the UUID of your disk to point to the proper disk, you should run
    Code:
    sudo blkid
    to determine which partition your system is currently mounted on. I have noticed, prompted by your post, that the same thing is happening to my system. There have been no disk checks since the last install. I have to look into this further.

    Comment


      #3
      According to blkid, my system is now on sdc1 instead of sdb1 which is what fstab shows. Running sudo dumpe2fs -h /dev/sdc1 | grep -i 'mount count' shows my maximum mount count also as -1. This should be the number of times it will be mounted before a file check is forced. Something is wrong. Is anyone else seeing this problem? Is this a bug?

      Comment


        #4
        You can set the maximum mount count with "tune2fs" command: sudo tune2fs -c <maxcount> <device>, as in
        sudo tune2fs -c 30 /dev/sda2

        btw, in /etc/fstab, you should reserve the final "1" for the root file system only...and use "2" for all other file systems you want checked.

        I think maximum mount count is -1 (don't check) by default on ext4 file systems (as opposed to ext3, for example)
        Last edited by kubicle; Oct 05, 2013, 09:36 AM.

        Comment


          #5
          Well,for my system partition, fstab says:

          # / was on /dev/sda6 during installation
          UUID=331af706-41b2-404e-a771-be1acddd4c39 / ext4 errors=remount-ro 0 1


          and what is mounted agrees:

          $ df /
          Filesystem 1K-blocks Used Available Use% Mounted on
          /dev/sda6 103079868 7187976 90649084 8% /

          and blkid gives:

          $ sudo blkid
          ...
          /dev/sda6: UUID="331af706-41b2-404e-a771-be1acddd4c39" TYPE="ext4"
          ...

          so it is all consistent. Still, the result

          $ sudo dumpe2fs -h /dev/sda6 | grep -i 'mount count'
          dumpe2fs 1.42.5 (29-Jul-2012)
          Mount count: 54
          Maximum mount count: -1

          is troubling. I will be interested in the results of your enquiry.
          'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

          Comment


            #6
            Ok, but it seems to me I should not have to stipulate the Max mount count manueally using tune2fs. I would prefer the same count for all partitions.

            Btw, should one run fsck on swap partitions?
            'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

            Comment


              #7
              Thanks kubicle, but what happens if you make changes to you your system that affect device numbers, such as adding or removing a hard drive? So by using the UUID of the partition you should avoid this problem.
              Here is how I did mine.
              Code:
               sudo tune2fs -c 30 UUID=6b2eb2ce-b158-4012-8d44-717520f85707

              Comment


                #8
                Firstly, you have to separate the max count setting (which is a property of the file system...set when the file system is created) and /etc/fstab setting.
                Even if you have fsck enabled in fstab...the file system won't be checked if max count setting is set to -1 (or 0).

                -1 is the default max count setting when creating an ext4 file system (the devs seem confident periodic boot checks are unnecessary for ext4), the same is not true for ext3 (which explains why your /dev/sdc7 file system does have max mount count at 38). If you wish to override the default you can change max mount count for ext4 with tune2fs.

                Originally posted by joneall View Post
                Btw, should one run fsck on swap partitions?
                No
                Last edited by kubicle; Oct 05, 2013, 09:55 AM.

                Comment


                  #9
                  Originally posted by Detonate View Post
                  Thanks kubicle, but what happens if you make changes to you your system that affect device numbers, such as adding or removing a hard drive?
                  Should not matter, the max count setting is a property of the file system...the max mount count setting will stay the same even if the dev name changes.
                  Last edited by kubicle; Oct 05, 2013, 10:03 AM.

                  Comment


                    #10
                    I just rebooted after removing a hard disk which now locates my system on sdb1 and the file system check occurred as it should.

                    Comment


                      #11
                      I seem to have just the opposite problem ,,,,,,my system dose not seem to be shutting down cleen and a fsck is being ran at every boot.
                      12.10-KDE-4.11.1 ,,,,,,,all max counts and fstab references are correct.

                      VINNY
                      i7 4core HT 8MB L3 2.9GHz
                      16GB RAM
                      Nvidia GTX 860M 4GB RAM 1152 cuda cores

                      Comment


                        #12
                        Vinny, can you boot to a different distro or to a bootable CD and run e2fsck on that partition?

                        Comment


                          #13
                          yes yes I can .......but fsck runs on it at every boot ?

                          but hear I go to 12.04 for to try this

                          VINNY
                          i7 4core HT 8MB L3 2.9GHz
                          16GB RAM
                          Nvidia GTX 860M 4GB RAM 1152 cuda cores

                          Comment


                            #14
                            hear is what I got

                            Code:
                            vinny@Vinnys-HP-G62:~$ sudo e2fsck -pv /dev/sda5
                            [sudo] password for vinny: 
                            /dev/sda5: recovering journal
                            /dev/sda5 has been mounted 240 times without being checked, check forced.
                            
                              351221 inodes used (18.17%)
                                8055 non-contiguous files (2.3%)
                                 406 non-contiguous directories (0.1%)
                                     # of inodes with ind/dind/tind blocks: 18363/353/0
                             4306673 blocks used (55.76%)
                                   0 bad blocks
                                   1 large file
                            
                              275744 regular files
                               47508 directories
                                  57 character device files
                                  25 block device files
                                   1 fifo
                                  22 links
                               27868 symbolic links (25685 fast symbolic links)
                                   9 sockets
                            --------
                              351234 files

                            I sware during boot it has been being run every time ,,,,,but as we see hear e2fsck is saying it has not been checked for 240 boots ??

                            going back to 12.10 and see if it gets checked agin

                            VINNY
                            i7 4core HT 8MB L3 2.9GHz
                            16GB RAM
                            Nvidia GTX 860M 4GB RAM 1152 cuda cores

                            Comment


                              #15
                              What does sudo dumpe2fs -h /dev/yourpartitionhere | grep -i 'mount count' show?

                              Comment

                              Working...
                              X