[Testing - Bookworm] inconsistent disk enumeration order
- kent_dorfman766
- Posts: 546
- Joined: 2022-12-16 06:34
- Location: socialist states of america
- Has thanked: 60 times
- Been thanked: 70 times
[Testing - Bookworm] inconsistent disk enumeration order
Having used hundreds and hundreds of distinct Linux instances over the years, this is the first time I've seen the kernel/startup not name enumerate disks in a consistent fashion after reboot.
I have "things" that still rely upon /dev/sdX naming rather than uuid, and I'd prefer a more direct route of making the enumeration maintain consistency, instead of playing parsing games with /dev/disks/by-* entries to figure out where a disk really is.
Whiskey Tango!? some online blurbs that consistency was never guaranteed but given the number of man-years I've sat in front of a monitor and never experienced that...I have to wonder.
Anyone have thoughts on making the boot process keep consistent disk name assignments...udev rules would NOT be a prefered solution.
I have "things" that still rely upon /dev/sdX naming rather than uuid, and I'd prefer a more direct route of making the enumeration maintain consistency, instead of playing parsing games with /dev/disks/by-* entries to figure out where a disk really is.
Whiskey Tango!? some online blurbs that consistency was never guaranteed but given the number of man-years I've sat in front of a monitor and never experienced that...I have to wonder.
Anyone have thoughts on making the boot process keep consistent disk name assignments...udev rules would NOT be a prefered solution.
- sunrat
- Administrator
- Posts: 6686
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 122 times
- Been thanked: 524 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
Use UUID or LABEL. There are dozens of posts on this forum explaining that /dev/sdX is not guaranteed to be consistent.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
-
- Posts: 444
- Joined: 2023-02-07 13:35
- Been thanked: 105 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
/dev/disk/by-id/ entries will remain the same for any given device and are unique. Why not just use them?kent_dorfman766 wrote: ↑2023-06-04 05:23playing parsing games with /dev/disks/by-* entries to figure out where a disk really is
Several factors influence enumeration order, this Red Hat guide gives a good overview:
https://access.redhat.com/documentation ... ent_naming
The only way I know of to "force" a specific device to use a particular device node is by a udev rule.
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.
- kent_dorfman766
- Posts: 546
- Joined: 2022-12-16 06:34
- Location: socialist states of america
- Has thanked: 60 times
- Been thanked: 70 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
My need to be stress free today is not accomplished by having to deal with udev rules.The only way I know of to "force" a specific device to use a particular device node is by a udev rule.
Take something as simple as:
KERNEL=="sd*[!0-9]",ENV{ID_SERIAL}=="ST2000DM001-1CH164_Z3408QTZ",RUN+="/usr/bin/touch /tmp/found"
which doesn't work. Further complicated by the fact that virtually every online example of a udev rule is syntactically wrong in one way or another: mixed/wrong case, incorrect quoting of values, misuse of attributes, etc. I've spent the past three hours doing every possible permutation I can come up with to trigger the above rule as a RUN or SYMLINK action with no joy...and I'm quite confident that the device serial number is correct, since it was pasted from the udevadm info output.
udevadm monitor -u
shows my trigger actions when I reload and trigger to update.
Thoughts?
edit - I think it's time for some two wheeled wind therapy.
-
- Posts: 444
- Joined: 2023-02-07 13:35
- Been thanked: 105 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
What did you call that rule file? Udev rules are read from both /etc/udev/rules.d/ and /lib/udev/rules.d/ and are processed in lexicographic order so if your rule is run before /lib/udev/rules.d/60-persistent-storage.rules it will probably be overridden.kent_dorfman766 wrote: ↑2023-06-04 17:55Take something as simple as:
KERNEL=="sd*[!0-9]",ENV{ID_SERIAL}=="ST2000DM001-1CH164_Z3408QTZ",RUN+="/usr/bin/touch /tmp/found"
which doesn't work.
Name it something like 99-zzdisk.rules to make sure it's run last.
Only use http://reactivated.net/writing_udev_rules.html for reference. Random interweb bloggers tend to be ignorant fools suffering from the Dunning-Kruger effect. But I'm sure you knew that already.kent_dorfman766 wrote: ↑2023-06-04 17:55virtually every online example of a udev rule is syntactically wrong in one way or another
That's always a good idea. What bike do you have? I ride myself
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.
- kent_dorfman766
- Posts: 546
- Joined: 2022-12-16 06:34
- Location: socialist states of america
- Has thanked: 60 times
- Been thanked: 70 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
@Random_Troll
Your descripton of the problem helped. Thanks! The parsing order was at fault. Doesn't seem "smart" for the distro persistent-storage rules to be so highly numbered. They should be in the 10-20 range instead.
re two wheeled wind therapy.
have two in the stable: an old Buell UlyXT that barely runs. While innovate, those bikes were NOT well made and are purely cult classics. The main beast is 2015 Yamaha FJR. I call her the feejer. Usually do 5000-8000 miles a year riding Appalachian twisties in WV, OH, PA,...Today did a loop trip of about 70 miles to get some steak chilli verde at a place I like in the hills above East Liverpool OH.
BTW: good udev reference you listed!
Your descripton of the problem helped. Thanks! The parsing order was at fault. Doesn't seem "smart" for the distro persistent-storage rules to be so highly numbered. They should be in the 10-20 range instead.
re two wheeled wind therapy.
have two in the stable: an old Buell UlyXT that barely runs. While innovate, those bikes were NOT well made and are purely cult classics. The main beast is 2015 Yamaha FJR. I call her the feejer. Usually do 5000-8000 miles a year riding Appalachian twisties in WV, OH, PA,...Today did a loop trip of about 70 miles to get some steak chilli verde at a place I like in the hills above East Liverpool OH.
BTW: good udev reference you listed!
- lospala
- Posts: 116
- Joined: 2023-05-31 08:32
- Location: Buenoa Aires, Argentina
- Has thanked: 13 times
- Been thanked: 4 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
Mounting by UUID works fine but not in Bookworm testing release. I used this option in fstab for years in Ubuntu Mate and I never had a problem. In this version I mounted Hdds by /dev/sdx and by UUID and in both cases when hdds are mounted the denominations swap among disks
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.
-
- Posts: 444
- Joined: 2023-02-07 13:35
- Been thanked: 105 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
That is not the case for my bookworm system and we haven't had any other reports of that problem here.
Please share the full content of /etc/fstab (with UUIDs) and the output of
Code: Select all
lsblk -no name,uuid
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.
- lospala
- Posts: 116
- Joined: 2023-05-31 08:32
- Location: Buenoa Aires, Argentina
- Has thanked: 13 times
- Been thanked: 4 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
Ok. Here goes.. Hope you can help me. Thank youRandom_Troll wrote: ↑2023-06-06 15:56Please share the full content of /etc/fstab (with UUIDs) and the output ofCode: Select all
lsblk -no name,uuid
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=d73aabec-1783-4ec6-b390-500768600d74 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda1 during installation
UUID=0e71ce84-b217-4b90-8bf3-34cbe083f886 /home ext4 defaults 0 2
##########################################################################
UID="03ee29ab-d62f-4a32-87b7-cd0afff2ca70" /media/WIN2K ext4 rw,nosuid,user,nodev,uhelper=devkit 0 2
UUID="8b8a26df-d187-45a5-9d56-173ae1d5b4fd" /media/BACKUP ext4 rw,nosuid,user,nodev,uhelper=devkit 0 2
##########################################################################
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.
- wizard10000
- Global Moderator
- Posts: 723
- Joined: 2019-04-16 23:15
- Location: southeastern us
- Has thanked: 94 times
- Been thanked: 117 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
I see a couple of issues.
On the /media/WIN2K mount point UUID is misspelled. Also, UUID shouldn't be enclosed in quotes.
On the /media/WIN2K mount point UUID is misspelled. Also, UUID shouldn't be enclosed in quotes.
we see things not as they are, but as we are.
-- anais nin
-- anais nin
- lospala
- Posts: 116
- Joined: 2023-05-31 08:32
- Location: Buenoa Aires, Argentina
- Has thanked: 13 times
- Been thanked: 4 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
Thank you. The UUID was correct (my error when selecting with the mouse to copy)
I removed the quotes and will test wether it works without them
I removed the quotes and will test wether it works without them
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.
- lospala
- Posts: 116
- Joined: 2023-05-31 08:32
- Location: Buenoa Aires, Argentina
- Has thanked: 13 times
- Been thanked: 4 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
Nope... without quotes at the third atempt the swap persists
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.
- kent_dorfman766
- Posts: 546
- Joined: 2022-12-16 06:34
- Location: socialist states of america
- Has thanked: 60 times
- Been thanked: 70 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
@lospala
The whole purpose of this thread was that sdX and UUID are not linked. You are unclear, but if that is what you're saying then it is expected behaviour, even though I never encountered it for many many years myself.
As long as the UUID= is mounting the correct partition then that's all you can expect.
The whole purpose of this thread was that sdX and UUID are not linked. You are unclear, but if that is what you're saying then it is expected behaviour, even though I never encountered it for many many years myself.
As long as the UUID= is mounting the correct partition then that's all you can expect.
- lospala
- Posts: 116
- Joined: 2023-05-31 08:32
- Location: Buenoa Aires, Argentina
- Has thanked: 13 times
- Been thanked: 4 times
Re: [Testing - Bookworm] inconsistent disk enumeration order
I use Ubuntu 20.04 and prior versions. Testing for me is easy because I have backups of the entire hdd where Linux is installed so moving from Ubintu to Debian is a matter of 5 minutes at least. With the same fstab I had no problems with Ubuntu so this behaiour drove me to presume that there exists a problem with this Debiain version still unsolved. I noticed this failure when I run esedraf4 for the partition /sda and in terminal I saw that the defragmentation was running on the drive labeled as WIN2K which is not the Linux drive
Randomly upon one or more boots the drives were shown with the correct label and so.
I hope this is clear. Inc fact the system works but the same test done on Ubuntu shows no wrong behavior. I I coincide with you about UUID trustability as I use Ubuntu since 2006
Thanks for your post
Randomly upon one or more boots the drives were shown with the correct label and so.
I hope this is clear. Inc fact the system works but the same test done on Ubuntu shows no wrong behavior. I I coincide with you about UUID trustability as I use Ubuntu since 2006
Thanks for your post
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.