I have made a script that loads a VHD file, fixes it with ntfsfix
so it can be mount rw and then mounts it. This script works absolute wonders when run via the terminal using sudo
, but when running it via crontab
, ~/.profile
or via startup applications, it does not work. The script in question is
#!/bin/sh
rmmod nbd
modprobe nbd max_part=16
qemu-nbd -c /dev/nbd0 '/media/tygo/1.8TB Drive/MEGA.vhdx'
ntfsfix /dev/nbd0p2
mount -o rw /dev/nbd0p2 /home/tygo/MEGA