degraded raid boot process should interactively prompt user before dropping to recovery shell

Bug #257568 reported by Dustin Kirkland 
6
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

Binary package hint: mdadm

Opening a bug, based on discussion on the Ubuntu-Server mailing list.

:-Dustin

On Wed, Aug 13, 2008 at 5:59 AM, Matt Zimmerman <email address hidden> wrote:
> On Tue, Aug 12, 2008 at 05:19:32PM -0700, Mathias Gug wrote:
>> ==== Boot Support for Degraded RAID ====
>>
>> kirkland has been working on adding RAID support to grub-install. His patch is
>> waiting for sponsoring. He hopes it will make it for alpha4 scheduled to be
>> released on Thursday. If so mathiaz suggested that this new feature should be
>> documented in the Release Notes in order to get more testing.
>>
>> The last item he's working on is adding a question during the installation on
>> whether the system should be set to boot from a degraded array (defaulting to
>> No, which matches the current behaviour).
>
> It appears from that if this feature is not enabled, the system will fail
> hard to an initramfs shell. Instead, how about giving the user the option
> to continue?
>
> Waiting for root file system...
>
> ** WARNING: The root filesystem was found on a degraded RAID array! **
>
> The system may have suffered a hardware fault, such as a disk drive failure.
> You may attempt to start the system anyway, or stop now and attempt manual
> recovery operations.
>
> If you choose to continue, the system may start normally, but performance
> may be degraded, and a further hardware fault could result in permanent data
> loss.
>
> If you abort now, you will be provided with a recovery shell.
>
> Do you wish to continue? [y/N]
>
> This should present no more risk than dropping to a shell, and gives the
> user the guidance to make an informed decision.
>
> --
> - mdz
>
> --
> ubuntu-server mailing list
> <email address hidden>
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
> More info: https://wiki.ubuntu.com/ServerTeam
>

Changed in mdadm:
assignee: nobody → kirkland
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Patch attached.

:-Dustin

Revision history for this message
Jools Wills (jools) wrote :

What about machines which the sysadmin has only remote access to ? He will want the machine to boot into degraded mode, so services can be running until he can contact someone at the data centre to replace a disk. having it stop at a prompt in this scenario is not helpful.

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: [Bug 257568] Re: degraded raid boot process should interactively prompt user before dropping to recovery shell

On Wed, Aug 13, 2008 at 12:54:53PM -0000, Jools Smyth wrote:
> What about machines which the sysadmin has only remote access to ? He
> will want the machine to boot into degraded mode, so services can be
> running until he can contact someone at the data centre to replace a
> disk. having it stop at a prompt in this scenario is not helpful.

That is a separate issue; there is already a configuration option and this
bug is only about what to do when the option is turned off.

--
 - mdz

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 257568] Re: degraded raid boot process should interactively prompt user before dropping to recovery shell

On Wed, Aug 13, 2008 at 7:54 AM, Jools Smyth <email address hidden> wrote:
> What about machines which the sysadmin has only remote access to ? He
> will want the machine to boot into degraded mode, so services can be
> running until he can contact someone at the data centre to replace a
> disk. having it stop at a prompt in this scenario is not helpful.

It will NOT stop at this prompt if either:

 * The user has BOOT_DEGRADED=true in /etc/initramfs-tools/conf.d/mdadm, or
 * The user passes "bootdegraded=true" on the kernel boot parameter

It will only stop at this prompt just before dropping to a busybox
recovery shell in the initramfs, which is also only useful if you're
standing in front of the console.

:-Dustin

Revision history for this message
Jools Wills (jools) wrote :

Aaah ok. then I'm happy ;-)

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I have looked into providing a timeout for this prompt, however the extraordinarily limited ash shell in busybox makes this very difficult.

Something like this seems to work well in bash/dash/ash, however, it does not work properly in busybox.

                        # Set a 15-second timeout for this question
                        trap : USR1
                        (sleep 15 && kill -USR1 "$$" 2>/dev/null) & pid=$!
                        read -p "Do you wish to boot the degraded RAID? [y/N]: " -r BOOT_DEGRADED
                        kill "$pid" 2> /dev/null

In any case, perhaps this is a nice-to-have, but does not have to be part of this commit.

I've tested the above debdiff and I'm satisfied with it. Requesting sponsorship.

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Turns out "read" will take a "-t" option, but it cannot take place after the "-r" option.

Updated patch attached. Tested, requesting sponsorship.

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Screen shot of the testing, for good measure ;-)

:-Dustin

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mdadm - 2.6.7-3ubuntu3

---------------
mdadm (2.6.7-3ubuntu3) intrepid; urgency=low

  * debian/initramfs/init-premount: provide a safety net, interactive prompt
    on boot before dropping to busybox shell if the RAID is degraded; prompt
    times out after 15 seconds, (LP: #257568).

 -- Dustin Kirkland <email address hidden> Wed, 13 Aug 2008 14:02:29 -0500

Changed in mdadm:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.