SLES 12.2 udev and LVM vs /dev/disk/by-uuid and LVM

Hi,

I want to use udev to provide unique bock device names and LVM for our Oracle Database Server.
In the past we did this with oracle Linux but now we switch to SLES12.2
The SLES Linux system is running on VMWare 6 some disks are raw devices and some vmware virtual Disks.

We have two data-store one for backup and one for database files. Sometimes we need to add and remove disks
from the system and we decide to use udev to get unique names for our block devices.

/dev/sdd1 → back_disk1
/dev/sde1 → back_disk2 …

/dev/sdk1 → data_disk1
/dev/sdm1 ->data_disk2
/dev/sdq1 → data_disk3 …

After providing the unique names we use LVM to create two big Data-store backup and oradata.

/u01/backup

Q: Do we think in the right way or we better use /dev/disk/by-uuid

Greetings Till

Hi Till,

could you please let us know a bit more on the problem you’re trying to solve by unique (or rather “descriptive”) names?

From what I understood you’ll use back_disk1, back_disk2,… as physical volumes for an LVM volume group “backup” (and the same for data_disk* to “oradata” ). Is adding these PVs to the corresponding VG a manual task?

If everything is somewhat automated (detecting the block device, partitioning it with a single partition, giving the partition’s block device a proper name, later on creating a PV on the (renamed) block device, adding it to the VG), wouldn’t it be easier to use udev to immediately create the PV and add that to the proper VG? Once the PV is added, LVM will use the VG ID stored on the PV to re-assemble the PVs on boot or whenever you start your VG.

Regards,
J

Hey J,

I do not know enough about udev. I think you understand this right and I read something about the magic udev can do as you wrote. I have done all the LVM stuff(vgcreate/lvcreate/vgextend) by Hand after the udev set the SYSLINKs for the devices. /dev/back_disk1

If I understand your post right udev can do this all automatically right ?

Again, sometimes we need to temporary increase the space for the backup area and additional increase the space for the database area.

First I add two now disks into the VM.
Than I add /dev/sdk1 to the backup space and /dev/sdl1 permanent to the database area.

After we do not need /dev/sdk1 anymore in the backup area and delete it from the system /dev/sdl1(for database data) became /dev/sdk1 after a reboot right ?

So I thought the right way is to use unique names over udev.
#>cat /etc/udev/rules.d/99-oracle.rules
KERNEL==“sdk1”, SYMLINK+=“back_disk1”, OWNER=“oracle”, GROUP=“oinstall”, MODE=“0660”

I hope that make things more clear.

I think the answerer of my question may. Yes use UDEV it can do anythink you need.

You agree ?

Greetings Till

Hi Till,

it sounds to me as if you fear that because the block device name may change after reboot, the according (differently named) block device will not get added to the VG after reboot. Maybe you’re under the impression that adding the PV “/dev/sdl1” to the VG will add that device name to some VG metadata.

But it is the other way around: When you add a PV to a VG, a reference to the VG is stored on the PV and once the PV becomes available, udev will try to assemble the VG. This is not depending on block device names.

So unless I misunderstood your use case, you can simply add “/dev/sdl1” to the VG, later on remove “/dev/sdk1” from the other VG (as well as from the system), reboot, and still have “the block device formerly known as /dev/sdl1” automatically added to its VG , no matter what block device name it will use after reboot.

If I got you wrong, please let me know.

Regards,
J