* Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name.
@ 2024-10-19 6:32 Marc Haber
2024-10-19 10:03 ` Geoff Back
0 siblings, 1 reply; 6+ messages in thread
From: Marc Haber @ 2024-10-19 6:32 UTC (permalink / raw)
To: linux-raid
Hi,
during a restore operation, I have recreated a RAID array using a rescue
system. That new array ended up being named grml:0. Renaming the array
to realhostname:md_root didn't work inside the rescue system
The rescue system is reasonably current, using kernel 6.11.2 and mdadm
4.3.
First, I tried changing the name of the array. That worked:
# mdadm --assemble md_root --update=name --name=md_root /dev/sda3 /dev/sdb3
mdadm: /dev/md/md_root has been started with 2 drives.
# mdadm --examine /dev/sda3
... Name: grml:md_root (local to host grml) ...
What didn't work was changing the homehost:
# mdadm --assemble md_root --update=homehost --name=realhostname /dev/sda3 /dev/sdb3
mdadm: /dev/sda3 has wrong name.
mdadm: /dev/sdb3 has wrong name.
Adding --force didn't work, same error message.
What is the recommended way to create an array inside a rescue system
that has homehost and name to the values the local admin wants, and/or
to change those values for an array that has already been created and is
filled with data?
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name.
2024-10-19 6:32 Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name Marc Haber
@ 2024-10-19 10:03 ` Geoff Back
2024-10-19 20:14 ` Marc Haber
0 siblings, 1 reply; 6+ messages in thread
From: Geoff Back @ 2024-10-19 10:03 UTC (permalink / raw)
To: Marc Haber, linux-raid
On 19/10/2024 07:32, Marc Haber wrote:
> Hi,
>
> during a restore operation, I have recreated a RAID array using a rescue
> system. That new array ended up being named grml:0. Renaming the array
> to realhostname:md_root didn't work inside the rescue system
>
> The rescue system is reasonably current, using kernel 6.11.2 and mdadm
> 4.3.
>
> First, I tried changing the name of the array. That worked:
> # mdadm --assemble md_root --update=name --name=md_root /dev/sda3 /dev/sdb3
> mdadm: /dev/md/md_root has been started with 2 drives.
> # mdadm --examine /dev/sda3
> ... Name: grml:md_root (local to host grml) ...
>
> What didn't work was changing the homehost:
> # mdadm --assemble md_root --update=homehost --name=realhostname /dev/sda3 /dev/sdb3
> mdadm: /dev/sda3 has wrong name.
> mdadm: /dev/sdb3 has wrong name.
I think instead of --name=realhostname you need --homehost=realhostname
here.
>
> Adding --force didn't work, same error message.
>
> What is the recommended way to create an array inside a rescue system
> that has homehost and name to the values the local admin wants, and/or
> to change those values for an array that has already been created and is
> filled with data?
>
> Greetings
> Marc
>
Geoff Back
What if we're all just characters in someone's nightmares?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name.
2024-10-19 10:03 ` Geoff Back
@ 2024-10-19 20:14 ` Marc Haber
2024-10-21 6:51 ` Mariusz Tkaczyk
0 siblings, 1 reply; 6+ messages in thread
From: Marc Haber @ 2024-10-19 20:14 UTC (permalink / raw)
To: linux-raid
On Sat, Oct 19, 2024 at 11:03:53AM +0100, Geoff Back wrote:
> I think instead of --name=realhostname you need --homehost=realhostname
> here.
Thanks for spotting this. It has worked now.
In the rescue system, the array was then available as /dev/md/md_root.
Booting the production system, the array became
/dev/md/realhostname:md_root. mdadm --detail says
Name : realhostname:md_root (local to host realhostname)
Is this how things are supposed to work? I had the impression that the
host name part of the array name only shows up in /dev/md/ if it DOES
NOT equal the local host name of the running system?
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name.
2024-10-19 20:14 ` Marc Haber
@ 2024-10-21 6:51 ` Mariusz Tkaczyk
2024-10-21 20:33 ` Marc Haber
0 siblings, 1 reply; 6+ messages in thread
From: Mariusz Tkaczyk @ 2024-10-21 6:51 UTC (permalink / raw)
To: Marc Haber; +Cc: linux-raid
On Sat, 19 Oct 2024 22:14:12 +0200
Marc Haber <mh+linux-raid@zugschlus.de> wrote:
> On Sat, Oct 19, 2024 at 11:03:53AM +0100, Geoff Back wrote:
> > I think instead of --name=realhostname you need --homehost=realhostname
> > here.
>
> Thanks for spotting this. It has worked now.
>
> In the rescue system, the array was then available as /dev/md/md_root.
> Booting the production system, the array became
> /dev/md/realhostname:md_root. mdadm --detail says
> Name : realhostname:md_root (local to host realhostname)
>
> Is this how things are supposed to work? I had the impression that the
> host name part of the array name only shows up in /dev/md/ if it DOES
> NOT equal the local host name of the running system?
>
> Greetings
> Marc
>
I'm looking into Incremental right now and there is a comment:
* 3/ Check if there is a match in mdadm.conf
* 3a/ if not, check for homehost match. If no match, assemble as
* a 'foreign' array.
I believe that this is kind of "foreign" naming for native raid.
You can probably correct it by updating your mdadm.conf or you can update your
homehost to production system hostname.
So yes, it looks like expected, we are highlighting that it is not our MD array.
We need user to acknowledge it by updating conf or updating homehost to
change locality to "local".
Thanks,
Mariusz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name.
2024-10-21 6:51 ` Mariusz Tkaczyk
@ 2024-10-21 20:33 ` Marc Haber
2024-10-22 11:25 ` Mariusz Tkaczyk
0 siblings, 1 reply; 6+ messages in thread
From: Marc Haber @ 2024-10-21 20:33 UTC (permalink / raw)
To: linux-raid
Hi Mariusz,
thanks for your answer.
On Mon, Oct 21, 2024 at 08:51:32AM +0200, Mariusz Tkaczyk wrote:
> I'm looking into Incremental right now and there is a comment:
>
> * 3/ Check if there is a match in mdadm.conf
> * 3a/ if not, check for homehost match. If no match, assemble as
> * a 'foreign' array.
>
> I believe that this is kind of "foreign" naming for native raid.
But the array is not intended to be considered as foreign, it is running
on its native host.
Good call, I indeed forgot updating mdadm.conf. And I also forgot that
we are on Debian stable with a current kernel now, that means Kernel
6.11.3 and mdadm 4.2
> You can probably correct it by updating your mdadm.conf or you can update your
> homehost to production system hostname.
It now says:
HOMEHOST <system>
ARRAY /dev/md/myrealhostname:md_root metadata=1.2 name=myrealhostname:md_root UUID=9d455b1e:35a52a2b:59b2bc1a:db22369f
The ARRAY line is what mdadm --detail --scan prints, and hostname(1)
returns "myrealhostname". And still, /dev/md/myrealhostname:md_root
exists after rebuilding initramfs and rebooting..
Changing the ARRAY line to
ARRAY /dev/md/md_root metadata=1.2 name=myrealhostname:md_root UUID=9d455b1e:35a52a2b:59b2bc1a:db22369f
and rebuilding initramfs yielded the expected behavior, having
/dev/md/md_root.
Thanks for pointing me so effienctly to the correct solution.
> So yes, it looks like expected, we are highlighting that it is not our MD array.
But it IS "our" MD array. Or, at least it is supposed to be.
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name.
2024-10-21 20:33 ` Marc Haber
@ 2024-10-22 11:25 ` Mariusz Tkaczyk
0 siblings, 0 replies; 6+ messages in thread
From: Mariusz Tkaczyk @ 2024-10-22 11:25 UTC (permalink / raw)
To: Marc Haber; +Cc: linux-raid
On Mon, 21 Oct 2024 22:33:22 +0200
Marc Haber <mh+linux-raid@zugschlus.de> wrote:
> Hi Mariusz,
>
> thanks for your answer.
>
> On Mon, Oct 21, 2024 at 08:51:32AM +0200, Mariusz Tkaczyk wrote:
> > I'm looking into Incremental right now and there is a comment:
> >
> > * 3/ Check if there is a match in mdadm.conf
> > * 3a/ if not, check for homehost match. If no match, assemble as
> > * a 'foreign' array.
> >
> > I believe that this is kind of "foreign" naming for native raid.
>
> But the array is not intended to be considered as foreign, it is running
> on its native host.
>
> Good call, I indeed forgot updating mdadm.conf. And I also forgot that
> we are on Debian stable with a current kernel now, that means Kernel
> 6.11.3 and mdadm 4.2
>
> > You can probably correct it by updating your mdadm.conf or you can update
> > your homehost to production system hostname.
>
> It now says:
> HOMEHOST <system>
> ARRAY /dev/md/myrealhostname:md_root metadata=1.2 name=myrealhostname:md_root
> UUID=9d455b1e:35a52a2b:59b2bc1a:db22369f The ARRAY line is what mdadm
> --detail --scan prints, and hostname(1) returns "myrealhostname". And still,
> /dev/md/myrealhostname:md_root exists after rebuilding initramfs and
> rebooting..
>
> Changing the ARRAY line to
> ARRAY /dev/md/md_root metadata=1.2 name=myrealhostname:md_root
> UUID=9d455b1e:35a52a2b:59b2bc1a:db22369f and rebuilding initramfs yielded the
> expected behavior, having /dev/md/md_root.
>
> Thanks for pointing me so effienctly to the correct solution.
>
> > So yes, it looks like expected, we are highlighting that it is not our MD
> > array.
>
> But it IS "our" MD array. Or, at least it is supposed to be.
>
> Greetings
> Marc
>
Got you. Well, looks like this array name "ARRAY
/dev/md/myrealhostname:md_root" forced bad naming. Generally, I recommend
#mdadm --examine --scan for conf generation. You can try and see if the output
is different comparing to --detail --scan.
Probably, we should consider fixing that for --detail --scan.
Thanks,
Mariusz
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-22 11:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-19 6:32 Cannot update homehost of an existing array: mdadm: /dev/sda3 has wrong name Marc Haber
2024-10-19 10:03 ` Geoff Back
2024-10-19 20:14 ` Marc Haber
2024-10-21 6:51 ` Mariusz Tkaczyk
2024-10-21 20:33 ` Marc Haber
2024-10-22 11:25 ` Mariusz Tkaczyk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).