* changing parameters of a running array?
@ 2013-10-25 7:39 Michael Tokarev
2013-10-25 9:12 ` Lars Täuber
0 siblings, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2013-10-25 7:39 UTC (permalink / raw)
To: linux-raid
Hello.
Is there a way to change some parameters - like preferred minor,
array name, homehost, guuid and the like - of a _running_ array?
I understand these can be changed using --assemble --update=foo,
but how about, say, root array which is being assembled from
within an initrd with limited functionality?
What I'm trying to achieve is to make a clone of a (remote)
running system, in order to upgrade hdds. For this, a new
set of drives are inserted, new set of filesystems is created,
current filesystems are copied to new hdds and on the next
reboot the system should boot from the new hdds. But since
I can't create arrays with the same names/minors as currently
running ones, and I want to preserve the naming scheme, I
need to ensure the new arrays will be named correctly after
the reboot. But since the system is remote, this is a bit
difficult to achieve for the root device.
And similarly, I can't --update a NON-running array without
--assemble, so I can't fix the names before reboot while the
old arrays are still running.
Maybe the easiest way is to write a small (perl) program
which will read the superblock of a non-running array, update
it and write it back. This at least will allow me to perform
tasks before reboot. But this way it becomes risky - if the
first reboot will happen with the old drives still in place,
havoc might happen, since more than one array will have the
same name...
So a better route will be to create new arrays with temp
names, reboot, change names on the newly running system,
and remove old arrays. The question is how to change
some params on a running system.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: changing parameters of a running array?
2013-10-25 7:39 changing parameters of a running array? Michael Tokarev
@ 2013-10-25 9:12 ` Lars Täuber
2013-10-27 17:28 ` Michael Tokarev
0 siblings, 1 reply; 4+ messages in thread
From: Lars Täuber @ 2013-10-25 9:12 UTC (permalink / raw)
To: linux-raid
Hi Michael,
Fri, 25 Oct 2013 11:39:32 +0400
Michael Tokarev <mjt@tls.msk.ru> ==> linux-raid <linux-raid@vger.kernel.org> :
> Hello.
>
> Is there a way to change some parameters - like preferred minor,
> array name, homehost, guuid and the like - of a _running_ array?
> I understand these can be changed using --assemble --update=foo,
> but how about, say, root array which is being assembled from
> within an initrd with limited functionality?
>
> What I'm trying to achieve is to make a clone of a (remote)
> running system, in order to upgrade hdds. For this, a new
> set of drives are inserted, new set of filesystems is created,
> current filesystems are copied to new hdds and on the next
> reboot the system should boot from the new hdds. But since
> I can't create arrays with the same names/minors as currently
> running ones, and I want to preserve the naming scheme, I
> need to ensure the new arrays will be named correctly after
> the reboot. But since the system is remote, this is a bit
> difficult to achieve for the root device.
>
> And similarly, I can't --update a NON-running array without
> --assemble, so I can't fix the names before reboot while the
> old arrays are still running.
>
> Maybe the easiest way is to write a small (perl) program
> which will read the superblock of a non-running array, update
> it and write it back. This at least will allow me to perform
> tasks before reboot. But this way it becomes risky - if the
> first reboot will happen with the old drives still in place,
> havoc might happen, since more than one array will have the
> same name...
>
> So a better route will be to create new arrays with temp
> names, reboot, change names on the newly running system,
> and remove old arrays. The question is how to change
> some params on a running system.
>
it depends on the distribution you're running. But you might not need to change these parameters while the system is running.
I can update /etc/mdadm/mdadm.conf with the UUIDs of the new arrays and regenerate the initrd with
# update-initramfs -u
running ubuntu.
And then after the reboot the arrays are named like I told before in the mdadm.conf.
Good luck
Lars
> Thanks,
>
> /mjt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: changing parameters of a running array?
2013-10-25 9:12 ` Lars Täuber
@ 2013-10-27 17:28 ` Michael Tokarev
2013-10-27 23:02 ` NeilBrown
0 siblings, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2013-10-27 17:28 UTC (permalink / raw)
To: Lars Täuber; +Cc: linux-raid
25.10.2013 13:12, Lars Täuber wrote:
> Hi Michael,
>
> Fri, 25 Oct 2013 11:39:32 +0400
> Michael Tokarev <mjt@tls.msk.ru> ==> linux-raid <linux-raid@vger.kernel.org> :
>> Hello.
>>
>> Is there a way to change some parameters - like preferred minor,
>> array name, homehost, guuid and the like - of a _running_ array?
>> I understand these can be changed using --assemble --update=foo,
>> but how about, say, root array which is being assembled from
>> within an initrd with limited functionality?
>>
>> What I'm trying to achieve is to make a clone of a (remote)
>> running system, in order to upgrade hdds. For this, a new
>> set of drives are inserted, new set of filesystems is created,
>> current filesystems are copied to new hdds and on the next
>> reboot the system should boot from the new hdds. But since
>> I can't create arrays with the same names/minors as currently
>> running ones, and I want to preserve the naming scheme, I
>> need to ensure the new arrays will be named correctly after
>> the reboot. But since the system is remote, this is a bit
>> difficult to achieve for the root device.
>>
>> And similarly, I can't --update a NON-running array without
>> --assemble, so I can't fix the names before reboot while the
>> old arrays are still running.
>>
>> Maybe the easiest way is to write a small (perl) program
>> which will read the superblock of a non-running array, update
>> it and write it back. This at least will allow me to perform
>> tasks before reboot. But this way it becomes risky - if the
>> first reboot will happen with the old drives still in place,
>> havoc might happen, since more than one array will have the
>> same name...
>>
>> So a better route will be to create new arrays with temp
>> names, reboot, change names on the newly running system,
>> and remove old arrays. The question is how to change
>> some params on a running system.
>>
>
> it depends on the distribution you're running. But you might not need to change these parameters while the system is running.
It doesn't. One thing is the name forcible used to assemble
an array -- this one indeed depends on the initrd/initramfs
in use. And another thing is the name recorded in the array
superblock -- this does not and should not chage behind my
back. It should only change explicitly. And that's exactly
what I'm talking about -- how to explicitly change some
params when the array is in use.
Thanks,
/mjt
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: changing parameters of a running array?
2013-10-27 17:28 ` Michael Tokarev
@ 2013-10-27 23:02 ` NeilBrown
0 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2013-10-27 23:02 UTC (permalink / raw)
To: Michael Tokarev; +Cc: Lars Täuber, linux-raid
[-- Attachment #1: Type: text/plain, Size: 2882 bytes --]
On Sun, 27 Oct 2013 21:28:06 +0400 Michael Tokarev <mjt@tls.msk.ru> wrote:
> 25.10.2013 13:12, Lars Täuber wrote:
> > Hi Michael,
> >
> > Fri, 25 Oct 2013 11:39:32 +0400
> > Michael Tokarev <mjt@tls.msk.ru> ==> linux-raid <linux-raid@vger.kernel.org> :
> >> Hello.
> >>
> >> Is there a way to change some parameters - like preferred minor,
> >> array name, homehost, guuid and the like - of a _running_ array?
> >> I understand these can be changed using --assemble --update=foo,
> >> but how about, say, root array which is being assembled from
> >> within an initrd with limited functionality?
> >>
> >> What I'm trying to achieve is to make a clone of a (remote)
> >> running system, in order to upgrade hdds. For this, a new
> >> set of drives are inserted, new set of filesystems is created,
> >> current filesystems are copied to new hdds and on the next
> >> reboot the system should boot from the new hdds. But since
> >> I can't create arrays with the same names/minors as currently
> >> running ones, and I want to preserve the naming scheme, I
> >> need to ensure the new arrays will be named correctly after
> >> the reboot. But since the system is remote, this is a bit
> >> difficult to achieve for the root device.
> >>
> >> And similarly, I can't --update a NON-running array without
> >> --assemble, so I can't fix the names before reboot while the
> >> old arrays are still running.
> >>
> >> Maybe the easiest way is to write a small (perl) program
> >> which will read the superblock of a non-running array, update
> >> it and write it back. This at least will allow me to perform
> >> tasks before reboot. But this way it becomes risky - if the
> >> first reboot will happen with the old drives still in place,
> >> havoc might happen, since more than one array will have the
> >> same name...
> >>
> >> So a better route will be to create new arrays with temp
> >> names, reboot, change names on the newly running system,
> >> and remove old arrays. The question is how to change
> >> some params on a running system.
> >>
> >
> > it depends on the distribution you're running. But you might not need to change these parameters while the system is running.
>
> It doesn't. One thing is the name forcible used to assemble
> an array -- this one indeed depends on the initrd/initramfs
> in use. And another thing is the name recorded in the array
> superblock -- this does not and should not chage behind my
> back. It should only change explicitly. And that's exactly
> what I'm talking about -- how to explicitly change some
> params when the array is in use.
I'm sorry but that isn't possible. The only options I can think of are:
- boot of some other media and then update the metadata
- hack the initrd to assemble with --update= to update whatever needs
updating.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-27 23:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25 7:39 changing parameters of a running array? Michael Tokarev
2013-10-25 9:12 ` Lars Täuber
2013-10-27 17:28 ` Michael Tokarev
2013-10-27 23:02 ` NeilBrown
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).