ValveSoftware / SteamOS

SteamOS community tracker
1.48k stars 69 forks source link

SteamOS won't boot if external SD card has filesystem errors. #1462

Closed TDuffinNTU closed 4 weeks ago

TDuffinNTU commented 1 month ago

Your system information

Please describe your issue in as much detail as possible:

If the external MMC has filesystem errors (easily fixed with e2fsk) the system won't attempt to fix the card and will hang on boot. removing the card will cause the system to fail to boot.

It should prompt running e2fsk or boot with the card unmounted, not sit on the boot screen indefinitely or tell users to wipe their whole deck. I now have to get a recovery drive and fix the drive in another OS which is fine for me, but not many users are technically aware and would just wipe their whole deck for something most Linux distros can solve without issue.

Solution: run e2fsk or unmount SD instead of hanging in boot. Perhaps give this as an option on the 'steamOS boot failed' menu.

Steps for reproducing this issue:

  1. Have steamdeck with external mmc
  2. cause some kind of fs error on the mmc
  3. reboot without unmounting
lostgoat commented 1 month ago

@TDuffinNTU can you share a copy of your journalctl logs?

Normally if a card has filesystem errors SteamOS will automatically try to run fsck on it. So something in that process must’ve gone sideways and the logs might help us find out what.

TDuffinNTU commented 1 month ago

I should correct myself and note that I was able to just stick the SD card in my laptop (KDE Neon) and fix the filesystem using fsck on there. It's a 256GB card so it took a couple of minutes but otherwise booted fine afterwards.

bootfail.log bootfail2.log

These are from boot -2 and -1, but I did attempt booting 5 or 6 times all in all.

bertogg commented 1 month ago

Hi @TDuffinNTU , thanks for the logs.

Mar 30 10:03:21 steamdeck systemd[1]: Found device /dev/mmcblk0p1.
Mar 30 10:03:21 steamdeck systemd[1]: Mounting /run/media/mmcblk0...
Mar 30 10:03:21 steamdeck mount[548]: mount: /run/media/mmcblk0: cannot mount; probably corrupted filesystem on /dev/mmcblk0p1.
Mar 30 10:03:21 steamdeck mount[548]:        dmesg(1) may have more information after failed mount system call.
Mar 30 10:03:21 steamdeck systemd[1]: run-media-mmcblk0.mount: Mount process exited, code=exited, status=32/n/a
Mar 30 10:03:21 steamdeck systemd[1]: run-media-mmcblk0.mount: Failed with result 'exit-code'.
Mar 30 10:03:21 steamdeck kernel: EXT4-fs (mmcblk0p1): VFS: Found ext4 filesystem with invalid superblock checksum.  Run e2fsck?

Have you maybe modified /etc/fstab or added a custom systemd unit to mount the SD card on /run/media/mmcblk0?

SteamOS 3.5 mounts the external SD card on /run/media/deck/LABEL and checks and repairs the filesystem first.

TDuffinNTU commented 1 month ago

Have you maybe modified /etc/fstab or added a custom systemd unit to mount the SD card on /run/media/mmcblk0?

Good question. I can't say for certain since I've only ever interacted with system partitions via KDE's partition manager, but I vaguely recall setting the mount point for the emmc after a SteamOS update modified the mount points as it either unmounted or caused some issues with game install locations.

I assume the next step would be to move the mount point to /run/media/deck/mmcblk0 and wait for the issue to happen again? :)

bertogg commented 1 month ago

The short answer is: it's not recommended to mess with the SD card's mount points.

If your /etc/fstab file contains references to mmcblk0 then I suggest to delete those lines. The OS is expected to handle the external SD card without that.

TDuffinNTU commented 4 weeks ago

yep, appears removing the lines in fstab worked, cheers :)