1

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?

1 Answers1

2

Try this:

  1. 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  
    
  2. Put this script under /etc/init.d.

  3. Make it executable by running sudo chmod -x /etc/init.d/script-name.
  4. 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