Automount external HDD

Hi. I have been using OSMC for a while, and it works very well. I use a Raspberry Pi 3 model B and have been using an external Samsung M2 portable 320GB HDD. This has always been automounted under /media. The harddrive use FAT32, since I earlier used it with a DVD player that only support FAT32.

But now I need some more storage, and I got a Western Digital Elements Portable 1TB drive. But this drive does only sometimes automount when I boot OSMC. The drive is using GPT and NTFS as it was delivered. I can mount it manually, and it then seems to be working fine (but I haven’t tested it too much).

I have searched both this support forum, and other placed to find out what the problem could be. One issue I have came across is that there could be a power issue. But I’m using a genuine Raspberry Pi 2.5A power supply, and as far as I understand the Raspberry Pi 3 should be able to deliver 1.2A on the USB port. And I found somewhere that the WD drive should need the standard 500mA. So it should be okay, or could this be an issue?

Note, I have only the WD drive connected, and the old Samsung drive has been disconnected. I have also run a SMART test on the drive, and everything seems fine.

It’s no problem to mount the drive manually, but I wonder what cause this issue. I also wonder if it will be safe to use the drive. I need the drive to be stable, and is a bit worried about what could happen if there is something wrong, like a power issue. Will data corruptions could happen?

Have anyone used a WD Elements Portable 1TB drive with the Raspberry Pi3 and found it to work well?

I know a suggestion can be to use a USB powered hub, but I was hoping to avoid that since the PSU I’m using should be able to handle it, at least theoretically. And why is it working with the old Samsung drive? Normally newer drives uses less power. So I don’t think the power is the issue here.

Anyone have any idea about this?

Most certainly a power issue. You should power your drive seperately or use powered hub.

Thank you for your reply.

But are you sure about this? I don’t quite understand how it could be a power issue when the USB port can deliver 1200mA and the drive is specified to use 500mA.

Could it be a bug or something about the automount feature? Since it seems to be working when mounted manually.

Did you test the output from the pi to confirm the amount of power being supplied?

No, I’m not sure how to test this. But according to the following forum post it should be able to deliver 1200mA. The harddrive is also the only USB device connected.

https://www.raspberrypi.org/forums/viewtopic.php?t=166302

You should test with a hub to rule out power being an issue.

If you are using the official PSU on a Pi 3 you won’t get anything near 1.2A on USB.

You’ll need to use a powered hub like the one on the store

I’m running a 2tb WD my passport from usb port just fine on pi 3b+ using official psu.

So may be software issue on your end or faulty power supply

My drive is formatted exfat

Hi, and thank you all for your response.

I have done some more testing. If I boot OSMC first, and then connect the drive, it mounts just fine every time (tested 5 times). But I also tested with a powered hub. Actually a USB hub integrated in a monitor, since that was what I had available. It’s a USB 2.0 capable of 500mA output on each port. Then it actually works fine, and the WD drive mounts just fine at boot.

the_bo, I think the power supply is okay, since it has worked very well with the old Samsung drive, and never had any issues which indicate a faulty power supply. I searched for more information about using a harddrive on the Raspberry Pi, and came across this post:

https://raspberrypi.stackexchange.com/questions/24859/can-the-raspberry-pi-power-this-2-5-drive-without-a-usb-hub

This is about an older Raspberry Pi, but there is some interesting information there:

USB 3.0 provides lots more power, but since it falls back it must conform to the USB 2.0 500 mA maximum current. The hard drive itself might use more power, but the built-in electronics will detect when to use staggered spin up (takes longer to spin up basically)

Could it be that the WD drive use more time to spin up, and therefore the automount at startup times out or something? And for some reason, it spin up faster when connected using the hub?

But as I wrote in the first post, everything seems to be working fine if I mount manually. But what could happen if the drive for some reason should get to little power. Could it result in dataloss / corrupted data, or is the harddrive / filesystem smart enough to handle it, and in worst case give an error message?

After searching the net about this it seems there are many different opinions about this. Some says it is no problem to use one harddrive without a hub, while others says you absolutely need a hub to use a harddrive. :slight_smile:

And last, I looked at this page, and the post from HawaiianPi:

https://www.raspberrypi.org/forums/viewtopic.php?t=205579

And here is also some interesting information:

A Raspberry Pi3B can supply up to 1.2A from its USB ports (total), so it should be able to power just about any portable USB hard drive as long as your other USB devices aren’t too power hungry. I have used a variety portable USB hard drives on my Pi3 and they’ve all worked.

and also

You can’t pull more than 2.6A total through a Pi3, or more than 1.2A total from all the USB ports combined, so a 2.5A supply is about the max you can realistically use as a PSU powering the Pi and its USB peripherals. A higher current PSU will work, but it won’t give you any more power you can actually use.

And my PSU is the genuine and recommended 2.5A PSU. So Sam, I’m not sure what you mean but if I can’t get 1.2A with this PSU, how should I then get it? :slight_smile:

Please post logs.

Hi. Which logs do you need? Tried the default grab-logs command, but it seems to include information I don’t want to share online.

But I had a look at the log, and it seems to detect the harddrive as it should, but I see the following in the log:

udisks-glue[338]: Device /dev/sda1 did not match any rules

When I searched for this error, I came across the following old post:

https://discourse.osmc.tv/t/no-file-found-on-media-after-power-on-ok-after-reboot/7523/23

But in this case, it works after a reboot. But maybe the harddrive in this case doesn’t spin down when restart, as mine does.

At the very least we’d want to see the system journal, though full logs will give us the best overall picture of your system. If you want to remove passwords, you can always save the log to /boot/uploadlog.txt using grab-logs -A -C, edit the file and then upload it with paste-log /boot/uploadlog.txt.

udisks-glue[338]: Device /dev/sda1 did not match any rules

Once again, as the post you link to says, this suggests that the disk probably isn’t ready to identify itself to the system, which, in this case, might be due to a slow start-up.

One possible workaround might be to add an entry to /etc/fstab, along the lines of:

 UUID=XXXX-XXXX-XXXX /mnt/<mount> ntfs-3g noauto,x-systemd.automount   0  0

(You’ll need to run blkid to get the UUID of the device and choose a name for <mount>.)

The fstab entry should not try to mount the disk automatically at boot time and should wait until something tries to read from it. Hopefully, by then it will be ready.

Hi. I tried the suggested workaround, and it works, but there is an issue. If I access the disk using SSH it mounts as it should. But when using Kodi, and select Video and then Files, the mounted drives should automatically been shown here. But it doesn’t, unless I trigger the mount by SSH first. Then it shows.

But I found another way. By using the following fstab entry it mounts fine during boot every time:

UUID=XXXX-XXXX-XXXX /mnt/Elements ntfs-3g nofail,x-systemd.device-timeout=5,noatime 0 0

I guess the conclusion here is that the drive take to long time to spin up to be detected by the automount feature. But when using the USB hub, the drive spins up faster, and therefore it works fine. I don’t know how the automount function work, but maybe it’s possible to put it later in the boot sequence or increase the timeout to detect the drive. I guess I’m not the only one who will get this issue.

Well, anyway I’m happy now as it seems to be working fine now when adding it manually to the fstab file. :slight_smile:

1 Like