LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 05-13-2021, 11:07 AM   #1
gumb
Member
 
Registered: Oct 2005
Distribution: openSUSE
Posts: 38

Rep: Reputation: 15
Boot failure following loss of BIOS settings


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!
 
Old 05-13-2021, 01:06 PM   #2
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 301
Blog Entries: 2

Rep: Reputation: Disabled
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.
 
Old 05-13-2021, 04:00 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,642

Rep: Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551
Wonder if somehow the device order is messed up causing the naming to be wrong. Usually on newer stuff that won't happen.

I'd boot to some live media of similar or exact distro to run file checks if you don't want to play with rescue mode.
 
Old 05-13-2021, 11:16 PM   #4
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 4,993
Blog Entries: 1

Rep: Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738
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.

Last edited by mrmazda; 05-13-2021 at 11:21 PM.
 
Old 05-14-2021, 02:24 AM   #5
gumb
Member
 
Registered: Oct 2005
Distribution: openSUSE
Posts: 38

Original Poster
Rep: Reputation: 15
Well, colour me befuddled. I tried to run
Code:
fsck.ext4 /dev/sda3
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?
 
Old 05-14-2021, 03:19 AM   #6
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan with some Tiny Core, Fatdog, Haiku, & BSD thrown in.
Posts: 4,923

Rep: Reputation: Disabled
Directories can be mounted over previous mounts, which is what appears to be happening.

If you can, find out what is mounting those two directories under /mnt.

Edit: If you mounted those directories, unmount them & see what happens.

Last edited by fatmac; 05-14-2021 at 03:23 AM.
 
Old 05-14-2021, 11:44 AM   #7
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 301
Blog Entries: 2

Rep: Reputation: Disabled
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.
 
Old 05-14-2021, 12:42 PM   #8
gumb
Member
 
Registered: Oct 2005
Distribution: openSUSE
Posts: 38

Original Poster
Rep: Reputation: 15
[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.

Thanks for all the replies.
 
Old 05-14-2021, 05:38 PM   #9
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 301
Blog Entries: 2

Rep: Reputation: Disabled
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).
 
Old 05-14-2021, 07:03 PM   #10
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 4,993
Blog Entries: 1

Rep: Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738Reputation: 1738
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.
 
Old 05-15-2021, 10:00 AM   #11
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 301
Blog Entries: 2

Rep: Reputation: Disabled
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.
 
  


Reply

Tags
battery, bios, boot, failed, partition


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loss Of Network Connection After Power Loss etpoole60 Linux - Networking 4 11-02-2014 07:55 PM
Loss Of Network Connection After Power Loss etpoole60 Linux - Virtualization and Cloud 2 10-27-2014 03:14 PM
Network Connection Loss And USB Connection Loss. Novatian Linux - Desktop 1 11-07-2008 02:09 PM
possible HW list OC; by MoBo, CPU, Mem, BIOS CPU x Addition HCL (stock BIOS settings) digital8doug Linux - General 17 12-15-2006 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration