Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
device mapper scrambles drive order - SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2383
Location: Kentucky

PostPosted: Tue Apr 14, 2009 2:10 pm    Post subject: device mapper scrambles drive order - SOLVED Reply with quote

I love the device mapper, and all the great things it does, but I am now working with my first hot-swappable machine, and it has 5 SATA hot-swappable slots. One of these, the left-most slot, is the boot device, so it always comes up as /dev/sda, but the other drives only come up as sdb thru sde if they are fully populated at boot. If a drive is missing at boot time, that slot is simply ignored and the next populated slot gets assigned the next available drive identifier. This can get extremely confusing.

To further complicate matters, if I pull a drive and then repopulate as a hot swap operation, assuming that all other slots are populated, it maintains its former drive identifier, but if I pull multiple drives then repopulate them in a different order, all the drive identifiers seem to get allocated on a lexicographically first identifier gets allocated first basis, which means there is no reliable correlation between drive identifiers -- like /dev/sda, dev/sdb, etc. -- and actual physical positions in the hot swap chassis.

In order to make this workable, especially for non-technical people, I need a way to tell the operator to remove or insert a drive into or from a particular physically identifiable position in the chassis.

How do I anchor the drive identifiers and permanently associate them with a particular physical slot?

Is there any way to physically blink the drive select led at a controlled rate without actually doing anything to the drive itself? This would make it easier for the operator to determine which slot needed attention. I realize this might be difficult to do if the slot is empty.

As a side question, how can I label the drives themselves (not the physical slots) so that the label is machine readable? I know there is a way to do this, but its been so long since I have used this feature that I forget how it works. Some of these drives will be part of a RAID. The XFS filesystem will be the principle filesystem in use, but it must also be able to handle other filesystems, so the label needs to be associated with the physical disk drive, along with the partitioning information, not with the filesystem.

Thanks for any help! :D
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.


Last edited by Moriah on Thu Apr 16, 2009 11:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 513
Location: San Diego, California USA

PostPosted: Wed Apr 15, 2009 6:08 am    Post subject: Reply with quote

You should be able to do this with udev, I would think.

Try:
Code:

# udevinfo --query=all --name=/dev/sda
P: /block/sda
N: sda
S: disk/by-id/scsi-SATA_WDC_WD5000AAKS-_WD-WCAPW4062480
S: disk/by-id/ata-WDC_WD5000AAKS-22TMA0_WD-WCAPW4062480
S: disk/by-path/pci-0000:00:09.0-scsi-0:0:0:0
E: ID_VENDOR=ATA
E: ID_MODEL=WDC_WD5000AAKS-2
E: ID_REVISION=12.0
E: ID_SERIAL=SATA_WDC_WD5000AAKS-_WD-WCAPW4062480
E: ID_SERIAL_SHORT=WD-WCAPW4062480
E: ID_TYPE=disk
E: ID_BUS=scsi
E: ID_ATA_COMPAT=WDC_WD5000AAKS-22TMA0_WD-WCAPW4062480
E: ID_PATH=pci-0000:00:09.0-scsi-0:0:0:0



Then create a file in /etc/udev and create some rules like:

Code:

KERNEL=="sd[0-9]*", ENV{ID_SERIAL_SHORT}="WD-WCAPW4062480", SYMLINK+="disk/slot0"



This should create a device "/dev/disk/slot0". Repeat that for the rest of your drives.

Or you can just use the links created by default in /dev/disk/...
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2383
Location: Kentucky

PostPosted: Thu Apr 16, 2009 11:15 pm    Post subject: Reply with quote

The /dev/disk/by-path directory was just what I needed.

Thanks! :D
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum