st wrote:
> Stefan Monnier wrote:
> > I see many people suggested UUIDs and other funny long names. What I
> > use instead: LVM. This way you get to name the "disks" and
> > "partitions" with meaningful names which only change when you decide
> > to change them.
>
> One simple question, though: if you have 2 similar HDDs and one
> of them starts to fail, how do you know which one it is?
I assume you mean which physical disk is which?
There are useful tools hdparm, smartctl, blkid, lsblk and probably
others too.
# hdparm -I /dev/sda
...
Model Number: ST340014A
Serial Number: 5JXC6GK4
# smartctl -i /dev/sda
Model Family: Seagate Barracuda 7200.7 and 7200.7 Plus family
Device Model: ST340014A
Serial Number: 5JXC6GK4
# smartctl -l error /dev/sda
...
No Errors Logged
Or it might say that is has logged errors. In either case you can now
write down the model and serial number of the disk drives both working
and giving errors. Then when you open the box up to replace it you
will be able to know which one is good and which one is bad.
If you were asking how do you map from lvm names to physical names
then that is through the pvs and pvdisplay commands.
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda5 vg0 lvm2 a- 36.77g 0
So for that example vg0 has a single /dev/sda5 partition. If you are
using raid it will look like this:
# pvs
PV VG Fmt Attr PSize PFree
/dev/md1 v1 lvm2 a-- 232.83g 8.90g
/dev/md2 v1 lvm2 a-- 298.02g 16.26g
/dev/md3 v1 lvm2 a-- 400.18g 168.89g
Then to map from /dev/mdX devices use mdadm --detail.
# mdadm --detail /dev/md1
Number Major Minor RaidDevice State
0 8 5 0 active sync /dev/sda5
1 8 21 1 active sync /dev/sdb5
Bob
Attachment:
signature.asc
Description: Digital signature