Welcome to the new Linux Foundation Forum!

Hanging on a boot while checking a file system

Hi.

Last time my system starts to hang on boot. It occurs while the "Checking file systems..." process. I noticed that it happens only when I wait established time in GRUB. If I press the "Enter" key in the GRUB menu the system will boot without any errors.

What is the reason of the bug? How can I fix it?

Thanks.

Debian 5.0.3;

GRUB 0.97.

Comments

  • mfillpotmfillpot Posts: 2,180
    I wouldn't necessarily jump to the conclusion that it is a bug, it may be the result of a problem with your bios, motherboard or a single hard drive. Does it freeze when checking a specific partition or is the freeze always at a random point?
  • Goineasy9Goineasy9 Posts: 1,116
    I was a Debian user for many years. Debian sets a disk check after you boot up a partition after a certain number of times. I used Debian sid which allowed you to see what was happening during the boot, i.e., during the boot scroll. After 30 or so boots, Debian would perform an fsck (disk check), which, depending on the size of the partition, could take from 5 to 20 minutes. This could be what is going on. You boot isn't actually frozen, it's just checking the disk partition.
    One simple way to check is to look at the disk access light on you computer. If it's constantly on, or on and flashing, it is probably performing that disk check. It shouldn't happen every boot, and, whether you hit enter or let it time out during grub shouldn't make a difference.
    Let us know if you see that disk light flashing or not during that time, and, let it sit and finish (even if it takes 15 minutes). If you allow it to finish, it may not hang again for some time, or whatever your disk check is set for.
    One can always extend the amount of time that the disk check is set for, but, lets see if that's what is happening first.
  • mfillpotmfillpot Posts: 2,180
    Actually the disk check is based upon the filesystem, not the distro. If you are using ext3 or ext4 that is probably the reason for the apparent stall.
  • Goineasy9Goineasy9 Posts: 1,116
    Ah, my bad, I've only noticed it when using Debian.
  • Here's what I think about the situation.

    I'm sure, I haven't got any problems with BIOS, the motherboard or other hardware. Also, I think that the problem is in the fsck utility. It seems, it can't perform an HDD check. Early when I started my system, fsck worked correctly and performed the check regulary after 26 system boots. It said something like /dev/sda3 was mount 26 times without checking, bla-bla-bla, check forced after that it showed me a progress bar and I could see the progress of checking.

    Now the situation has changed. I push the “Power” button, the system starts, I see the boot operation sequence on the screen and sometimes when the boot process goes to the “Checking file systems…” stage the system just hang. The HDD's led is off and it doesn't blink. The system is in that state five, ten, fifteen minutes and nothing happens. I push the “Reset” button, the system reboot and if I push the “Enter” key in GRUB the system boot without problems, “Checking file systems…” returns some info that I think relevant to the last successful check. But if I don't push “Enter” the system hangs again.

    I have to notice also I performed partitions size change about month ago. I reduced the partition where the root directory was and increased the partition with the “home” directory. I performed this operation booting with Ubuntu live CD and using the GParted utility. Partition size changing completed without any errors or warnings.
  • Goineasy9Goineasy9 Posts: 1,116
    Well, if there is no disk light activity, fsck has a problem. Have you tried doing an fsck from terminal? I think it's strange that if you don't wait for the timeout in grub that it boots, but doesn't otherwise. Try (as root) "fsck /dev/sda3" without quotes, and see if it blows up from terminal. I'm assuming sda3 is your root, let us know. If it's not root, what is it?
  • mfillpotmfillpot Posts: 2,180
    I am thinking about this a little more. Is your bootloader set to go to the intended boot entry by default (the one you enter into manually), or could it be trying to enter and invalid boot entry?
  • I tried to make an fsck disk check. I made it for both partitions: /dev/sda2 where my root directory is and /dev/sda3 where my home is.

    Here's the output:

    # begin code
    # fsck /dev/sda2
    fsck 1.41.3 (12-Oct-2008)
    e2fsck 1.41.3 (12-Oct-2008)
    /dev/sda2 is mounted.

    WARNING!!! Running e2fsck on a mounted filesystem may cause
    SEVERE filesystem damage.

    Do you really want to continue (y/n)? yes

    /dev/sda2: recovering journal

    Clearing orphaned inode 57245 (uid=1000, gid=1000, mode=0140755, size=0)
    /dev/sda2: clean, 191656/1283632 files, 1211592/5120718 blocks

    # fsck /dev/sda3
    fsck 1.41.3 (12-Oct-2008)
    e2fsck 1.41.3 (12-Oct-2008)
    /dev/sda3 is mounted.

    WARNING!!! Running e2fsck on a mounted filesystem may cause
    SEVERE filesystem damage.

    Do you really want to continue (y/n)? yes

    /dev/sda3: recovering journal

    /dev/sda3 has been mounted 29 times without being checked, check forced.
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/sda3: 316061/8372224 files (1.9% non-contiguous), 24838247/33463395 blocks
    # end code

    As far as I can understand fsck works correctly. If so, may be there's a script which contains the fsck launch command. It might be this script must execute the check disk command with some options at the boot time. I assume if this script exist may be the bug is in it.

    What about to push or not to push the “Enter” button in GRUB for successful loading I checked it and it simply was coincidence. My system hang on the check stage regardless of my actions in GRUB.

    I changed /etc/fstab. This file contains the partitions which have to check at boot. It includes the strings:

    # begin code
    …
    /dev/sda2 / ext3 errors=remount-ro 0 1
    /dev/sda3 /home ext3 defaults 0 2
    …
    # end code

    I changed the values of the last two parameters from 1 and 2 to 0 for preventing the HDD check at boot. Now my system doesn't hang but you know this doesn't solve the problem.
  • mfillpotmfillpot Posts: 2,180
    If the problem is not related to the boot method and it is intermitten then I would start looking at the potential of a hardware problem as the cause. Please run a memory test using memtest86+ to see if the problem is related to your memory (this could explain the random nature of it). If that does not show a problem then you may want to push other limits on your system like testing the HD speeds and maxing out connections to see if you can find other issues and errors that happend with specific operations related to hardware.

    I am leaning toward an issue with the RAM or motherboard as the cause for the freezing.
Sign In or Register to comment.