RESOLVED: Find "Device Name" for dynamically loaded drive?
Posted: Sat Jul 14, 2012 7:25 pm
Esteemed Forum Participants and Lurkers:
=============================================
Linux Mint 8, Mint 10, & Mint 13 LiveDVD systems
I have a drive drawer on my system which is cabled to the SATA-0 channel and which I use to load and remove various hard drives from my system. Adding the powered up drive to the running system is no problem with:
echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
Once the drive is mounted, if it is my "StarTrek" drive as an example, I can access it with:
ls /media/StarTrek
However, in order to remove the drive from the system so that I can replace it with a different drive requires that I know the "Device Name" - sd? where ? is the device letter index - for the drive in order to use the commands:
hdparm -y /dev/sd? <-- Spin down the drive
echo offline > /sys/block/sd?/device/state <-- Prevent the drive from being restarted and remounted
echo 1 > /sys/block/sd?/device/delete <-- Totally remove all traces of the drive from the system
QUESTION:
Since my drive configuration varies, how do I "Quickly & Easily" determine what device name is mapped to SCSI channel 0 0 0 0 or to /media/StarTrek (as an example) for any given system configuration? SDA, SDB, SDC, and SDD are generally reserved for the 4 flash card slots on my MultiMedia interface. The next open letter gets assigned when I load the hard drive, but it depends on what USB drives I have added or removed from the system before I load the hard drive.
Surely there has to be a simple terminal command line to show the map of SCSI Channels or Media Names to Device Names. Thank you for any and all comments, suggestions, and assistance.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
=============================================
Linux Mint 8, Mint 10, & Mint 13 LiveDVD systems
I have a drive drawer on my system which is cabled to the SATA-0 channel and which I use to load and remove various hard drives from my system. Adding the powered up drive to the running system is no problem with:
echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
Once the drive is mounted, if it is my "StarTrek" drive as an example, I can access it with:
ls /media/StarTrek
However, in order to remove the drive from the system so that I can replace it with a different drive requires that I know the "Device Name" - sd? where ? is the device letter index - for the drive in order to use the commands:
hdparm -y /dev/sd? <-- Spin down the drive
echo offline > /sys/block/sd?/device/state <-- Prevent the drive from being restarted and remounted
echo 1 > /sys/block/sd?/device/delete <-- Totally remove all traces of the drive from the system
QUESTION:
Since my drive configuration varies, how do I "Quickly & Easily" determine what device name is mapped to SCSI channel 0 0 0 0 or to /media/StarTrek (as an example) for any given system configuration? SDA, SDB, SDC, and SDD are generally reserved for the 4 flash card slots on my MultiMedia interface. The next open letter gets assigned when I load the hard drive, but it depends on what USB drives I have added or removed from the system before I load the hard drive.
Surely there has to be a simple terminal command line to show the map of SCSI Channels or Media Names to Device Names. Thank you for any and all comments, suggestions, and assistance.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA