tednilsen
Posts: 10
Joined: Fri Dec 06, 2013 10:37 am

[SOLVED] automount usb-stick when plugged using fstab?

Sat Aug 29, 2015 6:44 pm

Ok, I've search the forums but could not find any matching solution.
I'm using Raspian 8 Jessie installed from nightly -noX, so the image is "clean" for desktopX and other bloat.
Now I am trying to allow automounting of the usb-stick (it shows up in /dev/sda" with ext4 format), and it all works great using this line in /etc/fstab:

Code: Select all

/dev/sda  /home/pi/RetroPie/roms  ext4  rw,suid,dev,exec,auto,user,async  0  0
or this:

Code: Select all

/dev/sda  /home/pi/RetroPie/roms  ext4  defaults  0  0
...all good this way, but if I disconnect the USB stick and reboot then it hangs on startup, saying:

Code: Select all

"Starting Static Device Nodes in /dev..."
...So, is there any way to allow automounting this way...using fstab, it only needs to be mounted on boot?
...or what other way do I have to go, I've allready tried autofs and no luck there either :?

SOLVED:
Solved it myself... edit fstab and now I can plug and unplug the usb :mrgreen:

Code: Select all

/dev/sda  /home/pi/RetroPie/roms  ext4  defaults,nofail,noauto  0  0

User avatar
DougieLawson
Posts: 34767
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [SOLVED] automount usb-stick when plugged using fstab?

Sat Aug 29, 2015 9:58 pm

Try using /dev/sda1 (not the raw device /dev/sda).
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

User avatar
rpdom
Posts: 13566
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: [SOLVED] automount usb-stick when plugged using fstab?

Sun Aug 30, 2015 9:38 am

DougieLawson wrote:Try using /dev/sda1 (not the raw device /dev/sda).
Usually that is the case, but some cards/sticks get formatted to use the whole device with no partition table. I don't think it is so common nowadays, but it used to be. Treating the device like a floppy disk instead of a hard disk.

tednilsen
Posts: 10
Joined: Fri Dec 06, 2013 10:37 am

Re: [SOLVED] automount usb-stick when plugged using fstab?

Fri Sep 04, 2015 11:46 am

DougieLawson wrote:Try using /dev/sda1 (not the raw device /dev/sda).
Well, the only device showing up is /dev/sda... have I formated the usb-stick wrong?

Code: Select all

sudo mkfs.ext4 /dev/sda -L ROMS

User avatar
DougieLawson
Posts: 34767
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [SOLVED] automount usb-stick when plugged using fstab?

Fri Sep 04, 2015 3:07 pm

Normally a USB stick would have a partition table with at least one partition defined. Using the raw device is extremely odd.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

bluenote
Posts: 63
Joined: Thu Feb 05, 2015 8:25 am

Re: [SOLVED] automount usb-stick when plugged using fstab?

Fri Sep 04, 2015 6:54 pm

I have one pi that does this automatically. The USB drives show up in /media under usually the UUID.
My production pi does not do this, but this would be a lot handier for one off put-the-key-in-and-go sort of situations.

Anyone happen to know what's different about my two raspbian setups??

Return to “Troubleshooting”