You are not logged in.

#1 2016-11-09 23:11

nomadxp1
Member
Registered: 2016-10-18
Posts: 21

Automount USB drive on boot

More questions folks..on my Raspberry desktop computer I have a external USB drive that it would be handy to have it mounted at boot time..it shows on the taskbar so it's not a big problem to mount it..but would just be nice..thank you

Offline

#2 2016-11-10 12:55

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Automount USB drive on boot

There are a few different ways to do this, I tend to use a udev rule to select a particular device on boot but it can be a little fiddly getting it set-up, and if you re-format the drive it would need to be reset (the way I do it relies on the UID). But there is an easier way if yo want to always mount external drives when they are plugged in and can be set from the dialog that pops up (unless you checked another option and selected always do this for this type of device)
You can also set the device to auto mount by clicking the device on the taskbar and select properties, then select the mounting tab, then uncheck Use default mount options and you will see an option to mount automatically select that and it should mount when inserted.

Online

#3 2016-11-10 14:04

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,333

Re: Automount USB drive on boot

As a quick thought - do make sure that if you do this you set your BIOS to boot from your hard drive or optical drive first, with USB lower down the list.
Another option would be a script to mount the drive in autostart - that way you could leave the drive in place. It just needs to do something like sudo mount -t vfat /dev/sdb /mnt/thumbdrive - this assumes it is a fat formatted drive and that you have created a directory called thumbdrive in /mnt (sudo mkdir /mnt/thumbdrive)
It should also be possible by editing /etc/fstab. That's the file that records the mount points for your drive/partitions.
You'd need to get the UUID of the drive and then create a mount line in fstab.
I will admit that I am not sure which of these would work on the Pi - I haven't played with one since 2012 - so they're probably a bit different by now smile

Offline

#4 2016-11-10 19:30

nomadxp1
Member
Registered: 2016-10-18
Posts: 21

Re: Automount USB drive on boot

Dai_trying wrote:

There are a few different ways to do this, I tend to use a udev rule to select a particular device on boot but it can be a little fiddly getting it set-up, and if you re-format the drive it would need to be reset (the way I do it relies on the UID). But there is an easier way if yo want to always mount external drives when they are plugged in and can be set from the dialog that pops up (unless you checked another option and selected always do this for this type of device)
You can also set the device to auto mount by clicking the device on the taskbar and select properties, then select the mounting tab, then uncheck Use default mount options and you will see an option to mount automatically select that and it should mount when inserted.

Ok tried this way..no luck..I should have said that this 'external' drive is always plugged in ..my desktop Raspberry pi is all built into an old speaker cabinet with all other connections on the outside of box..SD boot card,.HDM,I 2 other USB, Ethernet, power and on/off switch..
the 'external' drive is inside the cabinet and always connected..it does know it is there but just doesn't mount it..which as said before it is not a problem..I just would like everything working correctly on the Q4os Berry pi..

Offline

#5 2016-11-10 20:45

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Automount USB drive on boot

In that case I would (and do) use fstab for that and it will be mounted on each boot. A good explanation (if you need it) of fstab can be found HERE. But use UUID for location of device and not /dev/sdb (or similar) this will ensure only the correct device is mounted in case inserting another usb device changes the hierarchy.

Last edited by Dai_trying (2016-11-10 20:49)

Online

#6 2016-11-11 00:15

nomadxp1
Member
Registered: 2016-10-18
Posts: 21

Re: Automount USB drive on boot

Ok..again you are a big help on this.. used gparted to correctly find my device info..then edited the fstab file.. works great..Thanks again!

Offline

#7 2016-11-11 11:08

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Automount USB drive on boot

You're welcome smile
I usually use the command sudo blkid from a terminal to get UUID's (quicker and easier), but you got it solved and that's the main thing.

Online

#8 2016-11-11 18:28

nomadxp1
Member
Registered: 2016-10-18
Posts: 21

Re: Automount USB drive on boot

Ok thanks again...another command to remember smile

Offline

#9 2016-11-12 07:51

zebedeeboss
Member
Registered: 2016-11-12
Posts: 7

Re: Automount USB drive on boot

Hi

or if you struggle with command line and editing files you can use Gnome-Disk-Utility

I find it extremely useful

Regards Zeb...


Be Kind Whenever Possible...   It is Always Possible - Dalai Lama   Linux User #565092   x64 Desktop - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz - 32Gb RAM - NVIDIA GTX 1060 6Gb - 43"  4k  3840x2160   x64 Laptop - Intel(R) Dual Core i5-4200U - 8Gb RAM - Intel Integrated Graphics - 15.6"  HD 1920x1080

Offline

Board footer

Powered by FluxBB