There is a combined method with systemd, rc.local and bind-dirs that works in app qubes and disposables and can be done per qube not per template.
If partition is not attached to qube it does nothing and there is no errors and qube starts/works as if nothing happened.
Of course you cannot persistently mount to numbered disposable but it can be done to disposable template or named disposable.
So first, you need to attach persistently block device to said qube.
Open dom0 terminal.
First you need to check list of available block devices:
qvm-block
for my testing it is sys-usb:sda3 partition attached to dvm-untrusted disposable template.
Persistent attachment (qube must not be running):
qvm-block attach --persistent dvm-untrusted sys-usb:sda3
dom0 terminal might be closed - it won’t be needed anymore
Now run said qube terminal (dvm-untrusted here), make mountpoint and bind-dir for systemd:
mkdir -p /home/user/.torrent
sudo mkdir -p /rw/bind-dirs/etc/systemd/system
Check UUID of partition to mount
systemd-mount --list
Now make home-user-.torrent.mount:
sudo geany /rw/bind-dirs/etc/systemd/system/home-user-.torrent.mount
put inside (UUID “F8EF-DD5A” is from systemd-mount --list)
[Unit]
Description=Mount block device to /home/user/.torrent
After=local-fs.target
[Mount]
What=/dev/disk/by-uuid/F8EF-DD5A
Where=/home/user/.torrent
Type=exfat
Options=defaults,uid=1000,gid=1000,sync,iocharset=utf8,errors=remount-ro,nodev,nosuid
[Install]
WantedBy=multi-user.target
Now, most important thing. Selinux will block this file from systemd, so it need to be added to systemd selinux context
sudo restorecon /rw/bind-dirs/etc/systemd/system/home-user-.torrent.mount
–
Now bind-dirs need to be configured.
sudo mkdir -p /rw/config/qubes-bind-dirs.d
make bind-dirs config
sudo geany /rw/config/qubes-bind-dirs.d/50-user.conf
and put inside
binds+=( '/etc/systemd/system/home-user-.torrent.mount' )
Then you either edit /rw/config/rc.local or make /rw/config/rc.local.d/persistent.rc executable file (I’ll show how to make this file - inside you put same command):
sudo mkdir -p /rw/config/rc.local.d
sudo geany /rw/config/rc.local.d/persistent.rc
inside:
systemctl start home-user-.torrent.mount
and make it executable
sudo chmod 0744 /rw/config/rc.local.d/persistent.rc
–
Now you might restart qube and have persistent attach auto mount of particular partition into qube.