Help: Emergency Mode after Windows borked everything, BTRFS, LUKS, Fedora
discussion.fedoraproject.org
Hey people! It seems I have some really messed up fstab or anything else, as Windows tried to do "disk repair".
Now after decrypting my LUKS storage it seems is tries to mount a nonexistent Windows partition and always fails.
I am using default BTRFS on Fedora Kinoite.
Has anyone an idea how to fix this? Thanks!
Update, Solution found!
I literally had the external Windows drive mounted to a subdirectory of Home, so as it wasnt there for some weird reason nothing loaded?
Will try to use the nofail
flag, thanks @rotopenguin@infosec.pub for the tip!
I have never used Kinoite, nor a LUKS-based environment, but if you have a mount point in your /etc/fstab and mounting it fails at boot, at least Debian will go into emergency mode. I wouldn't be surprised if Kinoite does too.
If you have an entry there for the Windows partition, enter emergency mode, use an editor like nano or whatever you're comfortable with to edit that file, and comment the windows mount line out with a leading pound sign. Save, and run
shutdown -r now
to reboot and hopefully you should come up to a sane Linux environment, sans the Windows mount.It's possible that whatever drive Windows is on -- which I assume is internal -- is dying. That could cause Windows to fail a repair, to be unable to boot, and your Linux distro on your external drive not to be able to find your Windows partition.
If you can get into your Kinoite environment, you can run
lsblk
to see a list of drives that it can see. If the internal drive doesn't show up, that'd be a a pretty good red flag that something's wrong with it.EDIT: I'll also add that if that's the problem, this is the second time someone's posted a request for help in a couple days that I've responded to related to a drive failing, where it wasn't obvious to the user that the drive was failing, and in diagnosing the problem, they interpreted the problem as software on the computer producing problems with their drive (one person decided that Arch was likely at fault and put Debian on their system, and here Windows is catching flak). I think that there's a legit argument that PCs need to do a better job of handling drive failure from a UI standpoint, as the symptoms that a failing drive can produce are not always obvious:
Lengthy delays when an OS tries accessing a drive.
A drive not being visible to the computer.
Various programs failing when trying to work with the drive.
Failure to boot.
A number of things occur to me that could be helpful:
A BIOS could remember a brief description of the last media it successfully booted from. If it cannot find any valid boot media, it could display a message saying that it cannot see the drive with the given manufacturer, model name, and capacity and suggesting that the drive may have failed. That won't catch every situation, like if there are multiple sources of bootable media present, but I think that for a lot of users, that'd direct them down the right path.
If there has been no hard power down (i.e. to cold-remove a drive), a BIOS has a drive plugged into a controller that it knows does not support hot-swap capabilities (e.g. an on-board ATA/SATA/NVMe controller), and the drive is no longer visible, it's a pretty good bet that that drive has failed. It might not be a bad idea to default to a delay at boot for N seconds showing a message about a probably failed drive. Have a BIOS option to disable "interactive diagnostic support" for headless systems.
Linux distros could be set up with better support for indicating to a user that a drive is failing. SMART won't always catch it, but having SMART active on a distro by default might be a good idea. Having errors there, or I/O errors to a non-removable-media drive percolate up to something user-visible, like the notification manager, by default that suggests that the drive might be seeing physical problems might help. Normally, if I'm thinking that a drive might be failing, I go check the kernel log for I/O failures, but that's probably not obvious to everyone, and it doesn't default to indicating to the user that something might be broken. If SMART is saying that a drive is failing or there are I/O errors occurring to the drive, it's probably at least reasonable to suggest to the user that they don't want to be relying on that drive any more.
On the above note, having the kernel retain I/O error counts for devices (maybe it does, but I don't recall seeing it) and logging those in system statistics daemons like sysstat and collectd might help for post-mortem analysis of drive failure (well, maybe not if the failing drive is the one where the statistics log is going).
Those are heuristics, but I think that they aren't likely to throw too many false positives out, and they may help users figure out why their machine isn't happy.
Thanks, yes very true. I didnt know that every mount in fstab needs to succeed, so I literally didnt have the drive attached. Removing the line (what sign do you use for commenting, pound?? £ ?) Fixed everything.
Ugh, didn't think of that interpretation.
Pound sign, as in "#".
https://en.wikipedia.org/wiki/Number\_sign
Hahaha lol, thats a hashtag isnt it?
No, though it could be the first character in a hashtag. A hashtag includes the characters that follow.
EDIT: The article I linked to says that in Canada, it's typically called the "number sign", in the US, the "pound sign", and in the UK, the "hash mark".
Lol funny thanks!
My first attempt to try to fix something like this would be to:
sudo dnf install gnome-disks
to install it temporarily on the live session.)I'm also wondering: How did you add the Windows partition to Fedora? Was it from within Fedora's installer (aka: "Anaconda")? Or did you add it in a different way?
(BTW: I use Silverblue and have a long history with Fedora. 😁)
Why isn't there a fstab Gui editor that comes standard with livecds?
It would either be horrendously complex or no better than a text editor.
Yet in other operating systems, it is trivial to setup mount points with only the gui
You can set up mount points on Linux, at least in GNOME, very easily. (It's even fully automatic for external disks.) I'd be surprised if it isn't as easy in KDE and other desktops too.
The problem here (at least from what it sounds like) isn't setting up mount points. The problem is fixing an incorrect fstab on the disk that's causing the system to hang on boot.
(This isn't a typical situation, which is why I also asked about how the partition was added to the system.)
Other operating systems probably don't have the diversity of Linux
Good point! GNOME Disks can do this, actually. I didn't think about that.
(Edit: However, I think it'll just edit the /etc/fstab of the running system. In other words, the one of the live session, not the one on the installation.)
Windows worked normally, until it didnt. Fedora worked normally, installed for a long time.
i wanted to access the windows storage partition from
~/Windows-SSD
and set the mount point in KDE Partitionmanager. Didnt think that that would have created such a mess.Problem is, I have no idea how I installed Fedora, as my UEFI doesnt allow regular storage devices, just UEFI entries. No idea why, I set everything normally and even "legacy boot first" but no USB sticks shown.
I will ask another thread on how to generate unspecified USB-boot entries.
Adding a "nofail" flag to the fstab is an option, too.
Dude what! How have I never known about this after using Linux for so long
thanks! Could you give me an example line, where to put that? Its the solution I like most
It goes in the fourth column of the fstab, so like
/dev/disk/by-label/Butts /mnt/pants buttfs defaults,nofail,subvol=@ss 0 0
(love too eat spaces and any other attempt at formatting text)
Thanks!
You probably have to boot to Windows first and let it finish the disk checking. Then make sure fast boot is turned off
Good job fixing the problem! It's always that thing you did that seemed to work 😹