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?
Asked
Active
Viewed 2,506 times
1 Answers
2
Try 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-mountPut this script under
/etc/init.d.- Make it executable by running
sudo chmod -x /etc/init.d/script-name. - Run
update-rc.d script-name defaults.
Hopefully, this will unmount your drive and then remount it under the folder you want.
muru
- 207,228
TheWanderer
- 19,525
- 12
- 52
- 65