[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Distinguishing SATA disks



On Wed, 04 Feb 2009 13:03:39 +0100, Frederik Kriewitz wrote:

> On Wed, Feb 4, 2009 at 12:23 PM, Hendrik Boom <hendrik@topoi.pooq.com>
> wrote:
>> How can I ensure that the same /dev's are always associated with the
>> same physical drives?  Or am I misunderstanding something here and has
>> the problem become obsolete?
> 
> Have a look at the /dev/disk/by-* directories. There you'll find several
> symlinks to your disks which can be used instead of /dev/sdX.


Fun. Lost of symlinks.  Can I use these to identify the drives to be used
in RAID pairs or for LLVM?

by path and by-id seem to work, but by-uuid is worrisome:


by-path and by-id seems to get them all, including all their partitions.
by-id seems even to list the SATA drive (and each of its partitions) twice.

/dev/disk/by-id:
total 0
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 ata-ST3750640AS-5QD4R5CW -> ../../sdb
lrwxrwxrwx 1 root root 10 2009-01-21 11:19 ata-ST3750640AS-5QD4R5CW-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 ata-ST3750640AS-5QD4Z81L -> ../../sda
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 ata-ST3750640AS-5QD4Z81L-part1 -> ../../sda1
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 ata-WDC_WD2500JB-00GVC0_WD-WMAL73372696 -> ../../hda
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 ata-WDC_WD2500JB-00GVC0_WD-WMAL73372696-part1 -> ../../hda1
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 ata-WDC_WD2500JB-00GVC0_WD-WMAL73372696-part2 -> ../../hda2
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 ata-WDC_WD2500JB-00GVC0_WD-WMAL73372696-part3 -> ../../hda3
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 scsi-SATA_ST3750640AS_5QD4R5CW -> ../../sdb
lrwxrwxrwx 1 root root 10 2009-01-21 11:19 scsi-SATA_ST3750640AS_5QD4R5CW-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 scsi-SATA_ST3750640AS_5QD4Z81L -> ../../sda
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 scsi-SATA_ST3750640AS_5QD4Z81L-part1 -> ../../sda1
lrwxrwxrwx 1 root root  9 2009-02-04 06:41 usb-ST350064_1A_0 -> ../../sdc
lrwxrwxrwx 1 root root 10 2009-02-04 06:41 usb-ST350064_1A_0-part1 -> ../../sdc1

/dev/disk/by-path:
total 0
lrwxrwxrwx 1 root root  9 2009-02-04 06:41 pci-0000:00:0b.1-usb-0:2:1.0-scsi-0:0:0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 2009-02-04 06:41 pci-0000:00:0b.1-usb-0:2:1.0-scsi-0:0:0:0-part1 -> ../../sdc1
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 pci-0000:00:0d.0-ide-0:0 -> ../../hda
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 pci-0000:00:0d.0-ide-0:0-part1 -> ../../hda1
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 pci-0000:00:0d.0-ide-0:0-part2 -> ../../hda2
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 pci-0000:00:0d.0-ide-0:0-part3 -> ../../hda3
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 pci-0000:00:0e.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 pci-0000:00:0e.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root  9 2009-01-21 10:53 pci-0000:00:0e.0-scsi-1:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 2009-01-21 11:19 pci-0000:00:0e.0-scsi-1:0:0:0-part1 -> ../../sdb1

by-uuid seems to miss one of the SATA drives completely, although it 
does list one SATA drive, the IDE drive, and the plugged-in USB drive.
And although the symbolic links point to partitions, it doesn't
mention anything but the first partition on /dev/sda1.

/dev/disk/by-uuid:
total 0
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 233b1187-918e-4d12a396-5ea2242912f4 -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-01-21 10:53 ab38a373-751e-4aff-98ab-89cda2c54726 -> ../../hda1
lrwxrwxrwx 1 root root 10 2009-02-04 06:41 f7b4688d-ad49-4a6d-88ca-77c6865ff894 -> ../../sdc1

Nor does it list my llvm or RAID devices here.  Presumably that's because 
they aren't real disks, and I should seek them elsewhere.

But I'm wondering about the missing SATA drive by-uuid.  Its first
partition is mounted as /dev/sdb1, and I can read and write it.


-- hendrik


Reply to: