[SOLVED] Boot failure following loss of BIOS settings
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just went away for a week and switched off the PC tower with the button on the PSU at the back, only to now switch it back on and see the BIOS is back to defaults because the battery's run down. I restored all the BIOS settings to what I'm pretty sure are as before, but my AV Linux install no longer boots. It gets past GRUB and seems to recognise the root partition which is housed on the second disk (sdb1), going through the initial start-up steps, but then won't recognize /home at sda3, and another data partition - 'av_media' - on the second disk (sdb2) and hangs. There's a FAILED message for a File System Check, followed by
Code:
[DEPEND] Dependency failed for /home.
[DEPEND] Dependency failed for /home/av_media.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for home-media.automount.
It then says I'm in emergency mode and must give root password for maintenance. I don't know where this emergency system is running from but trying to list directories only shows 'root', so I mounted root (sdb1) and did a chroot to it. I can see all my files, and can also mount home (sda3) and see that too.
Looking up some instructions online I ran
Code:
blkid | grep -v loop
and can see the UUID strings of all partitions match those in fstab.
This old PC has an ancient WinXP install on the first disk (sda1) which still boots without issue. I wonder if a boot flag has become corrupted or lost on one disk or the other. I put in a Partition Magic live CD but from there I'm unable to mount the problem partitions. Nothing happens. I don't know enough about fdisk and parted from the CLI to see if there's anything useful I can do there. I looked at their help files but I'm stumped.
I'm hoping somebody recognizes this as a known problem that can occur after a loss of BIOS, with an easy fix!
You should be able to boot to single user mode, not rescue mode. That way you don't have to chroot.
I don't think it is a BIOS problem, I think it is not being booted in a long time. You said you mounted the filesystems, did you fsck them? I'd first fsck them, then check the fstab to make sure they are set up correctly, then issue like "mount /home" instead of the specific mount to see if it will read and mount it.
Check that the sixth fstab field is set to 2, not 0 for these filesystems so they are fsck'ed.
Emergency mode operation is provided by the initrd.
The BIOS probably has nothing to do with this, except maybe if you neglected to set the BIOS clock before exiting setup.
Apparently pulling the plug before your time off caused corruption that cannot be automatically corrected. In emergency mode you can't expect mounting of all filesystems, especially corrupted ones. What you can do from within emergency mode in this case, because / is mounted, is to run fsck manually on your /home and /av_media filesystems. If success, then next boot should be back to normal.
openSUSE defaults to btrfs on /, which needs its repair to be made via btrfs check --repair.
and got a message saying unable to run fsck, partition is in use. So I did
Code:
umount /mnt/home
(that's where I'd mounted it)
but still got the message saying it was in use. Too tired to look at it any more last night I just typed exit thinking I'd shutdown, only for the console to go away and the regular graphical login screen to appear. After logging in those drives are mounted, and at first things seem normal, but I just fired up GParted and can see the following:
Code:
Partition File System Mount Point
/dev/sda1 ntfs
/dev/sda2 linux-swap
/dev/sda3 ext4 /home,/mnt
/dev/sdb1 ext4 /,/mnt
/dev/sdb2 ext4 /home/av_media
So sda3 and sdb1 are seemingly mounted twice including at /mnt (with home at /mnt, not /mnt/home like I specified on the command line), the others are as normal.
Other than rebooting I don't know how to get back to a point where I could run fsck on the home and media partitions. Is there anything else I should look at whilst I'm in the GUI? Note that it was the automatic fsck at boot which was showing the FAILED message whereafter it dumped me in emergency mode. I've never run fsck manually before and don't really understand any of the options. Is it usually safe to let it automatically fix errors or do I risk losing data?
Gparted might be reading the "last mounted" field in the filesystem itself as well as fstab. That is why there are 2 reported paths.
I do fsck only in single user mode. The directories should not be mounted at all when you start. Check via mount command.
I'd trust mount command, even there are cases where it can be fooled (mtab corrupted).
Do fsck by path, and check if it checks the right device, "fsck /home" not fsck /dev/sda3. I'd still check your fstab to make sure the sixth field and mount points are right.
Last edited by elgrandeperro; 05-14-2021 at 11:48 AM.
[SOLVED] Boot failure following loss of BIOS settings
I rebooted and got the same errors so logged in at the prompt as root, then ran fsck on /dev/sda3 (home). That reported a few inode errors so I took the suggested action and auto-corrected them. Then a slew of other errors appeared, mostly in Firefox cache files. After confirming the correction of a dozen individually, I could see I was going to be there all night so typed 'a' to auto-confirm and saw a couple of hundred scroll by. Running fsck on the other drives said there were no errors.
After all that, rebooted and it reached the GUI as normal. This is not my main machine, it's a lumbering old device I'm having to keep around until I figure out some way to replace some processes so I don't think there'll be any major damage. It's just another prompt for me to get on with sorting it out because that drive on sda is ancient and probably starting to fail.
I still think fstab might be wrong. Linux will manage this itself and should go into fsck and fail or run by itself. Check the sixth field of the entries, should be non-zero (I think it is often 2).
Linux is the name of the kernel. The kernel never writes to fstab. It only mounts filesystems as /etc/fstab directs. A distro's installation system will write an initial one, but the admin must make edits to it whenever /etc/fstab content has somehow become inappropriate.
I mistyped, I meant it manages whether to fsck on boot, not the fstab itself. If fsck is required, it SHOULD do it for all known filesystems in fstab unless you disable it via field six. And fsck will just run (on boot) if
a filesystem has not fscked given a time value in the superblock or the filesystem was not unmounted cleanly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.