One can realize that him/her wants to change the label/name of their Linux SoftRAID, which is already used in production - and should stay like that.
[SOLUTION]
1) Unmount any RAID you want to rename.
2) Stop the RAIDs:
Code: Select all
$ sudo mdadm --stop /dev/mdX
3) Rename the RAID:
Code: Select all
$ sudo mdadm --assemble /dev/mdX --name=a_new_name --update=name /dev/disk/disks_of_this_raid
Code: Select all
$ sudo mdadm --assemble /dev/md1 --name=dlp_raid_1 --update=name /dev/disk/by-path/pci-0000\:02\:04.0-scsi-*-part1
Code: Select all
$ sudo mdadm --detail /dev/mdX | grep Name
Without this step, the RAID will be started, but set to "auto-read-only".
Code: Select all
$ sudo mdadm --readwrite /dev/mdX
The "/dev/disk/by-label" for accessing/mounting your RAID devices does not use the MD-RAID names, but the ones of the filesystem.
For XFS, you can update the filesystem label using "xfs_admin -L Name". For example:
Code: Select all
$ sudo xfs_admin -L dlp_raid_1 /dev/md1
- Reboot
- Manually update the symlinks in /dev/disk/by-label to reflect your new name(s)
Thanks to: