Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Testing - Bookworm] inconsistent disk enumeration order

- - ALL UNSTABLE / TESTING THREADS SHOULD BE POSTED HERE - -
This sub-forum is the dedicated area for the ongoing Unstable/Testing releases of Debian. Advanced, or Experienced User support only. Use the software, give, and take advice with caution.
Post Reply
Message
Author
User avatar
kent_dorfman766
Posts: 529
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 56 times
Been thanked: 69 times

[Testing - Bookworm] inconsistent disk enumeration order

#1 Post by kent_dorfman766 »

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. :wink:

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#2 Post by sunrat »

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!

Random_Troll
Posts: 444
Joined: 2023-02-07 13:35
Been thanked: 105 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#3 Post by Random_Troll »

kent_dorfman766 wrote: 2023-06-04 05:23playing parsing games with /dev/disks/by-* entries to figure out where a disk really is
/dev/disk/by-id/ entries will remain the same for any given device and are unique. Why not just use them?

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.

User avatar
kent_dorfman766
Posts: 529
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 56 times
Been thanked: 69 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#4 Post by kent_dorfman766 »

The only way I know of to "force" a specific device to use a particular device node is by a udev rule.
My need to be stress free today is not accomplished by having to deal with udev rules.

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.

Random_Troll
Posts: 444
Joined: 2023-02-07 13:35
Been thanked: 105 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#5 Post by Random_Troll »

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.
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.

Name it something like 99-zzdisk.rules to make sure it's run last.
kent_dorfman766 wrote: 2023-06-04 17:55virtually every online example of a udev rule is syntactically wrong in one way or another
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:55I think it's time for some two wheeled wind therapy.
That's always a good idea. What bike do you have? I ride myself :-)
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.

User avatar
kent_dorfman766
Posts: 529
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 56 times
Been thanked: 69 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#6 Post by kent_dorfman766 »

@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!

User avatar
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

#7 Post by lospala »

sunrat wrote: 2023-06-04 07:18 Use UUID or LABEL. There are dozens of posts on this forum explaining that /dev/sdX is not guaranteed to be consistent.
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.

Random_Troll
Posts: 444
Joined: 2023-02-07 13:35
Been thanked: 105 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#8 Post by Random_Troll »

lospala wrote: 2023-06-06 15:46Mounting by UUID works fine but not in Bookworm testing release
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.

User avatar
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

#9 Post by lospala »

Random_Troll wrote: 2023-06-06 15:56
lospala wrote: 2023-06-06 15:46Mounting by UUID works fine but not in Bookworm testing release
Please share the full content of /etc/fstab (with UUIDs) and the output of

Code: Select all

lsblk -no name,uuid
Ok. Here goes.. Hope you can help me. Thank you

# /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.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 551
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 75 times
Been thanked: 85 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#10 Post by wizard10000 »

I see a couple of issues.

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

User avatar
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

#11 Post by lospala »

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
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

User avatar
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

#12 Post by lospala »

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.

User avatar
kent_dorfman766
Posts: 529
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 56 times
Been thanked: 69 times

Re: [Testing - Bookworm] inconsistent disk enumeration order

#13 Post by kent_dorfman766 »

@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.

User avatar
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

#14 Post by lospala »

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
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Post Reply