[?] When does the device name (sda, adb, ...) change?


Recommended Posts

Hello,

 

For a plugin I am working on:

 

Does anyone know (definitely) when the device name (sda, adb, ...) given to HDD/CD-DVD ROMs devices change?

 

is it only when connecting it to a different SATA port? Or can it change for other reasons?

 

Thanks

 

Link to comment

Once a device is connected it will hold that alias. If a a new device is connected it will get the next alias.

 

However you cannot guarantee it will be the same alias each time obviously. Also if a drive drops and comes up it may get a new alias.

 

sd* is not a good way to address things far better to look at more modern alternatives such as UUID etc

Link to comment

Once a device is connected it will hold that alias. If a a new device is connected it will get the next alias.

 

However you cannot guarantee it will be the same alias each time obviously. Also if a drive drops and comes up it may get a new alias.

 

sd* is not a good way to address things far better to look at more modern alternatives such as UUID etc

 

For my plugin I need to know when a drive has physically been connected to a different SATA port - is this possible?

 

Edit:

 

I will try use lsscsi.

 

/dev/disk/by-path does not show all devices for some reason.

Link to comment

Once a device is connected it will hold that alias. If a a new device is connected it will get the next alias.

 

However you cannot guarantee it will be the same alias each time obviously. Also if a drive drops and comes up it may get a new alias.

 

sd* is not a good way to address things far better to look at more modern alternatives such as UUID etc

 

For my plugin I need to know when a drive has physically been connected to a different SATA port - is this possible?

 

Edit:

 

I will try use lsscsi.

 

/dev/disk/by-path does not show all devices for some reason.

 

Good tip sparky. Curious about by-path though wonder why that is not defitnitve.

 

Also udev can be your friend it is super powerful

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.