FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-04-2009, 10:53 AM
Alex Samad
 
Default Distinguishing SATA disks

On Wed, Feb 04, 2009 at 11:23:06AM +0000, Hendrik Boom wrote:
> I'm currently running an etch system, soon to be updated to Lenny.
>
> I recently installed two identical internal SATA disks and spend a few
> days bad-block testing them. They passed.
>
> They show up as /dev/sda and /dev/sdb.
>
> As far as I know, these /dev designators are dynamically assigned at boot

yes, they are dynamically assign by the driver modules that are loaded
at boot time and the driver modules check the pci bus in sequential
order each time, so unless you are changing the physical layout of the
pci bus on your machine don't worry.

Other times to worry when you are talking to san LUN, there might be a
change of a LUN timing out.



> time. (I've had previous problems with multiple eth devices, solved by
> removing the ones I didn't need).
>
> 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?

you can use udev rules to find the id of the device, another way is to
rely on LABELS or UUID for partitions instead of device names.


>
> -- hendrik
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"We ought to make the pie higher."

- George W. Bush
02/15/2000
South Carolina Republican Debate
 
Old 02-04-2009, 11:03 AM
Frederik Kriewitz
 
Default Distinguishing SATA disks

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.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-04-2009, 11:48 AM
Paul Cartwright
 
Default Distinguishing SATA disks

On Wed February 4 2009, Hendrik Boom 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?

/dev/disk/by-uuid/686C-7E81 /media/usb_DAWGS vfat
users,atime,rw,nodev,noexec,nosuid,noauto 0 0

this is an entry in .etc.fstab for a USB external drive, but it works the same
for any drive.. you just need to find the UUID name for your device

--
Paul Cartwright
Registered Linux user # 367800
Registered Ubuntu User #12459


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-04-2009, 01:21 PM
Hendrik Boom
 
Default 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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-04-2009, 03:02 PM
Frederik Kriewitz
 
Default Distinguishing SATA disks

On Wed, Feb 4, 2009 at 3:21 PM, Hendrik Boom <hendrik@topoi.pooq.com> wrote:
> Fun. Lost of symlinks. Can I use these to identify the drives to be used
> in RAID pairs or for LLVM?

Yes

> 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.

There might be duplicate UUIDs. Have a look at the blkid and/or vol_id tool(s).
In case of a raid/lvm (or in any other case of a logical device) I use
the named devices in /dev/mapper/ to mount them.
I use the by-path links for identifying disks by there physical
position (e.g. in a bay) or the model/serial-number links in
/dev/disk/by-id to identify a specific device independent of it's
physical position/connection.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 05:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org