1 |
On Wed, Aug 1, 2012 at 6:59 PM, Canek Peláez Valdés <caneko@×××××.com> wrote: |
2 |
> On Wed, Aug 1, 2012 at 6:34 PM, Alex Schuster <wonko@×××××××××.org> wrote: |
3 |
>> Hi there! |
4 |
>> |
5 |
>> I do not understand the numbering of my hard drives. There may be some |
6 |
>> inherent logic, but whenever I make some changes, like replacing drives, |
7 |
>> or changing BIOS settings, the order changes. Maybe it's even more random. |
8 |
>> |
9 |
>> So I made some udev rules like this, and my drives are called /dev/hd1, |
10 |
>> hd2 and hd3: |
11 |
>> |
12 |
>> SUBSYSTEMS=="scsi", KERNEL=="sd?", ATTRS{model}=="SAMSUNG HD154UI", |
13 |
>> SYMLINK="hd1" |
14 |
>> |
15 |
>> This works fine, and this way I can address them in scripts, smartd and |
16 |
>> hdparm config files and such. But now I have two identical drives. I had |
17 |
>> this before with the drive above, but while being identical models, the |
18 |
>> two drives differed a little in size, so I just had to add ATTR{size}. |
19 |
>> This does not help with my current drives, and I find nothing |
20 |
>> in /sys/block/sd?/device/ that differs. Could there be another way to |
21 |
>> distinguish the drives, like looking at the partition scheme or something? |
22 |
> |
23 |
> If you want to distinguish partitions, I would recommend using labels |
24 |
> (in fstab too); those never change unless you specifically change |
25 |
> them. Then, no matter how you put them in your machine, they will get |
26 |
> mounted correctly, and then you don't need to fuzz with udev rules. |
27 |
> Also, as a superficial bonus, they get mounted using the label and it |
28 |
> looks nice in your file browser. |
29 |
> |
30 |
> The drives themselves I see no reason to recognize them, why do you |
31 |
> need to do that? |
32 |
|
33 |
Oh, and I forgot; doesn't the links in /dev/disk/by-id, |
34 |
/dev/disk/by-label, /dev/disk/by-uuid do what you want to? |
35 |
|
36 |
Regards. |
37 |
-- |
38 |
Canek Peláez Valdés |
39 |
Posgrado en Ciencia e Ingeniería de la Computación |
40 |
Universidad Nacional Autónoma de México |