device naming puzzle

Other talk about Salix

device naming puzzle

Postby mimosa » 1. Feb 2017, 12:50

My hard disk is recognised as /dev/sda, but external USB storage is seen as /dev/sdc:

Code: Select all
mimosa[~]$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   28G  0 disk
├─sda1   8:1    0  265M  0 part /boot/efi
├─sda2   8:2    0 12.6G  0 part /
└─sda3   8:3    0 15.1G  0 part /home/Data
sdc      8:32   1  3.8G  0 disk
├─sdc1   8:33   1  2.5G  0 part
└─sdc2   8:34   1  1.3G  0 part

The following is in dmesg, and looks like a possible candidate for the culprit:
Code: Select all
[    7.105964] scsi 5:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9451 PQ: 0 ANSI: 0
[    7.110790] sd 5:0:0:0: [sdb] Attached SCSI removable disk

This doesn't really matter, but I'm curious as to what that is. However, I'm unsure how to investigate. This is a new computer. For what it's worth:
mimosa[~]$ inxi -DM
Code: Select all
Machine:   Mobo: INTEL model: CRESCENTBAY Bios: American Megatrends v: 5.6.5 date: 08/29/2015
Drives:    HDD Total Size: 34.0GB (48.4% used) ID-1: /dev/sda model: CHN_25SATA01M_03 size: 30.0GB
           ID-2: USB /dev/sdc model: USB_Flash_Disk size: 4.0GB

When I searched for "9451 PQ", I saw some results relating to a variety of machines - some connected with SD cards. My box has an SD socket, but no SD card is inserted in it.
User avatar
mimosa
Salix Warrior
 
Posts: 2876
Joined: 25. May 2010, 17:02

Re: device naming puzzle

Postby gapan » 1. Feb 2017, 18:06

Try plugging in an SD card. What device does it get assigned to? sdb could be used as a placeholder for when you actually plug something.
Image
Image
User avatar
gapan
Salix Wizard
 
Posts: 5252
Joined: 6. Jun 2009, 17:40

Re: device naming puzzle

Postby mimosa » 1. Feb 2017, 18:55

Yes, that seems to be it, at least, the SD card appears as sdb. This must be something the kernel does if it sees the empty slot - but it didn't happen on my old machine, which also has one. So it must depend on hardware, too. The kernel is the same one, 4.4.38 (I simply transferred the hard disk, rather than doing a fresh Salix install).

Off topic, the SD card I just found knocking about was the one I used with my Pi ages ago. I see it has Squeak on it! (Squeak is a Smalltalk implementation). I didn't know that then.
User avatar
mimosa
Salix Warrior
 
Posts: 2876
Joined: 25. May 2010, 17:02

Re: device naming puzzle

Postby mimosa » 3. Feb 2017, 08:01

It now recognizes external storage as "sdb"! This must be because of putting the SD card in the slot - it has somehow worked out how to tell nothing is going on when there is nothing there. It's no longer mentioned in dmesg.
User avatar
mimosa
Salix Warrior
 
Posts: 2876
Joined: 25. May 2010, 17:02

Re: device naming puzzle

Postby DidierSpaier » 3. Feb 2017, 10:01

That's where naming the partitions by their UUID or PARTUUID in /etc/fstab and the boot loaders' config files comes handy ;)
DidierSpaier
 
Posts: 225
Joined: 20. Jun 2016, 20:15

Re: device naming puzzle

Postby westms » 17. Feb 2017, 17:07

mimosa wrote:but it didn't happen on my old machine, which also has one

But the SD card drive is not moved with - the new hardware has a different, right?
This has changed the serial number and / or the USB-ID. If it is a USB device, lsusb, otherwise lspci would give a useful information, not lsblk or even inxi.

As previously reported, a hard disk with an installation on it can no longer simply be moved. Not only because in the case of native UEFI use, the boot configuration have to be supplemented or adapted, in general also a hard disk can no longer simply be moved. This has been so since the changeover to udev.

mimosa wrote:So it must depend on hardware, too.

To see the hardware as starting point is not bad. In reality, it is a software component from the installation, or better its configuration, which is responsible for this behavior. There are udev rules describing hardware properties. After the move of the hard disk some do not meet anymore. Incorrect rules can be edited or deleted.

Some glances at /etc/udev/rules.d , /run/udev/rules.d and /usr/lib/udev/rules.d could provide clarity. The order of the directories here indicates the decreasing meaning of the rules in the set of rules.

Also, after the move, e.g. the rules for network interfaces must be incorrect, as long as the rules are included in /etc/udev/rules.d (70-persistent-net.rules).
westms
 
Posts: 292
Joined: 17. Mar 2013, 18:51

Re: device naming puzzle

Postby mimosa » 17. Feb 2017, 17:35

Right, so if I reinstalled, it might well iron out the kinks. Otherwise, it looks as though one would have to delve quite deeply into udev rules. I can well believe the answer might lie there.

You're also right that I had to reinstall the bootloader. That done, everything is fine bar this device naming quirk, which I'm quite happy to live with for now.
User avatar
mimosa
Salix Warrior
 
Posts: 2876
Joined: 25. May 2010, 17:02


Return to Misc