Another question about mounting usb keys?!

I’m sorry to ask another question about mounting USB keys but I would be grateful for your help!

I am running the latest OSMC on a Pi 1. I recently switched from LibreELEC running on the same Pi. Under LibreELEC there was never any problem with my two usb keys auto mounting. Since I switched to OSMC they usually don’t except about two times.

I have a decent power supply. Here it is on eBay.

Initially the problem was solved by adding this line: max_usb_current=1
To /boot/config.txt
It worked once after that but then after a subsequent reboot the usb keys didn’t automount anymore. I turned off the Pi last night after setting up autofs to automount a samba share. And today the usb keys did automount but then after another reboot this evening the usb keys didn’t automount.

The autofs stuff I did had nothing to do with the usb keys only a Samba share.

I don’t have any line in my /etc/fstab.

But maybe I should just use /etc/fstab? But if I do it that way I read on the osmc wiki that if accessing the content of a usb key from a Windows Samba share it is preferable to work from an auto created samba share otherwise you might get permission issues: creating files as root vs osmc user which are then not accessible to anyone other than root.

Is there a way to debug why the usb keys mostly never mount for me? I don’t think it is the power supply but not sure. I never get any warnings on screen to suggest there is not enough power to the Pi and these keys were auto-mounting fine on LibreELEC a few days ago.

Any help much appreciated!

Flex

The disk should automatically be mounted under /media.

Please post some logs.

Cheers Sam,

Here is a log I took right after rebooting the Pi/OSMC.

Here is the df -h and blkid command output

There are two usb keys at /dev/sda1 and /dev/sdb1… one is fat32 (16GB) and one is ext4 (2TB). Neither have an external power source. I can mount them manually and they can be accessed from osmc. On the two times they auto-mounted they were available in /media

What mechanism does osmc use to automount usb keys? Is it udisks-glue?

I would prefer to get auto-mounting working as I’ve read it reduces the chance of corrupting usb keys by pulling them out of the Pi without first manually un-mounting. Maybe I should disable whatever way osmc is meant to do it and try autofs instead? Or how else can I debug this?

Cheers,

Flex

Here is the dmesg output

Around about the time the usb keys are recognised there are warnings about: Default I/O scheduler not found. Using noop.

Cheers,

Flex

Just reporting back some other things I have tried…

With OSMC running and both usb keys plugged in but not mounted (confirmed with # blkid -o list ) I pulled out the 16GB Fat32 formatted key and plugged it back in again. This time it did auto-mount.

Then I pulled out the 2TB Ext4 key and when I plugged it in again the Pi rebooted by itself. When it came back on neither key were mounted.

Lastly, I took the 2TB key out and this time rebooted the Pi/OMSC with just the 16GB key in it but once again it did not auto-mount.

I’m not sure why it sometimes works and why it doesn’t? And why does the Pi reboot when I plug out/in the 2TB key but not when I plug out/in the 16GB key?

Not sure if this is relevant but I was not able to format the 2TB key as ext4 with Journaling enabled. When I did enable journaling, restarting the Pi with that USB key in it or taking the key out and putting it back or even just unmounting and mounting it again caused a segmentation fault and the filesystem to become corrupted again.

But when the 16GB key is the only key in the Pi it also doesn’t auto-mount on reboot so… ?!

Cheers,

Flex

Is this an early Pi 1?
This is probably relevant: Raspberry Pi Reboots on inserting a USB device. - Raspberry Pi Forums

Here is a log where the two keys DID auto-mount after a reboot…

Comparing those two logs I reported back here… when the keys don’t mount this message appears in the System Journal:

udisks-glue[204]: Device /dev/sdb1 did not match any rules.

That line comes from /etc/udisks-glue.conf

>     default {
>     	post_insertion_command = 'echo "Device %device_file did not match any rules."; ls -al "%device_file"; echo "blkid: $(/sbin/blkid %device_file)"; /usr/bin/udisks --show-info %device_file'
>     }

So it’s like sometimes (most of the time) the USB keys don’t find a “match” in udisks-glue.conf

I suppose the fat32 (16GB) key should match with “match vfat-partitions” and the ext4 (2TB) key should match with “match other-partitions”?

Cheers,

Flex

Hi Sam,

Yes it’s a Raspberry Pi 1 Model B, circa 2014. I paid for the MPG2 and WVC1 codecs back then and installed them on that Pi which is why I set OSMC up on it. I guess I need to just get a Pi4.

But I don’t think this Pi not being “hot pluggable” is the reason the usb keys are not mounting here do you think?

Flex

Check the partition tables with parted

A powered USB hub could be worth a try if one was available.

1 Like

Have you tried with only one USB device attached?

– ActionA
I don’t have a powered USB Hub. I didn’t need one when I was using this same key (and Pi and 5V/3A power supply) with LibreELEC. It auto-mounted fine with udevil on that.

@dillthedog
Yes. I tried booting the Pi/OSMC this morning with just the 2TB key attached. And it did automount. But later today I did a reboot and then the same key did not automount.

@sam_nazarko
What should I look for with parted? Here is a print of the device: /dev/sda1
image
I’m very confused about it now. I had to install Parted from the respository. After switching to sudo su and playing with Parted a bit I ran the blkid -o list command again and bizarrely that 2TB key IS now mounted??

I don’t understand what I’m seeing. I think there are inconsistent results here. Maybe it has to do with not enough power going to the drive. But why was that not a problem under LibreELEC? Does OSMC make more power demands on the whole system it is running on compared with LibreELEC maybe?

Cheers,

Flex

OSMC uses more power for performance reasons (CPU governor related).
A 3A power supply (if it actually supplied 3A) would handle this sufficiently.

  • When did you buy this PSU? They degrade over time
  • You could measure voltage over a voltmeter. You can measure between TP1 and TP2.

Sam

I bought that power supply just four weeks ago. I don’t have a voltmeter to measure voltage.

How can I disable the automount feature in osmc? Do I change something in /etc/udisks-glue.conf ?
Or maybe just rename it?

I’d like to disable it so I can try some other automount approaches like /etc/fstab or udevil or usb-automount. Lots of fun…

Flex

As soon as you define the mount in fstab it will be excluded from automount

Ok, but what if I don’t want to use /etc/fstab but maybe udevil instead? I don’t want two automount solutions conflicting. How do I disable the auto-mount feature in osmc?

Thanks.

Two seconds search :wink:

1 Like

Thanks,

@sam_nazarko

Regarding your post here.

Did you ever test if:

sudo systemctl disable udisks-glue
sudo systemctl disable udisks

really does disable the automount feature in osmc? I ask because I don’t really know what I’m doing and don’t want to break something and you guys designed this stuff.

Cheers,

Flex

Do you really need to bother @sam_nazarko with this kind of questions?
If you have a problem just execute

sudo systemctl enable udisks-glue
sudo systemctl enable udisks

And you are back to the previous behavior. If something goes wrong it’s a quick reinstall and your are back online.

2 Likes

@fzinken
You didn’t have to be so rude to me. I had a productive conversation going with @sam_nazarko and I simply wanted to get to the bottom of my problem. Then you patronizingly give me these technical instructions as though they should be so obvious to me.

Flex