[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: changing uuid of mdadm array




Em 09/10/2022 19:06, Tim Woodall escreveu:
On Sun, 9 Oct 2022, Andy Smith wrote:

but I couldn't find any way to change the uuid in the member without
creating the array like this.

I don't think there is a way without either using --create as you
did or stopping the array and hand editing the metadata of the
device in question.

Thanks. That --update=uuid convinced me there ought to be a way to do
it.

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.

Perhaps I needed to remove the uuid from mdadm.conf.


FWIW, I didn't need to change the uuid here, I could have just started
from scratch with --zero-superblock but I've previously got into a mess
where I duplicated a machine by splitting a raid where I now had two
raids with the same uuid and this was a good opportunity to see what I
should have done on a disk where I didn't care about the data on it.

Every time you remove a device from raid, you indeed need to erase the superblock.

mdadm use the superblock to identify its raid members,

if you try to add a device to a raid block it'll fail because the device already contain a superblock identify at its 'header'. --zero-superblock it's the right way add to anothor md array.


Following the mdadm manual instruction

"

      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 --update=uuid, in my conception will update 'array' uuid, for that means will change the uuid of all of the array members, not the removed ones.




Tim.



Reply to: