LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-27-2014, 07:48 AM   #1
cothgr
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Rep: Reputation: Disabled
Question udev: persistent scsi disk names


I have one IDE Controller and one SATA Controller. SATA has two slots.
How can I bind disk names in /dev to disk location by using udev, i.e
- IDE disk should be named /dev/sda;
- SATA 1 disk should be named /dev/sdb;
- SATA 2 disk should be named /dev/sdc?

There are addresses of disks:
- IDE : pci-0000:00:1f.1-scsi-0:0:0:0;
- SATA 1: pci-0000:00:1f.2-scsi-0:0:0:0;
- SATA 2: pci-0000:00:1f.2-scsi-0:0:1:0.
 
Old 06-27-2014, 02:51 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,328

Rep: Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331
The persistent names for disks are not the sda, sdb, etc. Init for different disk controllers runs in parallel, so those names are not guaranteed to be the same after reboot. Udev creates persistent names of the form:

Quote:
/dev/disk/by-uuid/39b99e5f-a117-44ee-a093-036b410b813d
which will always link to the same physical drive. To boot from this you would put this line in /etc/fstab
Quote:
UUID=39b99e5f-a117-44ee-a093-036b410b813d /boot ext4 defaults 1 2
 
Old 06-27-2014, 03:28 PM   #3
cothgr
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
I can't use UUID, because different disks can be inserted in the slot. I wanna guarantee that any disk inserted in the first slot of SATA controller named sdb, in the second slot - sdc.
 
Old 06-27-2014, 04:44 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,361

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
"Persistent naming methods

There are four different schemes for persistent naming: by-label, by-uuid, by-id and by-path. For those using disks with GUID Partition Table (GPT), two additional schemes can be used by-partlabel and by-partuuid. You can also use static device names by using Udev. "

https://wiki.archlinux.org/index.php...naming_methods

If you could control bios order then that could be a way.

Newer linux is moving to the BSD model where everything has a location. Not sure that is on disk's yet but maybe.
 
  


Reply

Tags
udev, udev rules


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
UDEV: Persistent disk-name Absolon Linux - Hardware 9 02-17-2013 08:17 PM
reset/remove udev persistent-net-rules cccc Debian 3 06-29-2012 11:46 AM
Mapping /proc/scsi/scsi entries with respective device names in /dev/ directory neo3matrix Red Hat 2 04-21-2011 06:56 AM
Changing UDEV persistent naming schemes orbit Slackware 5 04-21-2008 09:22 PM
LXer: Persistent names for devices LXer Syndicated Linux News 0 04-19-2008 05:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 PM.

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