Automount Pre-existing Disk Slices

Nibbles for us neophytes:
I utilize pre-existent, unencrypted ext4 logical drives in an extended partition of the system resident HD that have evolved from a lengthy legacy of linux distros. I want specific slices to auto-mount in selected VMs which I’ve set to autostart on Qubes boot.
The doot:

  • Set selected VM to autostart: In VM’s Settings, under “Basic” tab: check Start qube automatically on boot box.
    (Don’t know if a qube restart is necessary at this point.)

  • Determine the dom0 device name from Qubes Devices widget, or in target VM terminal, enter
    sudo sfdisk -l
    (e.g. “sda [+ number]”)

  • Open a dom0 terminal and enter:
    qvm-block attach --persistent <VM> dom0:sda[*]

  • In target VM terminal, confirm the designator for that slice:
    lsblk
    (usu. “/dev/xvd[*]”)

  • If not already done, create the mounting directory:
    mkdir <dir>

  • Edit as root the target VM’s /rw/config/rc.local file and enter:
    mount /dev/xvd[*] /home/user/<dir>

  • Restart the qube.

I’ll amend this post for errors & omissions, should the need arise.

2 Likes

I want to automount a Veracrypt drive using:

veracrypt --text --mount vctest.vc /media/veracrypt1 --password MySuperPassword --pim 0

but where do I store this command iso it run after boot-up?

General Fedora forum posts referred to rc.local but this does not seem to exist in my Fedora Qube.