3

Is it possible to pvcreate a pv by any more unique means than the standard "/dev/sdX"?

The reason is the external multiple hard drive dock and dev mapper on my system don't always assign the same "/dev/sdX" at boot. I work around this with ext4 mounts in fstab by mounting by uuid, otherwise the results could be disastrous reads/writes to the wrong disk.

1
  • 2
    That's not an obvious reason in itself. Typically pvcreate is a one-off operation. Re-numbering the disks afterwards won't cause any problem.
    – sourcejedi
    Commented Dec 5, 2016 at 16:31

2 Answers 2

2

You could use any of the names that appear up with the command as follows.

ll /dev/disk/by-*

Which are obviously symlinks to the corresponding /dev/sdx device again.

2
  • not by-path though :-P
    – sourcejedi
    Commented Dec 5, 2016 at 16:21
  • and presumably not by-uuid. Which leaves partuuid (if using GPT) and by-id, particularly by-id/wwn-* if possible, and again presumably not lvm-pv-uuid-*.
    – sourcejedi
    Commented Dec 5, 2016 at 16:25
0

You'll have to read the man lvm.conf manpage for a full explanation but your LVM filter is probably set up to ignore the disks. On my system it's set to filter = [ "a/.*/" ] which adds (hence the a) anything that matches the given regexp (which is /.*/, i.e everything). Your LVM filter may include some rejects (which would be indicates by a r).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .