On 11/19/2014 04:25 PM, Duncan wrote:
Most often, however, it's at resume, not original startup, which is
understandable as state at resume doesn't match state at suspend/
hibernate.  The irritating thing, as previously discussed, is when one
device takes long enough to come back that mdraid or btrfs drops it out,
generally forcing the reboot I was trying to avoid with the suspend/
hibernate in the first place, along with a re-add and resync (for mdraid)
or a scrub (for btrfs raid).

If you want a practical solution you might want to look at http://underdog.soruceforge.net (my project, shameless plug). The actual user context return isn't in there but I use the project to build initramfs images into all my kernels.

[DISCLAIMER: The cryptsetup and LUKS stuff is rock solid but the mdadm incremental build stuff is very rough and so lightly untested]

You could easily add a drive preheat code block (spin up and status check all drives with pause and repeat function) as a preamble function that could/would safely take place before any glance is made towards the resume stage.

extemporaneous example::

--- snip ---
cat <<'EOT' >>/opt/underdog/utility/preheat.mod
#!/bin/bash
# ROOT_COMMANDS+=( commands your preheat needs )
UNDERDOG+=( init.d/preheat )
EOT

cat <<'EOT' >>/opt/underdog/prototype/init.d/preheat
#!/bin/bash
function __preamble_preheat() {
whatever logic you need
return 0
}
__preamble_funcs+=( [preheat]=__preamble_preheat )
EOT
--- snip ---

install underdog, paste the above into a shell once. edit /opt/underdog/prototype/init.d/preamble to put whatever logic in you need.

Follow the instructions in /opt/underdog/README.txt for making the initramfs image or, as I do, build the initramfs into the kernel image.

The preamble will be run in the resultant /init script before the swap partitions are submitted for attempted resume.

(The system does support complexity like resuming from a swap partition inside an LVM/LV built over a LUKS encrypted media expanse, or just a plain laptop with one plain partitioned disk, with zero changes to the necessary default config.)

-- Rob.



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to