How to change the disk label

Latest response

I wanted to change the disk labels in RHEL 7.4 For Ex : from /dev/sdb to /dev/sdb . Is it possible to change the disk labels once the installation is done . This should be a peramanent change even after reboot.

Please suggest a solution

thanks/regads
sadiq

Responses

Hi Sadiq,

The most easy and most safe way to make changes to disks and partitions would be by using GParted.
Download the .iso file, create a bootable medium, boot from that medium and start your operations. :)

Regards,
Christian

Can i use the udev rules to achieve the same result

https://access.redhat.com/solutions/1135513

Well, I don't know Sadiq, it's not quite clear to me what you mean and what exactly you're trying to achieve.
And "changing the disk label from /dev/sdb to /dev/sdb" is not really something like a change, I would say.
Anyway ... all I can say is that it's generally NOT recommended to work on running disks, it might do harm.

Regards,
Christian

Sorry i wanted to change the DISKNAME from /dev/sdb to /dev/sdc . I have few SATA disks which i want to rename .

The output of udevadm is as below for sdb . I want to change it to sdc . Is there any simple method . I have to do it on a set of servers ,

udevadm info --query=all --path=/block/sdb P: /devices/pci0000:5b/0000:5b:00.0/0000:5c:00.0/host7/port-7:1/end_device-7:1/target7:0:0/7:0:0:0/block/sdb N: sdb S: disk/by-id/ata-MB6000GVYZB_ZAD3F4RW S: disk/by-id/wwn-0x5000c500afaba7ec S: disk/by-path/pci-0000:5c:00.0-sas-0x31402ec0100d5e00-lun-0 E: DEVLINKS=/dev/disk/by-id/ata-MB6000GVYZB_ZAD3F4RW /dev/disk/by-id/wwn-0x5000c500afaba7ec /dev/disk/by-path/pci-0000:5c:00.0-sas-0x31402ec0100d5e00-lun-0 E: DEVNAME=/dev/sdb E: DEVPATH=/devices/pci0000:5b/0000:5b:00.0/0000:5c:00.0/host7/port-7:1/end_device-7:1/target7:0:0/7:0:0:0/block/sdb E: DEVTYPE=disk E: ID_ATA=1 E: ID_ATA_DOWNLOAD_MICROCODE=1 E: ID_ATA_FEATURE_SET_PM=1 E: ID_ATA_FEATURE_SET_PM_ENABLED=1 E: ID_ATA_FEATURE_SET_SMART=1 E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 E: ID_ATA_ROTATION_RATE_RPM=7200 E: ID_ATA_SATA=1 E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1 E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1 E: ID_ATA_WRITE_CACHE=1 E: ID_ATA_WRITE_CACHE_ENABLED=0 E: ID_BUS=ata E: ID_MODEL=MB6000GVYZB E: ID_MODEL_ENC=MB6000GVYZB\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20 E: ID_PATH=pci-0000:5c:00.0-sas-0x31402ec0100d5e00-lun-0 E: ID_PATH_TAG=pci-0000_5c_00_0-sas-0x31402ec0100d5e00-lun-0 E: ID_REVISION=HPG3 E: ID_SERIAL=MB6000GVYZB_ZAD3F4RW E: ID_SERIAL_SHORT=ZAD3F4RW E: ID_TYPE=disk E: ID_WWN=0x5000c500afaba7ec E: ID_WWN_WITH_EXTENSION=0x5000c500afaba7ec E: MAJOR=8 E: MINOR=32 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=6434

Hi Sadiq,

This is definitely not possible, you have to unplug the disks and re-plug each of them back into the matching slot. :)

Regards,
Christian

Can i use udev rules for creating a symlink to the disks and then use it as a source for my Ceph OSDs.

The purpose is to see the disks as same names in all the Ceph Data Nodes .

Currently the disk names are of different sizes and the names are not consistent across the ceph nodes . I am doing this to make all the disk names to be consistent so that i can use ansible to manage them .

Need your expert advise . And thanks for your prompt support

You're very welcome, Sadiq, but no - you cannot "rename" devices ... these are devices, not labels - so it is hardware related : open the PC and rearrange the disks ... put the disk sdb into the slot of sdc and the disk sdc into the slot of sdb. Re-installation of GRUB boot loader might be necessary when you put the disk on which the system is installed into another slot and you'll have to edit the /etc/fstab file. When the system is installed on a machine with EFI based BIOS and if it is installed on a GPT disk in EFI mode, it might be sufficient to use efibootmgr to correct the entries. :)

Regards,
Christian

Thanks for the suggestion . i will try that but the problem is the disks sda and sdd is mirrored . When i rearrange the disks sdd will be replaced by sdc . they are mirrored so i have to break the mirror before doing hardware change .

lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223.6G 0 disk ââsda1 8:1 0 5G 0 part â ââmd126 9:126 0 5G 0 raid1 /boot ââsda2 8:2 0 201M 0 part â ââmd125 9:125 0 201M 0 raid1 /boot/efi ââsda3 8:3 0 218G 0 part ââmd127 9:127 0 217.9G 0 raid1 âârhel-root 253:0 0 20G 0 lvm / âârhel-swap 253:1 0 32G 0 lvm [SWAP] âârhel-usr 253:2 0 20G 0 lvm /usr âârhel-var 253:3 0 100G 0 lvm /var âârhel-home 253:4 0 20G 0 lvm /home sdc 8:32 0 5.5T 0 disk sdd 8:48 0 223.6G 0 disk ââsdd1 8:49 0 5G 0 part â ââmd126 9:126 0 5G 0 raid1 /boot ââsdd2 8:50 0 201M 0 part â ââmd125 9:125 0 201M 0 raid1 /boot/efi ââsdd3 8:51 0 218G 0 part ââmd127 9:127 0 217.9G 0 raid1 âârhel-root 253:0 0 20G 0 lvm / âârhel-swap 253:1 0 32G 0 lvm [SWAP] âârhel-usr 253:2 0 20G 0 lvm /usr âârhel-var 253:3 0 100G 0 lvm /var âârhel-home 253:4 0 20G 0 lvm /home sde 8:64 0 5.5T 0 disk sdf 8:80 0 5.5T 0 disk sdg 8:96 0 5.5T 0 disk sdh 8:112 0 5.5T 0 disk sdi 8:128 0 5.5T 0 disk sdj 8:144 0 5.5T 0 disk sdk 8:160 0 5.5T 0 disk sdl 8:176 0 5.5T 0 disk sdm 8:192 0 5.5T 0 disk sdn 8:208 0 5.5T 0 disk sdo 8:224 0 5.5T 0 disk sdp 8:240 0 745.2G 0 disk sdq 65:0 0 745.2G 0 disk

Well, Sadiq, to be honest : I think you should better not touch the RAID setup - you might end up in a mess.
These tasks are something for very, very advanced users, this is not something considered to being trivial. :)

Regards,
Christian

What is the best recommended procedure . Do i have to reformat the OS and Install from scratch after rearranging the disks .

And also are the below disks interchangeable since the disks are of different size on HP DL380 Gen10

[4:0:0:0] disk ATA MR000240GWFLU HPG6 /dev/sdd 240GB [7:0:0:0] disk ATA MB6000GVYZB HPG3 /dev/sdc 6.00TB

Thanks Sadiq

Hi Sadiq,

Yes, in this case I think it might be the best option to first rearrange the disks and then to reinstall the system.
Another alternative would be to live with the situation (leave the disks with the "names and labels") as it is ... :)

Regards,
Christian

Just saw something ... is your name Sadiq and not Mohammed ? If this is the case, please tell me ... and - please excuse me ! :)

Regards,
Christian

I cannot live with it since we have 19 nodes with different orientation of disks . It would be difficult to mange all the disks individually . I would prefer to use ansible to manage all the disks .

In that case i cannot live with the situation , I have to workaround to achive my objective .

BTW i am usually called with Sadiq

Thanks/Regards Sadiq

Hi Sadiq, I'm going to edit my posts and correct the name there, please excuse me for having called you wrongly.
By the way, if you have to reinstall the system, you may want to consider installing the latest edition RHEL 7.5. :)

Regards,
Christian

are the below disks interchangeable since the disks are of different size on HP DL380 Gen10

[4:0:0:0] disk ATA MR000240GWFLU HPG6 /dev/sdd 240GB [7:0:0:0] disk ATA MB6000GVYZB HPG3 /dev/sdc 6.00TB

Hi Sadiq,

If you mean the capacity of the disks (240 GB and 6.00 TB) with "size" ... well, this shouldn't matter at all. :)
Of course the connectors of the disks have to fit into slots, so you have to try it out. It's not possible for me
to give you 100% correct advises, because I don't "sit in front of your hardware" and only have partial infos.

Regards,
Christian

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.