[RESPONDED] Etc/fstab broken and computer will not boot

So I buggered up my etc/fstab file and now my laptop no longer boots, presumably because it can’t see the boot drive. I can boot with a live linux distribution but how do I get to access and fix the etc/fstab file that is on a drive that is no longer recognized?
I have tried mounting the drive but I obviously do not know what I am doing.
I would be grateful for any help that gets me my computer back.

The specifics kind of depend on the distro. If you see grub and kernel selection then you can get to it with kernel parameters, however if you do not you will need to use a live usb and mount the sysroot in the live environment. How you go about doing that depends on the distro to a degree. What distro was the install?

I am using Ubuntu 23.4 I think. I was unable to see a grub menu but then I don’t really know what I am doing. I can get into a boot manager menu but it is empty.
I was able to boot with a live distribution on a USB stick but I have been unable to access the main drive once the live Ubuntu is running.
Powering up while keeping F10 pressed will, after a couple of minutes of a black screen, gives me a message that the boot failed and to insert recovery media (I don’t know what that means)
Same thing happens if I hold down the F12 or the F2 key during boot.

If I keep tapping the F10 key during boot, I get a message that F10 has pressed and it then goes into the ‘MEBx’ menu that ask for a password … which I don’t have.
If I power up while tapping F2, I get the BIOS menu. Going to the boot tab under the attached devices I have no hard disk, just a couple of USB devices.
Under the security tab I have ‘enforce secure boot’ disabled.

I think your first hurdle would be to correctly identify the degree of fubar your system is in.

Is your volume / partition / drive still intact with only fstab being messed up? Or is there something else going on here? i.e. You should at least be about to mount the partition without issue, and view its contents.

If you are sure it is only your /etc/fstab that you borked and stuff is not pointing at the right locations then you should be able to follow this mostly grub2 - How to fix one existing Ubuntu installation from another - Ask Ubuntu and while using chroot edit your /etc/fstab back to a usable point. You will want to use other commands to identify how your file system is setup. lsblk -f, lvs, lvdisplay, fdisk -l, zfs list, it all depends on what file system you used for the install.

I assume the drive is still ok. The way I screwed it up is that I edited etc/fstab, saved it and rebooted (well, tried to). My interpretation of the sequence of events is that since the fstab file is screwed up, the drive can’t be mounted. I tried using ‘disks’ once booted into a live Ubuntu distribution but while I see a drive of some kind, there is no information about size or id or any partitions and I can not mount the drive from the disks menu. I am allowed to change the default boot parameters but it doesn’t seem to make a difference.

I will try to use grub2 as per nadb above … I will report back later

Looking at a working Ubuntu installation with ‘disks’, I see a drive similar to the one on the broken computer. It is identified as “Drive” “SMI USB disk”. No idea what it refers to as there are no USB drives attached to the working computer. On the non-working computer I see the thumb drive (boot drive), the “SMI USB disk” as well as a 2.3 GB loop device. It has a squashfs file system and is on /dev/loop0 (read only). I don’t know what the story is with that. In any case, no listing for the 1 or 2TB main drive.

Re the grub2 fix - since I can’t see the drive in disks, I suspect I can’t use that method.
Why would disks not at least see the drive? I don’t know how changing fstab could actually kill the disk. I would think it would still be shown in ‘disks’

Have you tried running any of the commands I listed. This is something that really needs to be done in a terminal or console not with GUI tools, so we know exactly what commands are being used.

Are you talking about the root= command followed by the others?
I don’t see a drive in disks so how can I run the root command? I could take a wild guess but that’s what got me into trouble in the first place with the fstab file.
I am ok with working on the terminal but I need to know what I am supposed to do.

If you are on a live usb, you should have a terminal available, use it to probe your system not the GUI tool which I am assuming is the gnome-disk-utility.

These commands lsblk -f, lvs, lvdisplay, fdisk -l, zfs list to start with. Still have no idea what file system you are using.

ok, with the dead computer booted up on the live ubuntu I see the following:
lsblk -f
A bunch of loop devices and SDA (sda1,sda2, sda3 and sda4) all on the thumb drive
Nothing else

lvs got me a note that I am running as a non root user and ‘permission denied’, sudo lvs got me no output

lvsdisplay - same as lvs

sudo fdisk -l got me info on the thumb drive plus one of the loop devices but nothing on the hard drive

zfs complains about missing arguments

The file system is the standard Ubuntu system that installs if you default on all choices. Presumably EXT4

Is it possible to somehow set up the hard drive as something that can be attached to the working computer? If I recall, there is only a single hard drive position in the gen11/12 Framework 13 laptops ?

Edit: further research confirmed that there is only a single hard drive slot. Is there such a thing as an external housing that takes one of these SSD drives and lets me connect it via let’s say USB to a running computer?

Edit #2: would this enclosure work for the standard Framework 1/2 TB drives?

If I attach the currently dead/non-booting drive via a external USB drive to a working computer, does it sound reasonable to assume that I should be able to access the drive, change the etc/fstab file back, re-install it in the original computer and have a working computer back?

I now believe that GRUB is broken since I can’t even get it to start with pressing ESC during boot. Supposedly it’s easy to re-install with a live install but I am reluctant to do this because my track record of doing operations like that is spotty at best. I do not want to risk more damage to the drive.
I have ordered the external case for the hard disk and that should be here by Friday. If hooking the drive up via USB doesn’t get me anywhere, I can then try reloading Grub from the live disk.

Hi @Jens ,

Is it possible to take screenshots of the commands @nadb has suggested?
this helps in visualizing and eventually pinpointing the issue.


I will try and do that tomorrow.

I tried to get an output listing for you but ran into a problem. The output files don’t seem to write to the thumb drive (or at least I can’t find them) and attempting to connect to the network in order to write the files there did not succeed (probably blocked on a ‘try ubuntu’ thumb drive)
Edit: the files survived rebooting the thumb drive so they are definitely there but I just don’t know where to look for them on the thumb drive.

Hey Jens, help yourself by sharing as much detail as possible. Things that may seem self-evident to you will often leave people who want to assist you scratching their head. Maybe you could answer these questions:

  1. @Loell_Framework asked for “screenshots”. Is this what you mean by “output files”?
  2. What tool / program did you use to make the “output files”?
  3. How did you instruct that tool to save them?
  4. How do you know they survived a reboot?
  5. Is the “thumb drive” the USB storage device that contains the ISO you’re booting from or is it another storage device that you plugged in after Ubuntu Live was running?
  6. How did you prepare the “thumb drive”?

With this information, people familiar with the Ubuntu Live environment might be able to help you retrieve the “output files”.

If you have a phone or a tablet with a camera, you could use it to re-make the screenshots.