Skip to main content I accidentally did something to fstab, and now I can't get in to my Debian computer : r/debian
r/debian icon
Go to debian

I accidentally did something to fstab, and now I can't get in to my Debian computer

I've pressed enter and it doesn't solve the problem, and I've tried rebooting, but that just brings me back to this

r/debian - I accidentally did something to fstab, and now I can't get in to my Debian computer
Light, calm, and focused. Opera Air is your partner in mindful browsing.
Thumbnail image: Light, calm, and focused. Opera Air is your partner in mindful browsing.
Sort by:
Best
Open comment sort options

You don't even need to boot into a rescue system or different medium to recover from that. This just needs help in mounting the necessary partitions for your system to continue booting.

Enter your root user password then use lsblk to see the storage volumes present. You can then use the mount command to mount the root partition and any other partitions necessary for the system to boot.

  • If you remember installing with encryption use cryptsetup luksOpen to mount your encrypted container.

  • If you remember installing with LVM use pvscan, lvscan, and lvchange to activate your LVM.

Once done use exit to complete the boot process, then fix your "/etc/fstab" immediately.

Enter your root user password

Per the message on their screen, their root account is locked. IE it probably doesn't have a password set, and instead has * in the shadow file or something like that.

More replies
More replies

Don't panic. You'll need to boot off something else as the os can't understand your current fstab config.

Download the latest system rescue iso here:

https://www.system-rescue.org/

Write it to a usb (assuming you have another working computer of some sort?)

Boot from that and follow the on-screen prompts to get to a command prompt, then run startx to start a graphical session

This will take you a recognisable gui. You need to identify your hard drive partition that contains the etc directory and moun it somewhere. Then you can go in and edit the fstab

Let us know how it goes

So, that brought up a thing that resembled command line with grub>

I don't know what I'm supposed to do from here if this is even working correctly. I tried startx, and it didn't recognize that command.

More replies
More replies

use a bootable media and fix the fstab with chroot

You don't need to chroot. Just boot off a different medium and mount the partition with the /etc, then edit it to undo the error

More replies

You do not need a chroot for that, unlike if you had to use apt on your non-bootable system.

More replies
Edited

Doesn't need chroot, he/she can just edit fstab from within the current root.

You only need chroot if you wanna run something from within that other root. It's a common practice in musl installs if you'd like to run glib applications. Most will run in musl, but some just refuse and need glib to run.

Also, if you'd like to fix grub, yeah, you'll need chroot (not necessarily, but it's wise to fix with chroot).

More replies
[deleted]

Boot using live media (usb) mount the partition with /etc and updo the change in fstab

Cat /etc/fstab please