linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Any risk switching mdadm to static?
@ 2012-12-26 17:57 Mark Knecht
  2012-12-26 19:02 ` Phil Turmel
  2012-12-26 19:32 ` Tommy Apel Hansen
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Knecht @ 2012-12-26 17:57 UTC (permalink / raw)
  To: Linux-RAID

Hi,
   I run a bunch of home Gentoo systems most of which use mdadm,
currently version 3.1.4. I do not currently use initramfs's on any of
these systems but figure it's time for me to crawl out of my dark ages
swamp and try to become more enlightened.

   QUESTION: Is there an significant risk that a normal Gentoo system
of the stable variety (I.e. - not ~amd64) would encounter any problems
booting if mdadm-3.1.4 was rebuilt using the static flag? If it
matters most of my RAIDs are metadata-0.9. One is 1.2.

   If I did encounter a problem and couldn't boot is there a way to recover?

   Please note, I'm not asking right now about using mdadm from within
an initramfs. I'm only trying to ensure that if I rebuild mdadm with
the static flag the current system is still likely to boot OK.

   Folks on the Gentoo list say they didn't have any problems
switching, but they switched a long, long time ago so I'm just trying
to be extra sure.

Thanks in advance,
Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any risk switching mdadm to static?
  2012-12-26 17:57 Any risk switching mdadm to static? Mark Knecht
@ 2012-12-26 19:02 ` Phil Turmel
       [not found]   ` <CAK2H+ecQpTtipdPWQmVj2gCZ6FPzeXfx5bj8y4asVdhf1CTkfA@mail.gmail.com>
  2012-12-26 19:32 ` Tommy Apel Hansen
  1 sibling, 1 reply; 5+ messages in thread
From: Phil Turmel @ 2012-12-26 19:02 UTC (permalink / raw)
  To: Mark Knecht; +Cc: Linux-RAID

On 12/26/2012 12:57 PM, Mark Knecht wrote:
> Hi,
>    I run a bunch of home Gentoo systems most of which use mdadm,
> currently version 3.1.4. I do not currently use initramfs's on any of
> these systems but figure it's time for me to crawl out of my dark ages
> swamp and try to become more enlightened.
> 
>    QUESTION: Is there an significant risk that a normal Gentoo system
> of the stable variety (I.e. - not ~amd64) would encounter any problems
> booting if mdadm-3.1.4 was rebuilt using the static flag? If it
> matters most of my RAIDs are metadata-0.9. One is 1.2.

I can't answer the question off the top, but I thought I'd point out
that you probably don't need static for use with an initramfs.  Because
I run stable amd64 on one of my gentoo servers, and don't have 'static'
set for mdadm.  I use dracut with mdraid and lvm use flags to build my
initramfs images.  Rootfs is in LVM which is on MD raid10.

>    If I did encounter a problem and couldn't boot is there a way to recover?
>
>    Please note, I'm not asking right now about using mdadm from within
> an initramfs. I'm only trying to ensure that if I rebuild mdadm with
> the static flag the current system is still likely to boot OK.

From my understanding of how linking works, I'd say it *can't* hurt.

>    Folks on the Gentoo list say they didn't have any problems
> switching, but they switched a long, long time ago so I'm just trying
> to be extra sure.

HTH,

Phil


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any risk switching mdadm to static?
  2012-12-26 17:57 Any risk switching mdadm to static? Mark Knecht
  2012-12-26 19:02 ` Phil Turmel
@ 2012-12-26 19:32 ` Tommy Apel Hansen
       [not found]   ` <CAK2H+efpHB-Okn_PaitAKmLPKwmn1kNZzJpEvM-BW7fWWwrZVw@mail.gmail.com>
  1 sibling, 1 reply; 5+ messages in thread
From: Tommy Apel Hansen @ 2012-12-26 19:32 UTC (permalink / raw)
  To: Mark Knecht; +Cc: Linux-RAID

Hello Mark,
if you use genkernel initramfs you shouldn't have any problems, just
make sure you mdadm.conf is up to date when you ask genkernel to make
the initramfs, what the initramfs does it to boot your system into a
ramdisk and then initialize everything from there before pivoting into
the real OS, worst case you'll end up in a rescure shell where you can
start up the md's and then ask the system to use them after you exit the
shell.

/Tommy

On Wed, 2012-12-26 at 09:57 -0800, Mark Knecht wrote:
> Hi,
>    I run a bunch of home Gentoo systems most of which use mdadm,
> currently version 3.1.4. I do not currently use initramfs's on any of
> these systems but figure it's time for me to crawl out of my dark ages
> swamp and try to become more enlightened.
> 
>    QUESTION: Is there an significant risk that a normal Gentoo system
> of the stable variety (I.e. - not ~amd64) would encounter any problems
> booting if mdadm-3.1.4 was rebuilt using the static flag? If it
> matters most of my RAIDs are metadata-0.9. One is 1.2.
> 
>    If I did encounter a problem and couldn't boot is there a way to recover?
> 
>    Please note, I'm not asking right now about using mdadm from within
> an initramfs. I'm only trying to ensure that if I rebuild mdadm with
> the static flag the current system is still likely to boot OK.
> 
>    Folks on the Gentoo list say they didn't have any problems
> switching, but they switched a long, long time ago so I'm just trying
> to be extra sure.
> 
> Thanks in advance,
> Mark
> --
> 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] 5+ messages in thread

* Re: Any risk switching mdadm to static?
       [not found]   ` <CAK2H+ecQpTtipdPWQmVj2gCZ6FPzeXfx5bj8y4asVdhf1CTkfA@mail.gmail.com>
@ 2012-12-26 19:53     ` Phil Turmel
  0 siblings, 0 replies; 5+ messages in thread
From: Phil Turmel @ 2012-12-26 19:53 UTC (permalink / raw)
  To: Mark Knecht; +Cc: linux-raid

On 12/26/2012 02:28 PM, Mark Knecht wrote:
> On Wed, Dec 26, 2012 at 11:02 AM, Phil Turmel <philip@turmel.org> wrote:

[trim /]

>> I can't answer the question off the top, but I thought I'd point out
>> that you probably don't need static for use with an initramfs.  Because
>> I run stable amd64 on one of my gentoo servers, and don't have 'static'
>> set for mdadm.  I use dracut with mdraid and lvm use flags to build my
>> initramfs images.  Rootfs is in LVM which is on MD raid10.
> 
> OK, that's good to know. I'm not currently using dracut as I'd like to go
> through the process once or twice by hand as I learn, and maybe I'm
> overreacting to what I'm seeing here. It's my understanding that the
> purpose of the static flag is to build into the mdadm binary any libraries
> that would normally be loaded dynamically. Is that correct?

Yes.

> c2stable ~ # ldd /sbin/mdadm
>         linux-vdso.so.1 (0x00007fff735e3000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007f81a31e6000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007f81a3591000)
> c2stable ~ #

Mine is effective identical (slight offset differences, as expected for
custom-compiled systems).  Dracut put these libraries in my initramfs.

> So the above is for NOT static case. My concern is about
> whether I have to put these libraries in my initramfs image
> by hand, or said another way, if I build static then are these
> libraries completely linked in and carried along with the
> mdadm binary?

Yes, as you've since demonstrated.

>> From my understanding of how linking works, I'd say it *can't* hurt.
>>
> 
> That's my general feeling also, but I'm just trying to be both extra
> careful as well as learn something.
> 
> Thanks for the response!

You're welcome.

Phil


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any risk switching mdadm to static?
       [not found]   ` <CAK2H+efpHB-Okn_PaitAKmLPKwmn1kNZzJpEvM-BW7fWWwrZVw@mail.gmail.com>
@ 2012-12-26 19:55     ` Tommy Apel Hansen
  0 siblings, 0 replies; 5+ messages in thread
From: Tommy Apel Hansen @ 2012-12-26 19:55 UTC (permalink / raw)
  To: Mark Knecht; +Cc: Linux-RAID

Hello Mark,
Well if you need some inspiration then try and look into the genkernel
image it might help you get along, one thing you could also do is to run
through the whole examine process and let mdadm detect things along the
way, but in case you want to include the initramfs into the kernel I
would suggest to make the separate initramfs file first and confirm that
it actually works before building it into the kernel as a full rebuild
every time you want to change something might push your patience to full
extend, just saying. 

/Tommy 

On Wed, 2012-12-26 at 11:45 -0800, Mark Knecht wrote:
> On Wed, Dec 26, 2012 at 11:32 AM, Tommy Apel Hansen
> <tommyapeldk@gmail.com> wrote:
> > Hello Mark,
> > if you use genkernel initramfs you shouldn't have any problems, just
> > make sure you mdadm.conf is up to date when you ask genkernel to make
> > the initramfs, what the initramfs does it to boot your system into a
> > ramdisk and then initialize everything from there before pivoting into
> > the real OS, worst case you'll end up in a rescure shell where you can
> > start up the md's and then ask the system to use them after you exit the
> > shell.
> >
> > /Tommy
> 
> Hi Tommy,
>    OK, that's interesting info and something I hadn't considered was the
> impact of mdadm.conf. I'm not using genkernel - again, working by hand
> as a learning experience. I'd like to build the image into my kernel and
> not have it as a separate file on disk.
> 
> The kernel documentation and help on Genoo-Users has me
> considering a config file something like the following which the kernel
> build would use to create the initramfs image it includes in the
> kernel file:
> 
> dir /bin 755 0 0
> file /bin/busybox /bin/busybox 755 0 0
> slink /bin/sh busybox 777 0 0
> 
> dir /realroot 755 0 0
> dir /etc 755 0 0
> dir /proc 755 0 0
> dir /sys 755 0 0
> 
> dir /sbin 755 0 0
> file /sbin/mdadm /sbin/mdadm 755 0 0
> 
> file /sbin/e2fsck /sbin/e2fsck 755 0 0
> dir /lib 755 0 0
> file /lib/libext2fs.so /usr/lib64/libext2fs.so 755 0 0
> 
> dir /dev 755 0 0
> nod /dev/console 600 0 0 c 5 1
> nod /dev/null 666 0 0 c 1 3
> nod /dev/tty 666 0 0 c 5 0
> nod /dev/urandom 666 0 0 c 1 9
> 
> file /init /usr/src/init.sh 755 0 0
> 
> 
> 
> It sounds like I should consider adding something like
> 
> file /etc/mdadm.conf /etc/mdadm.conf 755 0 0
> 
> to that. At least I'd have the data available in case I have to
> start them by hand.
> 
> Thanks for your input!
> 
> - Mark



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-26 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-26 17:57 Any risk switching mdadm to static? Mark Knecht
2012-12-26 19:02 ` Phil Turmel
     [not found]   ` <CAK2H+ecQpTtipdPWQmVj2gCZ6FPzeXfx5bj8y4asVdhf1CTkfA@mail.gmail.com>
2012-12-26 19:53     ` Phil Turmel
2012-12-26 19:32 ` Tommy Apel Hansen
     [not found]   ` <CAK2H+efpHB-Okn_PaitAKmLPKwmn1kNZzJpEvM-BW7fWWwrZVw@mail.gmail.com>
2012-12-26 19:55     ` Tommy Apel Hansen

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).