theone Posted May 25, 2015 Share Posted May 25, 2015 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 Quote Link to comment
NAS Posted May 25, 2015 Share Posted May 25, 2015 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 Quote Link to comment
theone Posted May 25, 2015 Author Share Posted May 25, 2015 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. Quote Link to comment
NAS Posted May 25, 2015 Share Posted May 25, 2015 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 Quote Link to comment
Recommended Posts
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.