Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 02-03-2009, 08:51 AM   #1
Registered: Jan 2008
Location: Cullompton
Distribution: Kubuntu
Posts: 36

Rep: Reputation: 15
How do I ensure a USB external HDD gets assigned the same SCSI id??

I have 3 WD External USB hard dives. 2 are the same and are rotated for backup purposes and my system assigns them both to /dev/sdb (one is only plugged in at a time), this is fine.

The 3rd drive is used for a different purpose and may or may not be plugged in at the same time as one of the others.

How can I make the 3rd drive be allocated to /dev/sdc all of the time whether one of the other drives is plugged in or not?

Old 02-03-2009, 09:56 AM   #2
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You should look into writing udev rules for your devices.
Old 02-03-2009, 10:04 AM   #3
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,826

Rep: Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973
You can use udev to set up hardware-specific devices. Simply add a rule to have it symlink the device to a particular /dev entry. It's probably better however to create and use a dedicated device with a memorable name like "backup_disk_a" than to try to mess with the traditional sd* devices.

And actually, udev has already set up some links for you. You can find permanent symlinks to each block device in the /dev/disk/by-whatever directories. You can use those to access the device you want, no matter what the /dev/sd* number is.
Old 02-03-2009, 10:08 AM   #4
Didier Spaier
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,694

Rep: Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611
I would try to write an udev rule for (re)naming it, based on its characteristics.
Old 02-03-2009, 02:50 PM   #5
LQ Newbie
Registered: Nov 2006
Location: Ventura California USA
Distribution: openSUSE
Posts: 23

Rep: Reputation: 3
If your goal is to always know where to access a drive, the /dev/disk/by-whatever method is good. Another simple way to do that is to give the disk a label. mlabel will label a disk formatted in some fat format, e2label will do so for ext2 and ext3 formatted disks. Most distros I've seen will dynamically create a folder under /media of the same name as the label and mount the disk there whenever it is plugged into the PC. Your only concern is keeping the label names unique.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
External ubuntu install on external USB HDD th3_tr00p3r Linux - Newbie 1 05-11-2008 02:56 PM
Second firewire external hdd enclosure fails to appear as a scsi device; iota Linux - Newbie 4 04-05-2007 09:07 PM
Can't connect External HDD: SCSI error: return code = 0x70000 MicahCarrick Linux - Hardware 2 08-29-2006 02:55 PM
no sign of external scsi hdd on boot takahaya Linux - Hardware 16 05-20-2005 05:20 AM
Fuji M603, SCSI device not assigned via USB anotherlimey Linux - Laptop and Netbook 5 03-14-2004 02:13 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration