Tmpfs mounted on /srv

Is it normal to have none like tmpfs mounted on /srv? I didn’t think I saw that before. Where does it come from?

none on /srv type tmpfs (rw,relatime,size=51200k)
/dev/mapper/MyVolGroup-ext on /srv type btrfs (rw,noatime,compress=zstd:3,space_cache=v2,subvolid=5,subvol=/)

EDIT: I am on Omnia with HBS 6.2.4, external disk encrypted with luks2 and key file. The disk is mounted at boot with a specific hotplug and the /etc/crypttab file. It is mounted as /srv having configured it in /etc/config/fstab and in /etc/config/storage.

looks like this is the default when storage device is not found.

it’s in /etc/init.d/srv function die()

I guess it’s to avoir wearing out the builtin eMMC, which causes router not to be usable anymore.
Some people here asked for booting from mSata card, I don’t know if it’s possible.

You can boot the router from mSATA, from the network, from HDD, from USB stick. I can confirm. As for none on /srv, I thought it was related to the srv service, I think it happens because the external disk is decrypted after the srv service is started. However, it does not seem to pose any particular problems. However, I would like to find a way to avoid it.

If I stop and then start the srv service I see this:

Scanning for Btrfs filesystems
mount: /srv: mount(2) system call failed: No such file or directory.
Illegal option -n
Usage:
    create_notification -h
    create_notification [-t] [-d base_dir] -s (restart|error|update|news) 'message'
    create_notification [-t] [-d base_dir] -s (restart|error|update|news) 'msg_cs' 'msg_en'

There seems to be something wrong.

EDIT: I solved it by adding a sleep to the script; now the system has time to decrypt the disk and then mount it as /srv:

sleep 10 &&
die() {
    create_notification -n error "$1"
    if ! grep -q '^[^[:blank:]]\+[[:blank:]]\+/srv[[:blank:]]' /proc/mounts && [ -d /srv ]; then
       mount -t tmpfs -o size=50M none /srv
    fi
    exit 1
}

I guess it’s there because multiple packages put volatile data on /srv, so if there’s no external disk, it’s mounted on tmpfs (using “none” is bad because it can confuise users) - to avoid wearing out flash eMMC memory, as I said before.

I guess this happens because at the time /srv is to be mounted your external disk is not available/decrypted yet.
Perhaps you should fill a bugreport so the developers can fix this (or, search in bugreports if they haven’t commented on similar problem).

But in my case I don’t use eMMC completely. Also, I had to change my solution, completely removing the die() section, because putting sleep made the script non-compliant and LuCI would not load the Startup page with all services (it would timeout).

Do you mean, you don’t use the builtin eMMC at all?

I can’t make you report the problem and I’m not going to submit it instead of you. I just think you should do that, e.g. so it doesn’t repeat after next TurrisOS update. It’s up to you, good luck.

I mean I absolutely don’t use the eMMC, I might as well unsolder it. I use an mSATA SSD and an HDD over USB. It’s full of threads here in the forum on the issue and there’s a very good guide on how to do it Boot from SSD - Outdated description? - #11 by drhm
As for the /srv encrypted problem, it is impossible for me to have it, because every other service (Nextcloud, Syncthing, etc.) starts before the disk is mounted and I have problems with practically everything. I will go back to the standard version of /srv and not put any secrets on the disk.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.