SteamOS icon indicating copy to clipboard operation
SteamOS copied to clipboard

Automount of /run/media/deck/var breaks updates

Open macromorgan opened this issue 6 months ago • 12 comments

Obviously this is a massively unsupported setup, but I'm running the official Steam OS on an Atari VCS 800. While this works well it refuses to update. After digging into it, it looks like the update fails during the step where it copies the active /var partition to the inactive one. This step fails because the inactive /var gets mounted automatically due to the udev rule 99-steamos-automount.rules which automatically mounts all devices that are either /dev/mmcblk* or /dev/sd*. Since the hard disk for this device is SATA only, it is assigned a /dev/sd* label and thus the inactive var partition gets mounted automatically.

I propose a fix that includes an additional check to make sure that if the partition name is var we immediately goto the exit condition and not attempt to mount the filesystem. Alternatively/even better, we could instead include a check that ensures automount is only run on usb or mmc devices.

As a workaround, updates must be currently performed only after /run/media/deck/var is unmounted.

macromorgan avatar Jul 18 '25 21:07 macromorgan

Nice catch. Were there any other things you had to fix to get it running?

fledermaus avatar Jul 18 '25 22:07 fledermaus

I tried to install it direct to the eMMC but think I was unable to due to missing drivers in the kernel (or something related to the pinconfig). I eventually gave up and just installed it to the M2 sata instead.

The “restore” script to re-image a deck expects to install on an NVME drive, so I had to change some hard coded paths from /dev/nvme01p* to /dev/sd*, and also I had to not reference the NVME specific scrub functions.

So in summary; the steam deck image works on my VCS 800 just fine, so long as I manually tweak the install script to get it running, and unmount the /run/media/deck/var partition before I run an update after I get it running.

macromorgan avatar Jul 18 '25 23:07 macromorgan

Alternatively/even better, we could instead include a check that ensures automount is only run on usb or mmc devices.

I believe that something like this in /usr/lib/udev/rules.d/99-steamos-automount.rules should solve the problem, can you give it a try @macromorgan ?

KERNEL!="mmcblk*|sd*",             GOTO="steamos_automount_end"
KERNEL=="sd*", ENV{ID_BUS}!="usb", GOTO="steamos_automount_end"
ENV{ID_FS_USAGE}!="filesystem",    GOTO="steamos_automount_end"

bertogg avatar Jul 22 '25 14:07 bertogg

I was considering tweaking the script to no-op on OS partitions as enumerated in the /efi partset.

fledermaus avatar Jul 22 '25 15:07 fledermaus

I suppose that would help if the whole system is booted from a USB drive, right?

bertogg avatar Jul 22 '25 15:07 bertogg

Yes, the media automounter would simply never touch OS partitions with that change.

fledermaus avatar Jul 22 '25 15:07 fledermaus

Yeah, that sounds like a good idea

bertogg avatar Jul 22 '25 15:07 bertogg

KERNEL=="sd*", ENV{ID_BUS}!="usb", GOTO="steamos_automount_end"

This does solve the issue. Alternatively, we could check that ENV{ID_BUS}="ata" without even checking for sd*? Or we could mess with the media mounter script too. I really just wanted to document this as an issue and propose possible fixes.

macromorgan avatar Jul 22 '25 17:07 macromorgan

The following replacement for /usr/lib/hwsupport/block-device-event.sh should fix things without hardcoding assumptions about the device's storage technology (remove the .txt from the name, github's not letting me attach a .sh named file):

block-device-event.sh.txt

I've tested it locally and it seems to work, if you could confirm it works for you that would be great.

You may need to reboot after installing this to see if it works.

fledermaus avatar Jul 22 '25 17:07 fledermaus

block-device-event.sh

I can confirm this changed script also works for me. I can see in the journalctl log where it tries to mount /dev/sda7 but correctly identifies it as being registered in /efi/SteamOS/partsets/all and then skips mounting it.

macromorgan avatar Jul 24 '25 15:07 macromorgan

Will probably land in SteamOS 3.8.x.

Thanks for the report.

fledermaus avatar Jul 28 '25 16:07 fledermaus

This has been fixed in the 3.8.x images since around August 2025.

bertogg avatar Nov 05 '25 12:11 bertogg