robmcc83
Posts: 4
Joined: Tue Nov 21, 2017 9:08 pm

External hard drive unmounts then remounts.

Tue Nov 21, 2017 9:41 pm

Hi every one.
This is the first time I've had to come to this forum and ask for help lol.
Usually managed to find the help I need with all my other projects but this one has got me.
I am using a pi3 as a plex server since buying a new smart tv and being able to use plex on it I thought it would be a good idea.
Now I have got everything working but seem to have problems with the external hdd unmounting then remounting.
I have only the the hard drive plugged into the pi and the hard drive is a 3.5" in a external caddy which is powered by it's own source.
I use the official 5.1v 2.5a plug for the pi.
Now here's how the problem goes.
Can watch a film from the pi to my tv seems ok, I go onto the computer to transfer some over through my network and that's when it unmount.
I have edited fstab to automont in /mnt/library but when it remounts it mounts to media/pi/[label of drive] so I have to reboot the pi for it to mount back where I want it.
This is intermittent I ripped aload of the kids Disney dvds to my computer and then started copying them over network via samba first time happened around 40 seconds into it then drive unmounted.
So rebooted tried again. I managed to copy of 4 movies no problems 5th one drive uncounted again.
So of I went to use winscp and had the same problems.
I'm at a loss as most posts point to not enough power but my hdd has it's own power source
Thanks

epoch1970
Posts: 3568
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: External hard drive unmounts then remounts.

Wed Nov 22, 2017 2:50 pm

The drive may unmount and remount for various reasons.
- power starvation is the most common but in your case, it doesn't seem to apply
- data link reset is another possible cause. It could apply to you. If a read or write fails, due to a defect in the disk (or the controller) the system will retry a few times and if the error remains it resets the data (SCSI/SATA) link. At that moment the USB link is reset and the mount becomes stale. Then the device comes back on line and a "new" USB device is discovered (and mounted elsewhere.)

If you experience link resets when reading or writing, you should see traces in /var/log/syslog. In general when you get link resets and all cables are properly connected, it means your HDD is dying of old age. So you may want to check how your HDD behaves when you connect it to another computer and write heavily to it.

Then there is a possibility the USB-SATA bridge doesn't work as expected under linux, or the driver requires some options. I think this is harder to debug, so it's better to check that the HDD is ok first.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

sora03
Posts: 193
Joined: Mon Dec 29, 2014 4:11 pm
Contact: Website

Re: External hard drive unmounts then remounts.

Thu Nov 23, 2017 12:49 pm

try to check the USB cable to HDD and Pi. set the Pi configuration to max_usb_current. The 3.5" HDD is externally powered so this should not be a problem. Also check the S.M.A.R.T status of the disk
FLOSS enthusiast, Debian user (linux-libre)

epoch1970
Posts: 3568
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: External hard drive unmounts then remounts.

Thu Nov 23, 2017 2:46 pm

AFAIK specifying max_usb_current changes nothing on Pi 3
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

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

Re: External hard drive unmounts then remounts.

Thu Nov 23, 2017 3:44 pm

epoch1970 wrote:
Thu Nov 23, 2017 2:46 pm
AFAIK specifying max_usb_current changes nothing on Pi 3
After a recent update it does nothing on any Pi B+, 2B or 3B. They default to 1.2A now.

robmcc83
Posts: 4
Joined: Tue Nov 21, 2017 9:08 pm

Re: External hard drive unmounts then remounts.

Thu Nov 23, 2017 11:07 pm

Ok so after trying to find a solution to this all day I have the most bizarre outcome and I don't even know if it's possible.
I removed the hard drive from the pi and plugged it into my pc. I downloaded seatools for my drive ran all tests and everything passed.
I then began to copy all the files directly to the drive from the pc. No problems what's so ever.
So I plugged it back into my pi with a different usb cable.
I then started to transfer one of our wedding slideshow videos approx 1gb in size and the drive unmouted at 4% transferred through samba grrrrrrr.
Just out of curiosity I plugged in my powered 4 port usb hub which has it's own power supply, plugged the hard drive into that and powered it on. Sudo reboot and it was mounted back where it should be.
I then began transferring the same file over and it worked fine.
So I was like that's odd, and tried copying more stuff over to it waiting for it to happen but to my surprise I've managed to copy over 24.8gb today with out it umounting.
So if that has fixed the problem I have questions.
Why would it perform how it should do plugged into a powered hub when the hard drive has it's own power source which I know works as i copied alot of stuff over directly on pc.
Could this still have anything to do the power source for the pi.
I've never had any coloured squares in the corner.
Thanks

User avatar
davidcoton
Posts: 4034
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: External hard drive unmounts then remounts.

Thu Nov 23, 2017 11:12 pm

It possibly indicates a problem with the drive's power supply? Anyway, it looks like you have a working (if not ideal) solution.

BTW, the coloured square has been replaced by a lightening bolt symbol.
Signature retired

Aydan
Posts: 689
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: External hard drive unmounts then remounts.

Fri Nov 24, 2017 8:13 am

SInce it's a 3.5" drive, it needs 12V and 5V to operate.
Maybe the 5V regulator in the enclosure is marginal, and when transferring large amounts of data it drops the voltage.
Another possibility would be that the enclosure doesn't have it's own 5V regulator and uses the 5V from the USB, which of course would be problematic if the USB supply drops out. I suppose your PC has a more stable USB power supply than your Pi, and the powered USB hub is more stable than the Pi as well.

Regards
Aydan

robmcc83
Posts: 4
Joined: Tue Nov 21, 2017 9:08 pm

Re: External hard drive unmounts then remounts.

Fri Nov 24, 2017 11:14 am

Well come to think of it I've had problems in the past with this pi3.
When I first purchased it I used it for retropie.
I got 2 2x usb to PlayStation so that I could plug in 4 PlayStation controllers.
Plugging them directly into the pi only 2 controllers would work.
This is what made me buy the Belkin 4 port powered hub that I have upon plugging the usb to PlayStation adapter into the hub all 4 controllers worked.
Surely though the pi should have enough power to use 4 PlayStation controllers without the need of a hub.
Have I maybe had a faulty pi or maybe power source from the start because I can't really plug anything more than a keyboard or mouse into it without a hub
Cheers

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

Re: External hard drive unmounts then remounts.

Fri Nov 24, 2017 12:25 pm

The RPi has 1200mA to spread across 4 USB 2.0 interfaces. If you draw 500mA on four devices you may not have enough left for HDMI, WiFi, BT and the SoC on your Raspberry from a 2500mA supply (watch for the on-display under power lightning bolt). The power budget runs close to overdrawn.

The USB 2.0 spec is 100mA for low power devices, 500mA for high power devices (the device is supposed to report it's requirement as part of the data exchanged during startup). Some don't do that. I've had USB sticks that crash a RPi when you hotplug them. I've got a 32GB USB stick that runs very hot in my laptop, I won't dare to insert that in a running Raspberry.

USB 3.0 spec is 900mA. I don't know how a USB 3.0 device works with a USB 2.0 host for power usage. That must be documented somewhere.

So the recommendation to run your high power USB devices in a powered USB hub is very sensible.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Troubleshooting”