Topic: Hotkey needed to mount external USB drive

Hi all,

I was wondering if there's a way to make a hotkey that will allow me to mount my 320 gig external USB drive without having to open up the window manger and clicking on the different partitions in order to mount them.

I'm not looking to have it auto mount as sometimes there is no need for this drive to be mounted (although it remains plugged in).

Any help would be appreciated. smile

-NT

Currently running "Statler" - Openbox edition.

Re: Hotkey needed to mount external USB drive

Create a shortcut that runs "sudo mount /dev/sda1 /media/somefolder"

Just change /dev/sda1 to the correct device/partition you want to mount and change /media/somefolder to the folder you want the drive mounted at. Also make sure you create this folder before trying to mount your disk there. And lastly, you will need to edit your sudoers file so you can run /bin/mount without a password.

username ALL=(ALL) NOPASSWD: /bin/mount
Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Hotkey needed to mount external USB drive

anonymous wrote:

Create a shortcut that runs "sudo mount /dev/sda1 /media/somefolder"

Just change /dev/sda1 to the correct device/partition you want to mount and change /media/somefolder to the folder you want the drive mounted at. Also make sure you create this folder before trying to mount your disk there. And lastly, you will need to edit your sudoers file so you can run /bin/mount without a password.

username ALL=(ALL) NOPASSWD: /bin/mount

If I'm using Openbox, how to I bind keys to this short cut? I guess the shortcut in need to be in my home folder somewhere?

Thanks smile

Currently running "Statler" - Openbox edition.

Re: Hotkey needed to mount external USB drive

Take a look at ~/.config/openbox/rc.xml, and the shortcut can be wherever you want, as long as you have permission to execute it (but yes, the home folder works fine).

Re: Hotkey needed to mount external USB drive

That's a good place, thanks for the tip.

I'm also going to take anonymous's idea of changing the sudoer permissions and apply it to Synaptic and to  opening files and folders as root, so I can avoid having to keep typing in my password.

EDIT: LOL... I just locked myself out of sudo while trying this. yikes

Last edited by nolatux (2010-09-24 03:18:06)

Currently running "Statler" - Openbox edition.