Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2013 15:34:41 -0500
From:      James <james@hicag.org>
To:        Volodymyr Kostyrko <c.kworr@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: FreeBSD 9.1 and swap on zfs
Message-ID:  <CAD4099nbyx9JL1BcUsj_DFvORs=XVddvWDNKU=5ZLju28Xo4eQ@mail.gmail.com>
In-Reply-To: <51642E22.404@gmail.com>
References:  <9407C6ED-3B4C-4BA2-8B88-F8A998E0A847@free.de> <5162CBE8.5050104@madpilot.net> <AF006790-64C2-49AA-9ED2-32917F514565@free.de> <51642E22.404@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 9, 2013 at 10:05 AM, Volodymyr Kostyrko <c.kworr@gmail.com> wrote:

> Be sure to use -b prefer for that as when dump is written it goes to
> the first component. Man page is a bit outdated as we currently miss
> /etc/rc.early.

    Yes. rc.early hasn't worked in ages. But here's another way to do
    it. This assumes your swap mirror is called swap.

    /etc/rc.d/gmirror_savecore_pre:

    #!/bin/sh
    #
    # $Tilted$
    #

    # PROVIDE: gmirror_savecore_pre
    # BEFORE:  savecore
    # KEYWORD: nojail

    name='gmirror_savecore_pre'
    start_cmd='gmirror_savecore_pre_start'
    start_precmd='gmirror_savecore_pre_prestart'
    stop_cmd=':'

    gmirror_savecore_pre_prestart () {
        if ! gmirror status swap >/dev/null 2>&1; then
            debug 'No gmirror swap. Skipping.'
            return 1
        fi
        return 0
    }

    gmirror_savecore_pre_start () {
        gmirror configure -b prefer swap
    }

    load_rc_config $name
    run_rc_command "$1"

    /etc/rc.d/gmirror_savecore_post:

    #!/bin/sh
    #
    # $Tilted$
    #

    # PROVIDE: gmirror_savecore_post
    # REQUIRE: savecore
    # KEYWORD: nojail

    name='gmirror_savecore_post'
    start_cmd='gmirror_savecore_post_start'
    start_precmd='gmirror_savecore_post_prestart'
    stop_cmd=':'

    gmirror_savecore_post_prestart () {
        if ! gmirror status swap >/dev/null 2>&1; then
            debug 'No gmirror swap. Skipping.'
            return 1
        fi
        return 0
    }

    gmirror_savecore_post_start () {
        gmirror configure -b load swap
    }

    load_rc_config $name
    run_rc_command "$1"

    I would prefer swap on a zvol, but it doesn't appear ready yet. At
    this time I allocate a swap partition in the gpt of every disk and
    gmirror the first two. If a disk failure happens, or looks like it
    might, I can simply add one of the spares. It works well.

--
James.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAD4099nbyx9JL1BcUsj_DFvORs=XVddvWDNKU=5ZLju28Xo4eQ>