Skip to content

Raspberry Pi Emergency Mode After Editing fstab

If the Pi enters emergency mode after you added a USB drive to /etc/fstab, look for a failed mount or device dependency in the boot log. A missing drive or an incorrect UUID can prevent a required mount from completing. Fix the entry for that drive, then verify the mount before relying on it.

Identify the mount that blocked startup

Use a local console if SSH is unavailable. From a privileged recovery shell on the Pi, check the boot log and the detected filesystems.

1
2
3
4
# Look for the first mount or device error, then compare filesystem UUIDs.
journalctl -b -p warning --no-pager
systemctl --failed --no-pager
lsblk -o NAME,MODEL,TRAN,FSTYPE,UUID,MOUNTPOINTS

For a known mount point such as /mnt/usb-data, identify its systemd unit and read its log. If the mount table still looks suspicious, findmnt --verify checks its entries without mounting them. findmnt manual

1
2
3
usb_unit=$(systemd-escape --path --suffix=mount /mnt/usb-data)
journalctl -b -u "$usb_unit" --no-pager
findmnt --verify --verbose
What the log points to What to check
A device UUID is missing Confirm the drive is attached. Compare the filesystem's UUID in lsblk with the USB entry in fstab.
The device is present but the mount fails Confirm the mount directory, filesystem type, and options. If the kernel reports I/O errors, prioritize preserving data.
The entry points to / or /boot/firmware Treat it as a system mount. Restore the correct entry from a known-good configuration for this installation.

If the logs show a filesystem forced read-only or repeated I/O failures, use the storage recovery checks. Diagnose a read-only file system

Correct the USB entry

Back up /etc/fstab before editing. If you cannot open a recovery shell or write to the filesystem from it, use another Linux computer or boot from a spare OS drive. Identify and mount the original installation's root partition by its device, size and filesystem. For example, if you mounted that partition at /media/alex/rootfs, back up and edit /media/alex/rootfs/etc/fstab.

If you just added an optional USB entry and the rest of the Pi can run independently, comment out that entry with # to recover normal startup. After the Pi boots, either keep the drive disconnected or restore the entry with the verified UUID and optional mount settings. If the disk must be present for normal operation, fix the device or entry and keep it required. systemd mount dependencies

This example is for an optional ext4 data disk. Replace the UUID and mount point with the correct values.

UUID=YOUR_EXT4_UUID /mnt/usb-data ext4 defaults,nofail,x-systemd.device-timeout=10s 0 2

nofail lets the system continue when the optional mount fails. x-systemd.device-timeout=10s limits how long systemd waits for the device to appear. Choose a timeout that gives your drive enough time to initialise. On a Pi 4B with Trixie, an isolated generator test made the ordinary ext4 entry a requirement of local-fs.target, which is configured to enter emergency mode on failure. The example above made it a wanted mount and generated a separate 10-second device timeout. systemd mount options

Test the repaired entry

On the Pi, after normal startup is restored, check the table before rebooting again. With the drive attached, reload systemd and start just its mount unit. Use the actual mount point in both commands.

1
2
3
4
5
usb_unit=$(systemd-escape --path --suffix=mount /mnt/usb-data)
sudo findmnt --verify --verbose &&
  sudo systemctl daemon-reload &&
  sudo systemctl start "$usb_unit"
findmnt --mountpoint /mnt/usb-data -o TARGET,SOURCE,FSTYPE,UUID,OPTIONS

If the drive was already mounted, follow the USB guide to apply changed options and then check the result. Verify the exact UUID before starting a backup or media app. An optional disk can remain absent while its mount directory exists on the system disk. Test a USB mount before rebooting

Donate