Closed KKSzymanowski closed 5 years ago
First of all, I see sda2 it is hfsplus. Just to confirm, what do you have for FILESYSTEMS in /etc/usbmount/usbmount.conf?
I have the following, which is the default, plus fuseblk and exfat (unrelated to hfsplus):
$ grep -v '#' /etc/usbmount/usbmount.conf | grep FILESYSTEMS
FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus fuseblk exfat"
Curious to know what the partition looks like for the device? You mention /dev/sda2, but what about /dev/sda1 and in general what is the partition scheme?
For example usbmount is working fine on my Raspian (latest release / latest updates), and this is what mine looks like for a device just inserted and showing as /dev/sdb. Both partitions were mounted just fine by usbmount.
sudo fdisk -l /dev/sdb
Disk /dev/sdb: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x36f1fe10
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 98045 89854 43.9M c W95 FAT32 (LBA)
/dev/sdb2 98304 62521343 62423040 29.8G 83 Linux
And:
$ mount | grep /dev/sdb
/dev/sdb1 on /media/usb0 type vfat (rw,nodev,noexec,noatime,nodiratime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb2 on /media/usb1 type ext4 (rw,nodev,noexec,noatime,nodiratime,data=ordered)
And:
$ dmesg | egrep 'usb|scsi|sd[a-z]'
...
[767744.581719] usb 1-1.3: USB disconnect, device number 10
[777356.655879] usb 1-1.3: new high-speed USB device number 11 using dwc_otg
[777356.790226] usb 1-1.3: New USB device found, idVendor=05e3, idProduct=0749
[777356.790241] usb 1-1.3: New USB device strings: Mfr=3, Product=4, SerialNumber=5
[777356.790250] usb 1-1.3: Product: USB3.0 Card Reader
[777356.790258] usb 1-1.3: Manufacturer: Generic
[777356.790266] usb 1-1.3: SerialNumber: 000000001536
[777356.791261] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[777356.792245] scsi host0: usb-storage 1-1.3:1.0
[777357.857569] scsi 0:0:0:0: Direct-Access Generic MassStorageClass 1536 PQ: 0 ANSI: 6
[777357.858604] sd 0:0:0:0: Attached scsi generic sg0 type 0
[777358.062520] scsi 0:0:0:1: Direct-Access Generic MassStorageClass 1536 PQ: 0 ANSI: 6
[777358.064032] sd 0:0:0:1: Attached scsi generic sg1 type 0
[777358.351494] sd 0:0:0:1: [sdb] 62521344 512-byte logical blocks: (32.0 GB/29.8 GiB)
[777358.555055] sd 0:0:0:1: [sdb] Write Protect is off
[777358.555070] sd 0:0:0:1: [sdb] Mode Sense: 21 00 00 00
[777358.557218] sd 0:0:0:1: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[777358.558800] sd 0:0:0:0: [sda] Attached SCSI removable disk
[777358.563081] sdb: sdb1 sdb2
[777358.567741] sd 0:0:0:1: [sdb] Attached SCSI removable disk
[777364.960596] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
Beyond that, could it be a permissions issue?
Here's what I have:
$ id -nG | fmt -1 | grep plugdev
plugdev
And:
$ cat /etc/udev/rules.d/99-usb.rules
SUBSYSTEM=="usb", GROUP="plugdev", MODE="0660"
FWIW, I just inserted a bootable MacOS X flash drive, and this is what I see:
$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 29 GiB, 31104958464 bytes, 60751872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 57142C92-E0D5-4F86-9DC6-83B606E14E7E
Device Start End Sectors Size Type
/dev/sdc1 40 409639 409600 200M EFI System
/dev/sdc2 409640 60489687 60080048 28.7G Apple HFS/HFS+
And:
$ mount | grep /dev/sdc
/dev/sdc2 on /media/usb2 type hfsplus (ro,nodev,noexec,noatime,nodiratime,umask=22,uid=0,gid=0,nls=utf8)
And:
$ dmesg | egrep 'usb|scsi|sd[a-z]'
...
[778552.687382] usb 1-1.2: new high-speed USB device number 12 using dwc_otg
[778552.818283] usb 1-1.2: New USB device found, idVendor=0781, idProduct=5581
[778552.818298] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[778552.818307] usb 1-1.2: Product: Ultra
[778552.818316] usb 1-1.2: Manufacturer: SanDisk
[778552.818324] usb 1-1.2: SerialNumber: 4C530001061022116321
[778552.822261] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[778552.823362] scsi host1: usb-storage 1-1.2:1.0
[778553.868118] scsi 1:0:0:0: Direct-Access SanDisk Ultra 1.00 PQ: 0 ANSI: 6
[778553.869206] sd 1:0:0:0: Attached scsi generic sg2 type 0
[778553.869210] sd 1:0:0:0: [sdc] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
[778553.870128] sd 1:0:0:0: [sdc] Write Protect is off
[778553.870143] sd 1:0:0:0: [sdc] Mode Sense: 43 00 00 00
[778553.870610] sd 1:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[778553.913928] sdc: sdc1 sdc2
[778553.916153] sd 1:0:0:0: [sdc] Attached SCSI removable disk
Above is expected behavior, since sdc1 is EFI and I do not have any supported EFI filesystem extensions installed.
EDIT: This refers to your second comment because I haven't seen the first one right away. Take a look at my second comment first.
If I run your commands(replacing sdc
with sda
) I get the following output:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 29 GiB, 31104958464 bytes, 60751872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0b5c2d30
Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 60751871 60743680 29G c W95 FAT32 (LBA)
mount | grep /dev/sda
prints nothing
$ dmesg | egrep 'usb|scsi|sd[a-z]'
[56363.724930] usb 1-1.1.3: new high-speed USB device number 11 using dwc_otg
[56363.855859] usb 1-1.1.3: New USB device found, idVendor=14cd, idProduct=1212, bcdDevice= 1.00
[56363.855873] usb 1-1.1.3: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[56363.855883] usb 1-1.1.3: Product: Mass Storage Device
[56363.855892] usb 1-1.1.3: Manufacturer: Generic
[56363.855901] usb 1-1.1.3: SerialNumber: 121220160204
[56363.856664] usb-storage 1-1.1.3:1.0: USB Mass Storage device detected
[56363.859555] scsi host0: usb-storage 1-1.1.3:1.0
[56364.905739] scsi 0:0:0:0: Direct-Access Mass Storage Device 1.00 PQ: 0 ANSI: 0 CCS
[56364.906750] sd 0:0:0:0: Attached scsi generic sg0 type 0
[56365.028985] sd 0:0:0:0: [sda] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
[56365.029284] sd 0:0:0:0: [sda] Write Protect is off
[56365.029297] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[56365.029512] sd 0:0:0:0: [sda] No Caching mode page found
[56365.029524] sd 0:0:0:0: [sda] Assuming drive cache: write through
[56365.032417] sda: sda1
[56365.035987] sd 0:0:0:0: [sda] Attached SCSI removable disk
I have previously seen only your second comment. This refers to the first one:
First of all, I see sda2 it is hfsplus.
I have tried it with HFS+ and Fat32
What do you have for FILESYSTEMS in /etc/usbmount/usbmount.conf?
$ grep -v '#' /etc/usbmount/usbmount.conf | grep FILESYSTEMS
FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus"
Curious to know what the partition looks like for the device?
$ fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 77AC1B2A-96B3-4CC0-8970-DFC7137C4CE0
Device Start End Sectors Size Type
/dev/sda1 40 409639 409600 200M EFI System
/dev/sda2 409640 976510983 976101344 465.5G Apple HFS/HFS+
Beyond that, could it be a permissions issue?
Here's what I have:
$ id -nG | fmt -1 | grep plugdev plugdev
And:
$ cat /etc/udev/rules.d/99-usb.rules SUBSYSTEM=="usb", GROUP="plugdev", MODE="0660"
For me id -nG | fmt -1 | grep plugdev
prints nothing.
The /etc/udev/rules.d/99-usb.rules
file does not exist.
What does this mean? Is the installation corrupted?
In the /etc/udev/rules.d/
directory I have two files:
$ cat /etc/udev/rules.d/usbstick.rules
ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbstick-handler@%k"
$ cat /etc/udev/rules.d/usbstick.rules
ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbstick-handler@%k"
root@apollo:/home/pi# cat /etc/udev/rules.d/99-com.rules
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
echo 0; \
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"
Hi, Kuba,
I glean that you are not using the pi user, is that correct?
The pi user is in a lot of groups in /etc/group, and plugdev is one of them. In general you can have issues with different things on Raspbian if you have a user other than pi and you did not add the new user to all the same groups as pi.
On Raspbian (and Debian) usbmount documents that the user has to be in the plugdev group to use pumount, so add your user to the plugdev group in /etc/group (and I recommend same for all other groups that you see pi belonging to). Just add a , after pi and add your username there on each line.
After that, log out and back in and see if your problem is fixed.
I forgot to mention, if you ever use a GUI login on Raspian, it can conflict with usbmount. If you do ever use the graphical login, you will want to disable the built-in automount capabilities of the GUI. I can tell you how if you can't find it in the file browser preferences.
Next you can try creating the 99-usb.rules file with the contents I showed and then reboot.
That udev rules file is not part of usbmount. It's just something I do to avoid needing sudo when working with USB devices like disks, cameras, GPS's, etc. It may help here if your problem is indeed permission related. Adding your user to all the same groups as pi may be sufficient.
Leon Shaner :: Dearborn, Michigan (iPhone)
On May 10, 2019, at 4:53 AM, Kuba Szymanowski notifications@github.com wrote:
I have previously seen only your second comment. This refers to the first one:
First of all, I see sda2 it is hfsplus.
I have tried it with HFS+ and Fat32
What do you have for FILESYSTEMS in /etc/usbmount/usbmount.conf?
$ grep -v '#' /etc/usbmount/usbmount.conf | grep FILESYSTEMS FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus" Curious to know what the partition looks like for the device?
$ fdisk -l /dev/sda Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 77AC1B2A-96B3-4CC0-8970-DFC7137C4CE0
Device Start End Sectors Size Type /dev/sda1 40 409639 409600 200M EFI System /dev/sda2 409640 976510983 976101344 465.5G Apple HFS/HFS+ Beyond that, could it be a permissions issue?
Here's what I have:
$ id -nG | fmt -1 | grep plugdev plugdev And:
$ cat /etc/udev/rules.d/99-usb.rules SUBSYSTEM=="usb", GROUP="plugdev", MODE="0660" For me id -nG | fmt -1 | grep plugdev prints nothing. The /etc/udev/rules.d/99-usb.rules file does not exist. What does this mean? Is the installation corrupted? In the /etc/udev/rules.d/ directory I have two files:
$ cat /etc/udev/rules.d/usbstick.rules ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbstick-handler@%k" $ cat /etc/udev/rules.d/usbstick.rules ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbstick-handler@%k"
root@apollo:/home/pi# cat /etc/udev/rules.d/99-com.rules SUBSYSTEM=="input", GROUP="input", MODE="0660" SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660" SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\ chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\ '"
KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\ ALIASES=/proc/device-tree/aliases; \ if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \ echo 0;\ elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \ echo 1; \ else \ exit 1; \ fi\ '", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\ ALIASES=/proc/device-tree/aliases; \ if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \ echo 0; \ elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \ echo 1; \ else \ exit 1; \ fi \ '", SYMLINK+="serial%c" — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
I have previously ran all the commands on the root user. Running it again it on the pi user shows correct output:
$ id -nG | fmt -1 | grep plugdev
plugdev
I added the /etc/udev/rules.d/99-usb.rules
file with the following contents:
SUBSYSTEM=="usb", GROUP="plugdev", MODE="0660"
Then I did a reboot and the error persists:
/dev/sda does not contain a filesystem or disklabel
I should mention, I'm doing this on Raspbian lite. I'll try now on the full Raspbian distribution because I've heard it auto-mounts devices out of the box.
Hi, Kuba, Well it was worth a shot, because usbmount is working for me on Raspian. :-/
It's interesting that you have the problem with more than one USB drive, each with different partition schemes and file system types.
Perhaps you are chasing a bug outside of usbmount that may have already been fixed in later Raspian updates...
As mentioned, I am on the latest release version of Raspian. Is your Raspian up to date? Or is it perhaps the opposite problem and too far on the bleeding edge as in developer / beta / alpha builds?
Assuming released versions, have you tried updating? Here are the commands in order of least risk.
$ sudo apt update $ sudo apt upgrade
The above will affect only packages confined to the particular release of Raspian you are running. After the above, do another reboot.
If the above doesn't help, you may need to go further, but depending on what you are doing with your pi and how much you have customized it, and how many releases behind your Raspian is vs. the latest, then upgrading to a newer release (distro) can be more risky. :S It's up to you whether to proceed, but like I said, I am on the latest and usbmount is working for me.
$ sudo apt dist-upgrade
(And another reboot, if in fact it did install anything new).
Leon Shaner :: Dearborn, Michigan (iPad Pro)
On May 10, 2019, at 9:55 AM, Kuba Szymanowski notifications@github.com wrote:
I have previously ran all the commands on the root user. Running it again it on the pi user shows correct output:
$ id -nG | fmt -1 | grep plugdev plugdev I added the /etc/udev/rules.d/99-usb.rules file with the following contents:
SUBSYSTEM=="usb", GROUP="plugdev", MODE="0660" Then I did a reboot and the error persists:
/dev/sda does not contain a filesystem or disklabel — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Kuba,
Oh. Seems like Raspian Lite, doesn't have all that usbmount needs to function. :S Or your just needs updating? See my other note on updating it, since it may fix the issue for you.
Meanwhile, re: full Raspbian "auto-mounts devices out of the box," what you're referring to is a feature of the GUI / Graphical login on Raspbian. It's handled by the File Manager app.
I normally run headless (no GUI) and only occasionally fire up the graphical login. That's why I prefer usbmount, but then I also had to go disable the File Manager mount features under Edit -> Preferences -> Volume Management.
If you're planning to run with the GUI / graphical login always, then great! Just Use File Manager, not usbmount. But if you will mostly just SSH into the Pi, and not connect a screen or use VNC all the time, then using usbmount to handle the devices is a fix-all solution because it works for no GUI and with the GUI (provided you disable the Volume Management features in File Manager). And in either case your files will always be at /media/usbN, which you can get to from command-line or using the File Manager.
Good luck, Man! =D
Leon Shaner :: Dearborn, Michigan (iPad Pro)
On May 10, 2019, at 9:56 AM, Kuba Szymanowski notifications@github.com wrote:
I should mention, I'm doing this on Raspbian lite. I'll try now on the full Raspbian distribution because I've heard it auto-mounts devices out of the box.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
I installed full Raspbian instead of Raspbian lite, built usbmount from sources and it works now.
I am getting this same issue on raspbian lite. I used the raspbian imager to download and create a brand new image (Raspbian GNU/Linux 11 (bullseye)) that I am only using for testing this - I have done nothing other than try to get usbmount to work. I did apt update / upgrade.
Apr 20 07:43:11 pi3testbench mtp-probe[839]: checking bus 1, device 9: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2.4"
Apr 20 07:43:11 pi3testbench mtp-probe[839]: bus: 1, device: 9 was not an MTP device
Apr 20 07:43:11 pi3testbench mtp-probe[840]: checking bus 1, device 9: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2.4"
Apr 20 07:43:11 pi3testbench mtp-probe[840]: bus: 1, device: 9 was not an MTP device
Apr 20 07:43:13 pi3testbench systemd-udevd[844]: sdc: Process '/usr/share/usbmount/usbmount add' failed with exit code 2.
Apr 20 07:43:13 pi3testbench usbmount[870]: /dev/sdd does not contain a filesystem or disklabel
Apr 20 07:43:13 pi3testbench systemd-udevd[846]: sdd: Process '/usr/share/usbmount/usbmount add' failed with exit code 1.
pi@pi3testbench:~ $ lsblk -fp
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
/dev/sdb
└─/dev/sdb1 exfat 1.0
I am pretty new to linux I am afraid... Based on the previous comment i'll have to build from sources. Is that correct? I can't just apt-get install it? Are there docs for a linux newbie to build from sources?
Thanks
ok, I think that I managed to build it locally:
sudo apt-get update && sudo apt-get install -y debhelper build-essential
git clone https://github.com/rbrito/usbmount.git
cd usbmount
sudo dpkg-buildpackage -us -uc -b
cd ..
sudo dpkg -i usbmount_0.0.24_all.deb
and I now get:
Apr 20 11:07:09 pi3testbench mtp-probe[670]: checking bus 1, device 5: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2.2"
Apr 20 11:07:09 pi3testbench mtp-probe[670]: bus: 1, device: 5 was not an MTP device
Apr 20 11:07:09 pi3testbench mtp-probe[673]: checking bus 1, device 5: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2.2"
Apr 20 11:07:09 pi3testbench mtp-probe[673]: bus: 1, device: 5 was not an MTP device
so I no longer get the /dev/sdd does not contain a filesystem or disklabel
or the failure messages... but it doesn't mount it!
ok, I think I have got it to a place where it now runs the mount command... It's just that the command doesn't work. Will raise a new issue / find another one covering that case.
sudo dpkg -i usbmount_0.0.24_all.deb
yep exactly need to be pinned
@KKSzymanowski
does not contain a filesystem or disklabel
dosfslabel /dev/sdb "usb"
P.S not recommend by lower_case should use upper instead
so I no longer get the
/dev/sdd does not contain a filesystem or disklabel
or the failure messages... but it doesn't mount it!
sudo nano /etc/udev/rules.d/usbmount.rules
Automatic mounting doesn't seem to work on Raspbian
usbmount version: 0.0.24
When I plug in a device (vfat or HFS+) I get the following messages in the log:
One line that concerns me is this:
The
filesystem
ordisklabel
is searched in the output ofblkid -p /dev/sda
This command however outputs the following:To find what
usbmount
is looking for I would have to runblkid -p /dev/sda2
instead:How can I make
usbmount
look for the correct device?