MrCh1ps
Posts: 2
Joined: Tue Aug 08, 2017 1:02 am

External Hard Drive - Sometimes Cannot Access

Sun Jan 21, 2018 2:46 pm

I have a portable hard drive that I have set up as a samba share. I am accessing it through a windows 10 machine. Everything is working as it should except during certain circumstances - let me explain. I have raspbian set up to boot to terminal instead of pixel because I like to be able to go directly to pixel or to my Retropie setup with a few keystrokes. When I first boot I cannot access the portable drive share, it is only when I start pixel that am I able to do this. Interestingly though, I am still able to access the samba share folders that were setup by Retropie for Rom access regardless of this (in terminal or pixel). It is also probably worth mentioning that the drive is automatically mounted in /media/pi/.

Does anybody have any insight into this behavior? Ultimately I would like to be able to access the samba share regardless if pixel is running.

User avatar
thagrol
Posts: 3178
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: External Hard Drive - Sometimes Cannot Access

Sun Jan 21, 2018 4:33 pm

When you say "the drive is automatically mounted in /media/pi/" how exactly is this being done? Via /etc/fstab or via the automounter in the pixel desktop?

If I had to guess, I'd say the latter. In which case when in the initial shell or in retropie it won't have been mounted so can't be shared.

Are the retropie shares on the HDD or the SD card, and were they created with the HDD mounted or not? Again, if I had to guess I'd say that those shares are on the SD card not the HDD so will always be present.

If I'm right, you need to look into mounting your USB HDD via /etc/fstab rather than pixel's tools. "man fstab" and google should get you started.

There are a couple of things to be aware of though:
  1. As it's a USB drive the entry in /dev for it can change across reboots so mount by UUID rather than dev node. You can get the UUID by running

    Code: Select all

     sudo blkid
  2. To avoid boot hangs if the drive isn't present include "nofail" in the mount options for it.
Arguing with strangers on the internet since 1993.

Return to “Raspberry Pi OS”