current lvm function questions
Hi, sorry to ask what might be FAQs, but I couldn't find the answers on the list archive or the HOWTO. There may be overlap in my interests between lvm and md, so please straighten me out.
Area 1: Stable device naming.
Is there a way in Linux to get a stable name for a disk that survive reconfiguration and discovery randomization?
One of the things linux has problems with is stable device naming. If you pull a disk out of a chain, the following devices will move up in the /dev entries, and not have the same name they had before. This can be a real problem with massive storage subsystems.
I know of two ways of handling this. (1) is to slap a label on the disk, and make sure it shows up as the device in the label when the disk is discovered. (2) is to keep a separate database mapping devices to fixed locations. I think the label is the best idea.
It seems to me that lvm already slaps a label on the disk when it does pvcreate. What i'm not sure of is whether the label used is (a) globally unique and suitable for stable device naming, or (b) tied to the device it happened to be on at the time the pvcreate was issued.
Specifically, if a pv/vg/lv is created on /dev/sda6, and a subsequent reconfig has that partition show up as /dev/sdb3, does it still show up as /dev/lvname?
2. Raw device access
Can lvm volumes be accessed as raw devices? If so, how? Is there /dev/rlvname?
I'm sure /dev/fs falls in here somewhere...
thanks!
-dB
Quoted 3 lines · David Brower
Specifically, if a pv/vg/lv is created on
/dev/sda6, and a subsequent reconfig has that partition show up as/dev/sdb3, does it still show up as/dev/lvname?
This is exactly what LVM is great for. I put 4 ide disks in a box and moved them all over from primary/secondary/master/slave and the box boots fine every time. Very cool stuff. Try moving disks around without lvm. It is a pain.
eric
Quoted 5 lines · David Brower
Area 1: Stable device naming.
Is there a way in Linux to get a stable name for a disk that survive reconfiguration and discovery randomization?
Yes, there are programs to create SysV style LUN device nodes after the SCSI scan. Look for scsidev or scsidev2.
Quoted 5 lines
It seems to me that lvm already slaps a label on the disk when it does pvcreate. What i'm not sure of is whether the label used is (a) globally unique and suitable for stable device naming, or (b) tied to the device it happened to be on at the time the pvcreate was issued.
LVM uses an UUID iirc. ext2 does too BTW (and newer mount even supports mounting by UUID without lvm). An UUID aims to be globally unique.
Quoted 2 lines
Can lvm volumes be accessed as raw devices? If so, how? Is there
/dev/rlvname?
Sure. Usually it is a /dev/VG/LVname though. Just bind a raw device to them.
-Andi
Quoted 6 lines · Andi Kleen
Quoted 4 lines
disk when it does pvcreate. What i'm not sure of is whether the label used is (a) globally unique and suitable for stable device naming, or (b) tied to the device it happened to be on at the time the pvcreate was issued.
LVM uses an UUID iirc.
No, it does not (yet).
Christoph
Signature · 1 line
Always remember that you are unique. Just like everyone else.
Quoted 5 lines · David Brower
Area 1: Stable device naming.
Is there a way in Linux to get a stable name for a disk that survive reconfiguration and discovery randomization?
There are lots ...
a) use scsidev(2) (for scsi disks only)
b) use devfs
c) use the linux software raid driver
d) use a hardware raid controller that has it's
own devfs-like naming scheme (ami, compaq)
e) use lvm - also it does not use UUIDs yet,
vgscan should detect all pvs of a vg.
f) mount you disk by-label instead of by-device
(LABEL: or UUID: entries in /etc/fstab)
Quoted 3 lines
Specifically, if a pv/vg/lv is created on
/dev/sda6, and a subsequent reconfig has that partition show up as/dev/sdb3, does it still show up as/dev/lvname?
It should. (but it's called /dev/vgname/lvname)
Quoted 4 lines
2. Raw device access
Can lvm volumes be accessed as raw devices? If so, how?
Yes - in Linux 2.4 (or 2.2 w/ patches) you can simply bind a raw device to any blockdevice. See raw(8) for details. The device name will be /dev/raw/X
Quoted 1 line
Is there
/dev/rlvname?
Nope.
Christoph
Signature · 1 line
Always remember that you are unique. Just like everyone else.