2

I want to make an menuentry in grub, which boots up as normal but skips fsck. If that is possible, I could create two menu-entries one of which would skip filesystem check and the other would not.

My /etc/fstab file looks like below,

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda7 during installation
UUID=0a0fda6a-a0af-461f-936e-fe6feff3adba /               ext2    errors=remount-ro 0       1
# /home was on /dev/sda5 during installation
UUID=b9ed5358-a68a-48ef-8c51-7241f0462913 /home           ext4    defaults        0       2
# swap was on /dev/sda6 during installation
UUID=301dcfce-1bb3-415d-a71a-df64add29443 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
9
  • 1
    What? Please post your current /etc/fstab, you probably have it set up to test all disk all the time which is not necessary. This has nothing to do with grub AFAIK. – terdon Mar 16 '14 at 16:38
  • You apparently have used ext2 as your root filesystem type. This is a mistake; reinstall using ext4 instead. – psusi Mar 16 '14 at 21:57
  • Ubuntu (at least 12.04) won't run on a ext4.I already have tried to do on ext4 but then ubuntu wont boot at all. – Pixdigit Mar 18 '14 at 17:47
  • @psusi why would that be a 'mistake' (agreed that ext3 would be better) and how is it relevant anyway? The OP has a working system. – terdon Mar 19 '14 at 0:23
  • Having two separate GRUB entries for this is not possible, not unless you have a separate partition for it. Why is this an issue? Is your disk being checked every time you boot? If so, there are ways of avoiding that, the default should be to check once every 30 boots. – terdon Mar 19 '14 at 0:29
2

Editing /etc/fstab file to bypass fsck check at boot:

You can change the value of <pass>, the 6th field of file system description line in /etc/fstab to 0 (zero) to avoid filesystem check at the boot. (For your swap it's already 0, so you'll have to change your / and /home partitions' values from 1 and 2 respectively to 0 each.)

# <file system>                  <mount point>  <type> <options>      <dump>   <pass>

UUID=0a0fda6a-a0af-461f-936e-fe6feff3adba /      ext2  errors=remount-ro 0       1

UUID=b9ed5358-a68a-48ef-8c51-7241f0462913 /home  ext4  defaults          0       2

UUID=301dcfce-1bb3-415d-a71a-df64add29443 none   swap    sw              0       0

..so that the entries look like:

# <file system>                  <mount point>  <type> <options>      <dump>   <pass>

UUID=0a0fda6a-a0af-461f-936e-fe6feff3adba /      ext2  errors=remount-ro 0       0

UUID=b9ed5358-a68a-48ef-8c51-7241f0462913 /home  ext4  defaults          0       0

UUID=301dcfce-1bb3-415d-a71a-df64add29443 none   swap    sw              0       0

The documented description of the fs_passno i.e. <pass> field in /etc/fstab file:

The sixth field (`fs_passno`):

This field is used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

4
  • But is there a way to have 2 menuentries in grub ?One wich checks and one without? – Pixdigit Mar 18 '14 at 17:49
  • Not repairing the damage is a good way to really corrupt your fs and have all sorts of fun problems. – psusi Mar 19 '14 at 13:59
  • @psusi that's what OP asked for.. this would disable the routine check (the default being every 30 mounts as stated in terdon's answer above).. but OP could force a check at the with sudo touch /forcefsck.. – precise Mar 19 '14 at 15:28
  • It isn't the routine check every 30 mounts that is the problem. It is checking on every mount because there is a bug that prevents the filesystem from being cleanly unmounted even on an otherwise clean shutdown. This leaves ext2 damaged and in need of repairs. Not doing those repairs is a bad idea. – psusi Mar 19 '14 at 15:34
1

As a complement to @rusty's answer, by default a pass value of 1 or greater in fstab will cause the disk to be checked once every 30 mounts. That really shouldn't be an issue and you should let it do so.

If for some reason your drive is being checked more often or if you want to change the frequency, you can do so with this command:

tune2fs -c 50 /dev/sda1

That will set /dev/sda1 to be checked every 50 times it has been mounted.

5
  • thank you for your answer ,but is there a way to make it boot without at all and have optionally to run fsck if i want to ,while it boots ,so as example as an grub entry. – Pixdigit Mar 19 '14 at 16:31
  • Yes, but this has nothing to do with GRUB, GRUB deals with operating systems, it does not control/affect or in any way have knowledge about filesystem checking. If you want your drive to never be checked (which is a horrible idea and @psusi is probably right that you should at least use ext3), just set the pass to 0 instead of 1 in /etc/fstab. – terdon Mar 19 '14 at 16:35
  • i dont want to not check it at all ,but some kind of like having it not checking while booting as default , but if i want to let it check ...(ps: I alredy said that ubuntu only works on ext2 on my system ,dont ask me why i tried it 5 times ) – Pixdigit Mar 19 '14 at 16:44
  • I understand, I am trying to tell you that this does not depend on grub, you can have no testing (0 in fstab) and you can have periodic testing (1 or greater) but not a separate grub entry for testing or not testing unless you actually install the OS two times. – terdon Mar 19 '14 at 16:45
  • I dont want to say that fsck depend on grub ,i just want to have some way like Grub ... – Pixdigit Mar 19 '14 at 16:53

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.