bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
612 stars 66 forks source link

systemd normally mounts /tmp as tmpfs, but on Bedrock #162

Open SeerLite opened 4 years ago

SeerLite commented 4 years ago

After rebooting, I can still see my leftover files from the previous session in /tmp. Maybe another btrfs problem? I casually found out about this while trying to make a new brl report in /tmp for my previous issue, and then realizing /tmp/log was already there from a previous one (even though I had rebooted). I haven't debugged this one a lot, but here's the output of mount | grep:

/dev/mapper/cryptroot on /bedrock/strata/bedrock/tmp type btrfs (rw,relatime,compress-force=zstd:3,ssd,space_cache,subvolid=490,subvol=/@bedrock/tmp)
/dev/mapper/cryptroot on /tmp type btrfs (rw,relatime,compress-force=zstd:3,ssd,space_cache,subvolid=490,subvol=/@bedrock/tmp)
/dev/mapper/cryptroot on /bedrock/strata/ubuntu/tmp type btrfs (rw,relatime,compress-force=zstd:3,ssd,space_cache,subvolid=490,subvol=/@bedrock/tmp)
/dev/mapper/cryptroot on /bedrock/strata/fedora/tmp type btrfs (rw,relatime,compress-force=zstd:3,ssd,space_cache,subvolid=490,subvol=/@bedrock/tmp)

Note the lack of Arch's /tmp mountpoint too. Arch is my init/hijacked stratum. brl report here from my previous issue.

paradigm commented 4 years ago

I don't see tmpfs in your /etc/fstab in the brl report output. Maybe give that a try?

SeerLite commented 4 years ago

Yeah, thanks, that works perfectly. However, shouldn't systemd mount /tmp as tmpfs automatically? That's how it works on Arch at least

paradigm commented 4 years ago

Ah, I failed to consider that. From your report I just saw /tmp not being tmpfs and no explanation for why you would expect otherwise.

My guess is systemd sees there is already a mount point on /tmp and skips the systemd-specific mount operation, acting in line with /etc/fstab mounting. Bedrock has a work around for this behavior with /etc/fstab mounting but currently has no such work around for systemd-specific mounting.

Ideally Arch's systemd's mounting just works like it does in native Arch. We'll have to look into this at some point. If you don't mind, I'll adjust the issue title to reflect the systemd specific nature here. It may be a bit before I get to it given an adequate work-around is available with /etc/fstab.

SeerLite commented 4 years ago

Ah, I failed to consider that. From your report I just saw /tmp not being tmpfs and no explanation for why you would expect otherwise.

Yeah, sorry I thought it was the same for all distros and had no idea it was systemd-specific. In fact, it was your link to the ArchWiki that made me realize it.

The /etc/fstab workaround works great for me, thank you!