Harddrives renaming themselves?

Message
Author
User avatar
lucky9
Posts: 475
Joined: Wed Jul 12, 2006 5:54 am

Re: Harddrives renaming themselves?

#131 Post by lucky9 »

I don't boot with a USB FlashDrive drive plugged in. My two USB HDDs are plugged in all the time....but they aren't turned on when booting.
Yes, even I am dishonest. Not in many ways, but in some. Forty-one, I think it is.
--Mark Twain

User avatar
BitJam
Developer
Posts: 2303
Joined: Sat Aug 22, 2009 11:36 pm

Re: Harddrives renaming themselves?

#132 Post by BitJam »

@Eadwine, there are two very different things going on here. Your problem has to do with a cdrom drive being treated like a hard drive and thus rendering it inoperable. IMO if this is not due to a hardware problem or a misconfiguration (including a possible misconfiguration in the BIOS) then it is a bug in the kernel.

@everyone,
The other "problem" is less severe. All the device still work, but the names like /dev/sda can be different on different boots. This is exacerbated when you boot from a LiveUSB because that changes the timing of when devices get recognized. This "problem" will not go away. We have been warned about this literally for years. We went through the sometimes painful process of converting our bootloaders and fstabs to use UUIDs instead of device names in preparation for it. We should not be surprised that the this change has finally arrived on our doorstep.

The only way the kernel can reliably provide consistent /dev/sdX names is to delay the boot process until it is sure that all devices of a certain type have been recognized. It was realized years ago that as hardware become more modular and more convoluted, it no longer made sense for people rely on consistent /dev/sdX names. That is why we have the /dev/disk-by/ directories. That is why we identify the root partition by UUID in a boot parameter. That is why we identify partitions in fstab by UUID and not device name.

It's not because people like UUIDs or find them easier or more intuitive to work with. It is because it is no longer practical to keep the /dev/sdX names consistent. Going forward, the solution is actually pretty simple and I've posted it before. We simply stop using /dev/sdX names when identifying devices in the installer. AFAIK, almost all of the information we should use to identify a device is in the output of the command:

Code: Select all

lsblk -o LABEL,MODEL,FSTYPE,RM,MOUNTPOINT,SIZE
See:
Persistent block device naming:
This article describes how to use persistent names for your block devices. This has been made possible by the introduction of udev and has some advantages over bus-based naming. If your machine has more than one SATA, SCSI or IDE disk controller, the order in which their corresponding device nodes are added is arbitrary. This may result in device names like /dev/sda and /dev/sdb switching around on each boot, culminating in an unbootable system, kernel panic, or a block device disappearing. Persistent naming solves these issues.
Persistent storage device names:
In a Linux system (and every other Unix like system), every device known to the kernel gets its own name during the device probing at bootup time. If the probing order does not change across reboots and if the hardware configuration remains the same, those names are stable and there is nothing to worry about.

With new technologies like FireWire, USB and Fibrechannel, devices can be added and removed at runtime. But even in the good old days it was not uncommon to add and remove drives, or to experience hardware failures at runtime. All this leads to a different probing order and the stable kernel device names are in danger for the next boot.

User avatar
richb
Administrator
Posts: 10867
Joined: Wed Jul 12, 2006 2:17 pm

Re: Harddrives renaming themselves?

#133 Post by richb »

That resolves the installer issue, but what about the issue of booting with a USB stick in a port, not from the stick. My internal drives are designated by UUID in fstab but still show sdx designations in a file manager.

I can live with it as I label my drives to avoid confusion. So it is not an issue for me.
Forum Rules
Guide - How to Ask for Help

richb Administrator
System: MX 23 KDE
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB

User avatar
anticapitalista
Developer
Posts: 4286
Joined: Sat Jul 15, 2006 10:40 am

Re: Harddrives renaming themselves?

#134 Post by anticapitalista »

richb - the mount points for devices/partitions should also appear as labels or uuid under media in the future. That should also be the case in fstab.

Here is an example of my fstab that we are working on in antiX and MX with Adrian.:

Code: Select all

# Pluggable devices are handled by uDev, they are not in fstab
UUID=3b6c6562-2de0-4f14-993d-8af446a6bf57 / ext4 defaults,noatime 1 1
#LABEL="antiX-64" / ext4 defaults,noatime 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0622 0 0
#UUID=c0c16fbc-1e5a-46a8-9ecd-d064800b1dca swap swap sw, 0 0
LABEL="swap" swap swap sw, 0 0
#UUID=8fa6aecc-c2ee-48c5-9dd8-2e4027187922 /media/sda1 ext4 noauto,users,exec,relatime 0 0
LABEL="antiX-32" /media/antiX-32 ext4 noauto,users,exec,relatime 0 0
#UUID=2c53bf5a-8caa-4534-beb1-f5aa04050918 /media/sda3 ext3 auto,users,exec,relatime 0 0
LABEL="Torrents" /media/Torrents ext3 auto,users,exec,relatime 0 0
#UUID=f56325d7-99bc-4d6d-b84d-b81554a404dd /media/sdb3 ext3 auto,users,exec,relatime 0 0
LABEL="Data" /media/Data ext3 auto,users,exec,relatime 0 0
#UUID=d5b1c53b-8c62-4731-8492-021f22c45b69 /media/sdb5 btrfs auto,users,exec,relatime 0 0 
LABEL="Docs" /media/Docs btrfs auto,users,exec,relatime 0 0
#UUID=8fa6aecc-c2ee-48c5-9dd8-2e4027187922 /media/sdb6 ext4 noauto,users,exec,relatime 0 0
LABEL="MX-14" /media/MX-14 ext4 noauto,users,exec,relatime 0 0

anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

User avatar
lucky9
Posts: 475
Joined: Wed Jul 12, 2006 5:54 am

Re: Harddrives renaming themselves?

#135 Post by lucky9 »

I'd get more lost if I didn't have everything labeled. I need something I can actually read and know what it is.
Yes, even I am dishonest. Not in many ways, but in some. Forty-one, I think it is.
--Mark Twain

User avatar
anticapitalista
Developer
Posts: 4286
Joined: Sat Jul 15, 2006 10:40 am

Re: Harddrives renaming themselves?

#136 Post by anticapitalista »

I should also have mentioned in my post above the work done/in progress by BitJam in creating an /etc/fstab with labels/uuid which has been incorportaed into the gui installer.
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

User avatar
Eadwine Rose
Administrator
Posts: 14501
Joined: Wed Jul 12, 2006 2:10 am

Re: Harddrives renaming themselves?

#137 Post by Eadwine Rose »

I have managed to change the jumper on the Plextor to slave, yay left hand. Sony is still disconnected. Boot order is back to cdrom first. Wait and see what is going to happen from now on!
MX-23.6_x64 July 31 2023 * 6.1.0-37amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
Eadwine Rose
Administrator
Posts: 14501
Joined: Wed Jul 12, 2006 2:10 am

Re: Harddrives renaming themselves?

#138 Post by Eadwine Rose »

So.. Sony unplugged, Plextor on Slave, nope, not helping either, still happening.

That is all I can do. Going to put this baby's boot order back to harddrive first now. *shrug*
MX-23.6_x64 July 31 2023 * 6.1.0-37amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

Post Reply

Return to “Older Versions”