Ask Your Question
3

F29 5.x Kernels and USB drives

asked 2019-04-02 01:38:27 -0500

John Andrews gravatar image

updated 2019-04-02 09:09:40 -0500

vtrefny gravatar image

I've got a pc with about 5-6 usb drives attached. Since the 5.x kernels have come out, when I boot the usb drives usually don't get mounted, but one in about 5 times they will work fine. If I get into the grub menu, and can boot the last 4.x kernel, and the drives mount fine. If I do lsusb I see the drives:

[root@localhost john]# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 18e3:9106 Fitipower Integrated Technology Inc 
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 005: ID 1058:1230 Western Digital Technologies, Inc. My Book (WDBFJK)
Bus 007 Device 007: ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
Bus 007 Device 003: ID 0bc2:ab45 Seagate RSS LLC 
Bus 007 Device 010: ID 174c:1153 ASMedia Technology Inc. ASM1153 SATA 3Gb/s bridge
Bus 007 Device 009: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 007 Device 008: ID 1f75:0621 Innostor Technology Corporation 
Bus 007 Device 006: ID 1058:25e2 Western Digital Technologies, Inc. My Passport (WD40NMZW)
Bus 007 Device 004: ID 0bc2:ab21 Seagate RSS LLC Backup Plus Slim
Bus 007 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 006 Device 003: ID 0bc2:ab44 Seagate RSS LLC 
Bus 006 Device 004: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 006 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 046d:0826 Logitech, Inc. HD Webcam C525
Bus 001 Device 007: ID 058f:9410 Alcor Micro Corp. Keyboard
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 003: ID 8054:0001  
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

mount just shows the system related stuff and the sata drive:

[root@localhost john]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=1900172k,nr_inodes=475043,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid ...
(more)
edit retag flag offensive close merge delete

Comments

That will be out of scope for ask.fedoraprojeckt.org .. please open a bugreport at bugzilla.redhat.com

rdtcustomercare gravatar imagerdtcustomercare ( 2019-04-02 08:28:12 -0500 )edit

Can you mount drives manually after booting up?

If you do -- we can try systemd automount feature to mount them when you need them.

I.e. if the problem is they don't mount automatically upon boot -- this we can mitigate (and maybe they shouldn't -- depending on your config).

And if the problem is you can't mount them at all -- manually, automatically, by unpugging and replugging etc. -- then it's a more serious issue. Still we can try to troubleshoot some more.

Night Romantic gravatar imageNight Romantic ( 2019-04-03 07:02:07 -0500 )edit

Before the 5.x upgrade, upon booting these drives would just automount with no problem. When I boot a 5.X kernel the /run/media/username directory is missing, but I can go thru the tedious process of manually mounting...(ugh)

John Andrews gravatar imageJohn Andrews ( 2019-04-03 18:40:32 -0500 )edit

John, have you made some configuration changes for these drives to mount automatically -- for example made entries in fstab, or some other way -- or did they just mount on their own, without you instructing you computer in any way to mount them?

I believe we can add such instructions (I know of two possible options from the top of my head), so your computer would know it has to do it.

Night Romantic gravatar imageNight Romantic ( 2019-04-04 02:04:45 -0500 )edit

No changes other then whatever the Fedora defaults were. Before this last kernel upgrade, they would just plug and play, or automount at boot time, like they do on my ubuntu and debian boxes. I hought linux was way past the point of going thru the tedious mount process every time we had to read a disk?

John Andrews gravatar imageJohn Andrews ( 2019-04-04 20:30:32 -0500 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2019-04-16 08:02:50 -0500

Night Romantic gravatar image

updated 2019-04-17 12:25:37 -0500

Automounting USB drives with systemd and fstab entries.

Short version.

We'll use systemd's automount feature and will define mountpoints for it in /etc/fstab. I couldn't find better solution for automatically mounting usb drives. If anyone will offer a better one -- I'll be first in queue to learn something new.

Basically, you need to create mountpoints (directories, where your partitions will mount to), and then add one line to /etc/fstab for each partition you need to automount:

UUID=<partition_uuid> <mountpoint> <fs_type> noauto,x-systemd.automount,x-systemd.device-timeout=1 0 0

You need to use correct UUIDs, fs types and mountpoints, of course.

After system reboot partitions you've specified should mount automatically upon boot, drives plugging in, or upon accessing them.

Long version.

As far as I know, by default usb drives/partitions are mounted automatically by desktop environment (Gnome/KDE for sure) with the use of udev. In my tests (very limited one) they were also mounted upon logging in to Gnome after booting my computer with USB drive already plugged in – but this is exactly what author of the post found not reliable enough.

Just for a bit of perspective, internal drives aren't mounted automatically in this way.

General rule for automatically mounting any kind of drives/partitions: partitions you want you computer to mount automatically should be mentioned in etc/fstab file. There are other ways to achieve this, for example with the use of custom udev rules, autofs, maybe something else.

There's a problem though with “traditional” mounts from /etc/fstab and USB drives specifically. Linux will mount all mountpoints from fstab with default parameters upon booting the system – and will refuse to boot is any mounting attempt will fail. And USB drives by their nature can be connected today but disconnected tomorrow.

To resolve this we'll use automount feature of systemd. It basically allows to mount partition not upon boot, not manually upon user command, but automatically upon addressing it. In practical terms with configuration offered computer boots successfully with or without USD drives plugged in, and upon accessing mountpoint it will either automatically mount them if the drive is connected, or report absence of the drive. Moreover, it'll work this way even in the absence of desktop environment for any target – on internal drives, usb ones, or even network ones.

Some preparations

Thing to be aware of. If you accidentally seriously mess up your /etc/fstab -- your system won't boot. Be careful with it, make backups. To be able to resolve such an issue, I strongly recommend having Fedora Live CD/USB available. You can boot from it and revert changes you've made to fstab or correct a mistake.

1. Make sure you have a tested Fedora Live CD/USB available to you and you're able to boot from it.

2. We'll work in a terminal. Open it now.

3. We'll need to edit files in /etc directory, and only root ... (more)

edit flag offensive delete link more
0

answered 2019-04-17 20:01:28 -0500

cmurf gravatar image

updated 2019-04-17 20:12:37 -0500

If they consistently mount with kernel 4.20.x and consistently do not mount with kernel 5.0.x then that sounds like some kind of kernel regression. Is this Fedora 29 Workstation? GNOME uses UDisks2 for automounting in the user environment so strictly speaking the volumes are being mounted when you login, not during start up. Startup automounts are handled by systemd per /etc/fstab or native automount files. However, I don't offhand see any applicable UDisks2 bugs about this. I suggest you gather more information: do a clean boot with 4.20 kernel and another clean boot with 5.0 kernel, and capture the full journal, e.g. sudo journalctl -b -o short-monotonic > journal-k420.log . And then compare them at the point of login and make sure in fact UDisks2 (or something else) is doing the mounting for 4.20 and what's going wrong for 5.0. Yes you could just find a work around for it, but if it's a bug, it should get reported and fixed. That's sorta the point of of Fedora. Anyway I just tried this with Fedora 30 and kernel 5.0.7 and UDisks2 does do the automount as expected, this is what it looks like:

[32976.150169] fmac.local udisksd[1295]: Mounted /dev/sdb at /run/media/chris/kingston on behalf of uid 1000

Edit 1: I just read the original email, this looks like maybe a kernel bug or regression with the SATA->USB bridge chipset in the enclosure you're using. [ 841.077924] sd 5:0:0:0: [sdi] Spinning up disk...

This is happening with kernel 5.0.7?

My suggestion is to just keep using 4.20.x for now until it gets fixed. But I tend to get antsy, I just don't know for sure someone else will do the reporting sooner than I can. So my actual suggestion is to head to koji and install the current Rawhide kernel, which today is kernel-5.1.0-0.rc5.git2.1.fc31 and will install and run just fine on Fedora 29. Whether that fixes it or not, I'd file a bug and say in the bug if it does or doesn't fix it. And note the last version it worked in and the first version it stopped working in.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-04-02 01:38:27 -0500

Seen: 99 times

Last updated: Apr 17