I have an external USB drive which is always plugged in. I have modified fstab and created a folder in media so that the drive is mounted at media/drive_name. However, is automount is enabled, every time I restart the system the drive get remounted in media/user_name/drive name. I would like to keep automount on for other devices, but for this specific one have my own mount point. Is there any way to do this?
Make your script: make a new text document and put this in:
#!/bin/sh mkdir -p /path/to/custom-mount sudo umount /dev/sdaX ((This is the drive you want to mount in the custom location)) sudo mount -t filesystem-type -o rw /dev/sdaX /path/to/custom-mount
Put this script under
- Make it executable by running
sudo chmod -x /etc/init.d/script-name.
update-rc.d script-name defaults.
Hopefully, this will unmount your drive and then remount it under the folder you want.