Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 2019 22:17:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 237517] ZFS parallel mounting sometimes misses mounting intermediate filesystems
Message-ID:  <bug-237517-3630-HIWyZw2kui@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-237517-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-237517-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237517

Peter Eriksson <pen@lysator.liu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pen@lysator.liu.se

--- Comment #5 from Peter Eriksson <pen@lysator.liu.se> ---
We do something similar on our servers - however the main reason we do it i=
s to
speed things up. Normally a standard "zfs mount -a" would take slightly less
than 1 hour to execute (a lot of ZFS filesystems) which was a bit of a pain
when we needed to reboot the servers (or they crashed during office hours).

So we've been investigating various ways of speeding things up. A hack was =
to
run a large number of individual "zfs mount $FS" commands in parallell, but
then you need to sort the filesystems so they get mounted in the right orde=
r...
We also do the bulk of the filesystem mounting in the background so we atle=
ast
get a login prompt and can login to the machine and see what is happening...
The hack was surprisingly effective - 5-10 minutes instead of 1 hour. :-)

The scripts can very probably be improved a lot but they do the job for us.
Would have been nice to have a "zfs mount --recursive POOL" command. Or a "=
zfs
mount --parallell=3D20 -a" command. :-)


>From our /etc/rc.d/zfs:

zfs_start_main()
{
        /sbin/zfs-speedmount > /var/log/zfs/zfs-speedmount.log 2>&1
        zfs share -a
        touch /etc/zfs/exports
}

...

zfs_start()
{
        if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then
                zfs_start_jail
        else
            # Empty exports-file, to prevent annoying error messages while
mounting
            echo -n "" > /etc/zfs/exports

            # Mount all other root pool filesystems first
            /sbin/zfs-mountrpool -v

            # And then we do the rest in the background
            zfs_start_main &
        fi
}

(I'll add our scripts as attachments in case they might be useful to someon=
e).

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237517-3630-HIWyZw2kui>