Help With Bash Script To Manage AppVm Drive Mounts

I’ve been hacking at this a few days now, and just can’t get it to work.

I need a script that:

  1. Starts an appVm.
  2. Attaches the partition of an external hard drive to the appVm.
  3. And then mounts the partition in the appVm.

…Should be simple, but what I can’t get to work is the mount part.

When I manually mount the drive in the appVm using Nautilus file explorer, it mounts.

When I try to mount it using a script from Dom0, it doesn’t throw an error, yet, the script still can’t access files on the USB partition.

Anyone know what’s wrong with this mount code?

qvm-run appVm sudo mount /dev/mapper/sda2 /media/user/usb2
# alternate versions tried.
qvm-run appVm sudo mount -a #(then placing an entry in fstab for the drive in question).
qvm-run appVm sudo mount -U 53G1-3223 # (UUID of device)

In each case, I don’t get any errors in terminal. But when the script tries to access files on the USB it can’t access them.

What might I be doing wrong with the mount code?

qvm-run --user=root appVm ‘mount /dev/mapper/sda2 /media/user/usb2’
qvm-run --user=root appVm ‘mount -a’
qvm-run --user=root appVm ‘mount -U 53G1-3223’

Add --pass-io if you want to see the results.


1 Like