fix disk device names

Latest response

Hello, I'm running some VM on VMware ESX 4.1 with RHEL 5.6 64bit. So far i extended some LV by adding some disks to their VG. So far so good. Now i would like to consolidate some smaler disk into a big one. Afterwards all the smaller ones will be removed.

 

As I know so far the name schema for disk devices is according to their place (1st, 2nd, 3rd, ... disk device => /dev/sda, /dev/sdb, /dev/sdc, ...).

As my VM instance is able to have some scsi controllers i would like to use one for each VG. This would make the disk management much easier to identify the right disk in VMware and on the RHEL system in case i need to change (delete) one.

 

Unfortunateely I'm afraid that as soon as i remove one disk device the later onces will get a new device name and replace the earlier deleted one. Is there a trick available to use fixed device names i can use with LVM and the system to ensure any deletion and addition of disks in between the line will not result in a different name for already used disk devices ?

 

So far i know other unix systems, i.e. HP-UX are able to manage it. I hope linux is as well able to do so.

 

Thanks a lot for any helpfull information

Holger

Responses

You'd be looking to pvmove the data off the small devices to the larger devices.

 

Once that's done, if you're concerned about persistent naming, you can chose to either reference the remaining devices by UUID or use something like udev to persistently map UUIDs to a give /dev/${DEVNAME}. Though, if you're only ever going to reference your filesystems by LV names, the step of mapping UUIDs to specific /dev/${DEVNAME} is probably going to be kind of an "over-kill" thing to do.

 

There's actually a lot of good data out there on the topic. Usually, when forcing name-mappings, you're going to be mapping to a custom /dev/${DEVNAME}, rather than a /dev/sdX name.

This link references a useful tutorial for persistent naming for RHEL5/6 using udev:
http://www.linuxtopia.org/online_books/rhel6/rhel_6_virtualization/rhel_6_virtualization_sect-Virtualization-Virtualized_block_devices-Configuring_persistent_storage_in_Red_Hat_Enterprise_Linux_5.html