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

Re: Any advice for a user about to use LVM for the first time?



Kevin O'Gorman wrote:
> There's one remaining question I have, which is fortunately not urgent.
> It's not clear what I'm going to have to do to bring the RAID online after
> a reboot.  It doesn't seem to be as simple as tweaking /etc/fstab, like it
> is on bare drives.  I suppose I can do an assemble operation manually each
> time.  Is there a best practice for making this automatic?

If you install a system using the debian-installer then it will set
everything up for you automatically.  For people installing a pristine
system with raid it is all automatic and nothing more needs to be
done.  For people adding additional mdadm raid volumes later they need
to do some configuration for it.

Mdadm has two different times when it will assemble raid volumes.  In
reverse time order the second is at boot time by looking at
/etc/mdadm/mdadm.conf file and assembling all raids configured there.
That data can be created using mdadm --scan to search for physical
devices and to produce the config files.  Take that information and
edit it as needed.

Typically, note the append >> operator:

  mdadm --detail --scan >>/dev/mdadm/mdadm.conf
  ...edit /dev/mdadm/mdadm.conf...clean up and remove duplicate lines...

The debian-installer formats the lines slightly differently than mdadm
output does.  I don't know if the differences are really significant.
I usually edit to follow the original debian-installer format.

The important part is that the arrays are listed with the device and
with the UUID of the array.  That will instruct mdadm to assemble
those arrays when mdadm is started at system boot time.

However system boot time is too late for assembling the raid array
holding the system itself.  At early boot time in the initrd the mdadm
will be invoked to assemble raid volumes.  Those instructions are
cached in the initrd.  Therefore after changing the mdadm.conf file
the initrd must be rebuilt in order to have the raid volumes assembled
at early boot time before the system boots.

There are many ways to rebuild the initrd.  I will list out several.
Choose whichever one feels good to you.

  update-initramfs -u

That will update the initrd of the latest kernel.  I assume you are
booting the latest kernel.  If you need to boot different kernels then
use the -k option to specify the kernel version to rebuild.  Or use
"all" to rebuild all of your installed kernel's initrds.  However if
you are running Unstable and have many kernels left behind as lint
then this may take a long time.

  update-initramfs -u -k all

Or of course you could use the package manager.  When kernels are
installed the postinst script builds the initrd.  You can also
reconfigure the kernel package and this will rebuild the initrd too.

  dpkg-reconfigure linux-image-3.2.0-4-amd64

Where linux-image-3.2.0-4-amd64 is your current installed kernel.  The
above would be for Wheezy 7.7 Stable.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: