2016年5月28日星期六
how to change linux software raid md device name and lvm volume group name
Sometimes you want to move a harddisk or a raid set to other linux machine. But you will find that the raid and lvm setting will have error. It prompt you that the md name and/or lvm name encounter problem due to same name.(normally it caused by the default installation.) You can change the md name and lvm name as below:
connect the old harddisk or raid set in a computer which is no other harddisk and raid set.
--------------------------------------
change md name
start ubuntu live cd
apt-get install lvm2
if not yet installedin your ubuntu version
apt-get install mdadm
if not yet installedin your ubuntu version
Start with (assume your raid set is md127)
mdadm --detail /dev/md127
or if just only have incomplete raid set like one harddisk in raid 1.
(assume your harddisk partition is sda1)
mdadm --examine /dev/sda1
Version : 0.90
The first line or second line shows the metadata version used by this array. Now, stop the array:
mdadm --stop /dev/md127
mdadm --remove /dev/md127
And assemble it again using the new name. (metadata version is 1.0 or higher, use this:)
mdadm --assemble /dev/md3 /dev/sd[abcdefghijk]1 --update=name
For old metadata structure (most likely 0.90, as it allows for kernel auto-assembly), use this:
mdadm --assemble /dev/md3 --update=super-minor /dev/sd[abcdefghijk]1
-----------------------------------------
change vg name
boot linux rescue or ubuntu live cd/usb
in command prompt or terminal key in
lvm vgscan
lvm lvscan
lvm vgchange -a y
lvm pvscan
lvm lvscan
The last two commands should list your volume group(s) and logical volume(s). We use vgrename to change the name.
lvm vgrename VolGroup00 to-what-you-want-to-be
訂閱:
文章 (Atom)