Exercise 27.1 - udev
I'm not having any luck trying to get the "myusb" symlink to show up in /dev.
I have double-checked that the rules file is in the correct location (/etc/udev/rules.d) with the correct name and syntax. I have confirmed that the USB stick is being detected by monitoring dmesg. I have even reloaded udev with udevadm control --reload.
I'm not sure what else to do.
Comments
-
I just ran the exercise on a RHEL 8 system and it worked perfectly. Can you please tell us what Distribution you are using (name and version) and whether or not this is a physical machine or a virtual machine under a hypervisor. If it is a VM there are a bunch of reasons the USB stick could not be passed through to the VM that have to do with hypervisor settings.
0 -
Hi coop, this is a physical machine and the dynamic hardware detection is working OK, the USB stick is being mounted.
I am using Linux Mint 19.3 and the output of
uname -ais:
Linux ZeroGravitas 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux0 -
I have no idea and I do not have any ubuntu-based physical machine to test with. I'm sure you have tried a reboot and the --reload command should have accomplished this anyway. It's possible it is a kernel configuration problem, but I doubt that is true as you are using the Mint-supplied kernel. or a systemd problem.
0 -
Hi @herecomesbrod ,
I don't have any Mint system, but I have Ubuntu 18.04, and it looks like it's kind of similar to your distro (somewhere in the middle of your Mint version).
So, with the new udev rule in place, when you connect a usb device, you will be able to see the value you specified in the "SYMLINK+=" parameter, as here:
luis@ubuntu18server:/etc/udev/rules.d$ ls -l /dev/myusb
lrwxrwxrwx 1 root root 15 Kun 24 10:45 /dev/myusb -> bus/usb/001/003Then you unmount the usb device, remove the udev rule, and connect the usb device again. This time you won't get any "myusb" device on /dev/ :
luis@ubuntu18server:/etc/udev/rules.d$ ls -l /dev/my*
ls: cannot access '/dev/my*': No such file or directoryI hope that helps.
Regards,
Luis.0 -
Thanks for your response Luis.
I have already done what you suggested, but it doesn't work. Please see the following. Note that the USB stick is identified as sdc1:
steve@ZeroGravitas:/etc/udev/rules.d$ ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Jul 24 17:53 /dev/sda
brw-rw---- 1 root disk 8, 1 Jul 24 17:54 /dev/sda1
brw-rw---- 1 root disk 8, 10 Jul 24 17:54 /dev/sda10
brw-rw---- 1 root disk 8, 2 Jul 24 17:53 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jul 24 17:53 /dev/sda3
brw-rw---- 1 root disk 8, 4 Jul 24 17:53 /dev/sda4
brw-rw---- 1 root disk 8, 5 Jul 24 17:53 /dev/sda5
brw-rw---- 1 root disk 8, 6 Jul 24 17:53 /dev/sda6
brw-rw---- 1 root disk 8, 7 Jul 24 17:53 /dev/sda7
brw-rw---- 1 root disk 8, 8 Jul 24 17:53 /dev/sda8
brw-rw---- 1 root disk 8, 9 Jul 24 17:53 /dev/sda9
brw-rw---- 1 root disk 8, 16 Jul 24 17:59 /dev/sdb
steve@ZeroGravitas:/etc/udev/rules.d$
steve@ZeroGravitas:/etc/udev/rules.d$ cat 80-usb_altname.rules
SUBSYSTEM=="usb”, SYMLINK+=”myusb”
< NOW I INSERT THE USB STICK >
steve@ZeroGravitas:/etc/udev/rules.d$ ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Jul 24 17:53 /dev/sda
brw-rw---- 1 root disk 8, 1 Jul 24 17:54 /dev/sda1
brw-rw---- 1 root disk 8, 10 Jul 24 17:54 /dev/sda10
brw-rw---- 1 root disk 8, 2 Jul 24 17:53 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jul 24 17:53 /dev/sda3
brw-rw---- 1 root disk 8, 4 Jul 24 17:53 /dev/sda4
brw-rw---- 1 root disk 8, 5 Jul 24 17:53 /dev/sda5
brw-rw---- 1 root disk 8, 6 Jul 24 17:53 /dev/sda6
brw-rw---- 1 root disk 8, 7 Jul 24 17:53 /dev/sda7
brw-rw---- 1 root disk 8, 8 Jul 24 17:53 /dev/sda8
brw-rw---- 1 root disk 8, 9 Jul 24 17:53 /dev/sda9
brw-rw---- 1 root disk 8, 16 Jul 24 18:03 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jul 24 18:03 /dev/sdc
brw-rw---- 1 root disk 8, 33 Jul 24 18:03 /dev/sdc1
steve@ZeroGravitas:/etc/udev/rules.d$ ls -l /dev/myusb
ls: cannot access '/dev/myusb': No such file or directory0 -
Hi @herecomesbrod ,
Please try naming the .rule file as follows: -.rules , in this case: 80-myusb.rules. I'm still researching on the need for this.
Regards,
Luis.0 -
Hi Luis,
I tried renaming the rules file to
80-myusb.rulesas advised, rebooted and inserted the USB stick, but it still is not creating the symlink in/dev.0 -
Hi @herecomesbrod ,
That sounds weird, because I did exactly the same test case. The only last thing that comes to my mind, is to check the "udev" service, as it has to be running for this to work:
luis@ubuntu18server:~$ sudo systemctl status udev
● systemd-udevd.service - udev Kernel Device Manager
Loaded: loaded (/lib/systemd/system/systemd-udevd.service; static; vendor pres
Active: active (running) since Sat 2020-07-25 14:32:42 -05; 1min 18s ago
Docs: man:systemd-udevd.service(8)
man:udev(7)
Main PID: 315 (systemd-udevd)
Status: "Processing with 10 children at max"
Tasks: 1
CGroup: /system.slice/systemd-udevd.service
└─315 /lib/systemd/systemd-udevdKun 25 14:32:42 ubuntu18server systemd[1]: Started udev Kernel Device Manager.
Kun 25 14:32:46 ubuntu18server systemd-udevd[337]: link_config: autonegotiation i
Kun 25 14:32:46 ubuntu18server mtp-probe[739]: checking bus 2, device 2: "/sys/de
Kun 25 14:32:46 ubuntu18server mtp-probe[739]: bus: 2, device: 2 was not an MTP d
Kun 25 14:32:48 ubuntu18server systemd-udevd[346]: link_config: autonegotiation i
Kun 25 14:32:56 ubuntu18server systemd-udevd[1556]: link_config: autonegotiation
Kun 25 14:32:56 ubuntu18server systemd-udevd[1555]: link_config: autonegotiation
Kun 25 14:32:56 ubuntu18server systemd-udevd[1555]: Could not generate persistent
Warning: Journal has been rotated since unit was started. [...]Regards,
Luis.0 -
minor point -- on RHEL you have to do "systemctl status systemd-udevd.service" (not just udevd) I really don't have an answer for why it works fine for me and Luis, it has something to do with your system setup or kernel.
0 -
I have found the problem.
I used the
odutility to check the contents of the rules file and found that some of the quote (") characters had a different character code:steve@ZeroGravitas:~$ od -c /etc/udev/rules.d/80-myusb.rules0000000 S U B S Y S T E M = = " u s b 3420000020 200 235 , S Y M L I N K + = 342 200 2350000040 m y u s b 342 200 235 \n \n0000052I deleted the text, retyped it and checked again:
steve@ZeroGravitas:~$ od -c /etc/udev/rules.d/80-myusb.rules0000000 S U B S Y S T E M = = " u s b "0000020 , S Y M L I N K + = " m y u s0000040 b " \n \n0000044I restarted the udev service, plugged in the USB stick and the symlink appeared in
/dev.Not sure how the weird characters got in the rules file - I use nano for editing.
Thanks for your help.
1 -
This kind of thing can happen when people cut and paste from either pdfs or word processor documents like .docx or even google docs. If you typed it by hand, it falls in the realm of "some mysteries are not understood by modern science."
1 -
Oh, I remember I saw it many years ago when somebody copied a text on Windows. In fact I copied the text from the pdf file and I didn't hit the issue.
I'm glad it's solved now

Regards,
Luis.0 -
I don't know if we warn people enough in this course in the intro chapter, but cut and paste from pdfs causes countless problems and should be avoided by the plague. In particular quote characters (such as ' ") and the backquote (`) are often screwed up, and usually invisibly. NEVER DO THIS
And it really does not have much to do with if it is coming from Windows are not, although it does depend on the pdf reader -- evince works much better than acroread which should never ever be used in any circumstance as it is rather defective, probably by design.We have had this problem repeatedly in many courses, especially the Kubernetes ones and no matter how much we tell people not to do this is a perpetual issue.
1 -
Oh, Acrobat Reader works worse because it hasn't been updated in many years for Linux. But yes, typing is large better. For other scenarios when the text is larger, let's say any yaml file, pasting it to a simple text editor and copying from there may help.
Many regards,
Luis.0 -
I don't even know if it is possible to get acroread for Linux as there has been an updated version for years and Adobe itself does not provide it any more for download. I personally have not seen it anywhere for a long long time
But Acrobat Reader is also defective in Windows at least as far as cut and paste goes. Do not use it for that purpose. To read documents fine, but that is all it is good for
1 -
Hi Luis and coop,
I am aware of the problems with cut-and-paste from word processing applications, so wouldn't normally do that - maybe I just had a blank moment.
FWIW I am not a fan of Adobe software, including Acrobat Reader, having spent many hours watching it install or update at the speed of grass growing and hoovering up system resources like it was on a supercomputer :-)
1
Categories
- All Categories
- 175 LFX Mentorship
- 175 LFX Mentorship: Linux Kernel
- 745 Linux Foundation IT Professional Programs
- 372 Cloud Engineer IT Professional Program
- 168 Advanced Cloud Engineer IT Professional Program
- 73 DevOps IT Professional Program - Discontinued
- 3 DevOps & GitOps IT Professional Program
- 98 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- AI & ML Training
- Blockchain & Decentralized Identity Training
- 1 Cloud & Containers Training
- Cybersecurity Training
- DevOps & Site-Reliability Training
- Linux Kernel Development Training
- Networking Training
- Open Source Best Practice Training
- System Administration Training
- System Engineering Training
- Web & Application Development Training
- 2 LFD103-JP クラス フォーラム
- 4 LFD210-CN Class Forum
- 764 LFD259 Class Forum
- 681 LFS101 Class Forum
- 2 LFS158-JP クラス フォーラム
- 162 LFS207 Class Forum
- 3 LFS207-DE-Klassenforum
- 4 LFS207-JP クラス フォーラム
- 61 LFS241 Class Forum
- 52 LFS242 Class Forum
- 42 LFS243 Class Forum
- 19 LFS244 Class Forum
- 4 LFS250-JP クラス フォーラム
- 166 LFS253 Class Forum
- 1.4K LFS258 Class Forum
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 768 Linux Distributions
- 81 Debian
- 67 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 945 Programming and Development
- 310 Kernel Development
- 617 Software Development
- 977 Software
- 369 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)
