RAID Change name


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.


linux: http://ram.kossboss.com/mdadm-change-homehost-mdadm-change-name/

hostname used by mdadm = cat /proc/sys/kernel/hostname

mdadm --stop /dev/md1

mdadm -A /dev/md1 /dev/sd[ab]2 --homehost=storage --update=homehost

mdadm -A /dev/md1 /dev/sd[abcdefg]3 --name=datamain --update=name

mdadm --uuid=5aca85f3:00732bdc:94229e06:8d9847b7 --update=super-minor --assemble /dev/md1


verifique o superblock assim:
mdadm -E /dev/sda2
mdadm -D /dev/md1


depois faça o update do /etc/mdadm/mdadm.conf 

nano /etc/mdadm/mdadm.conf 

ou

mdadm --detail --scan >> /etc/mdadm/mdadm.conf

que vai acrescentar algo do tipo:
ARRAY /dev/md/2 metadata=1.2 name=storage:2 UUID=492e21bb:dff72211:cc7d9c8f:b44f09b7
ARRAY /dev/md/1 metadata=1.0 name=ix2-200-THUBCE:1 UUID=5aca85f3:00732bdc:94229e06:8d9847b7

o comando abaixo da o mesmo resultado:
mdadm -Es
ARRAY /dev/md/2 metadata=1.2 UUID=492e21bb:dff72211:cc7d9c8f:b44f09b7 name=storage:2
ARRAY /dev/md/1 metadata=1.0 UUID=5aca85f3:00732bdc:94229e06:8d9847b7 name=ix2-200-THUBCE:1


after changing mdadm.conf you must update init ram for booting correctly:
update-initramfs -u





--update=
Update the superblock on each device while assembling the array. The argument given to this flag can be one ofsparc2.2summariesuuidnamehomehostresyncbyteorderdevicesizeno-bitmap, or super-minor.

The super-minor option will update the preferred minor field on each superblock to match the minor number of the array being assembled. This can be useful if --examine reports a different "Preferred Minor" to --detail. In some cases this update will be performed automatically by the kernel driver. In particular the update happens automatically at the first write to an array with redundancy (RAID level 1 or greater) on a 2.6 (or later) kernel.

The uuid option will change the uuid of the array. If a UUID is given with the --uuid option that UUID will be used as a new UUID and will NOT be used to help identify the devices in the array. If no --uuid is given, a random UUID is chosen.

The name option will change the name of the array as stored in the superblock. This is only supported for version-1 superblocks.

The homehost option will change the homehost as recorded in the superblock. For version-0 superblocks, this is the same as updating the UUID. For version-1 superblocks, this involves updating the name.

The summaries option will correct the summaries in the superblock. That is the counts of total, working, active, failed, and spare devices.

The devicesize option will rarely be of use. It applies to version 1.1 and 1.2 metadata only (where the metadata is at the start of the device) and is only useful when the component device has changed size (typically become larger). The version 1 metadata records the amount of the device that can be used to store data, so if a device in a version 1.1 or 1.2 array becomes larger, the metadata will still be visible, but the extra space will not. In this case it might be useful to assemble the array with --update=devicesize. This will cause mdadm to determine the maximum usable amount of space on each device and update the relevant field in the metadata.


Comments