Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ZFS mounting order at system startup

600 views
Skip to first unread message

tripledubs

unread,
Apr 30, 2015, 1:38:31 PM4/30/15
to
Is there a way to determine or set the order of zfs dataset or zpool mounting at system startup? Have a system with some /export/home/<user> mounts in a different zpool than rpool and there are errors at boot. /export/home/<user> is mounted before /export/home so /export/home won't mount. I've solved with setting mountpoint to legacy and putting the conflicting mounts in order in /etc/vfstab, but wondering if there is a better way.

Thanks

John D Groenveld

unread,
Apr 30, 2015, 2:09:37 PM4/30/15
to
In article <6c347d4f-172e-44be...@googlegroups.com>,
tripledubs <dwayn...@gmail.com> wrote:
>mounting at system startup? Have a system with some /export/home/<user>
>mounts in a different zpool than rpool and there are errors at boot.
>/export/home/<user> is mounted before /export/home so /export/home won't
>mount. I've solved with setting mountpoint to legacy and putting the
>conflicting mounts in order in /etc/vfstab, but wondering if there is a
>better way.

Its been a long while since I've seen that race
condition.
The solution was to zfs umount all the user filesystems
and then rpool/export/home and rpool/export and then
clear the filesystem/local svc.

John
groe...@acm.org

Casper H.S. Dik

unread,
Apr 30, 2015, 2:18:28 PM4/30/15
to
tripledubs <dwayn...@gmail.com> writes:

>Is there a way to determine or set the order of zfs dataset or zpool mounti=
>ng at system startup? Have a system with some /export/home/<user> mounts in=
> a different zpool than rpool and there are errors at boot. /export/home/<u=
>ser> is mounted before /export/home so /export/home won't mount. I've solve=
>d with setting mountpoint to legacy and putting the conflicting mounts in o=
>rder in /etc/vfstab, but wondering if there is a better way.

Yeah, this is likely a problem.

Is there data in rpool' /export/home? If you're not using that, you
can just remove it or possible move this first to the other
export/home file system

Casper

tripledubs

unread,
Apr 30, 2015, 3:06:49 PM4/30/15
to
That is a good idea. In this case there are users residing in both zpools though.

zpool2/export/home/user30
zpool2/export/home/user31

rpool/export/home (contains many users already)

Also I could just move their home directories, but I think there will be unintended consequences so I am not going to do that.

It seems like zfs would be smart enough to recursively build up the file system tree, but it almost seems like it goes in alphabetical? random? order

tripledubs

unread,
Apr 30, 2015, 3:08:43 PM4/30/15
to
Thanks John. That will get the system up for sure, but not good to risk that happening again next reboot

John D Groenveld

unread,
Apr 30, 2015, 3:40:47 PM4/30/15
to
In article <25e1dc55-4715-440e...@googlegroups.com>,
tripledubs <dwayn...@gmail.com> wrote:
>Thanks John. That will get the system up for sure, but not good to risk
>that happening again next reboot

It haven't encountered this problem again in many reboots
of S10 and S11.

John
groe...@acm.org

John D Groenveld

unread,
Apr 30, 2015, 4:42:14 PM4/30/15
to
In article <181d5272-bee6-4386...@googlegroups.com>,
tripledubs <dwayn...@gmail.com> wrote:
>That is a good idea. In this case there are users residing in both zpools though.
>
>zpool2/export/home/user30
>zpool2/export/home/user31
>
>rpool/export/home (contains many users already)
>
>Also I could just move their home directories, but I think there will be unintended consequences so I am not going to do that.
>

# zfs umount zpool2/export/home/user[...]
# zfs umount rpool/export/home/user[...]
# zfs umount rpool/export/home
# zfs umount rpool/export
# zfs mount rpool/export
# zfs mount rpool/export/home
# svcadm clear filesystem/local

>It seems like zfs would be smart enough to recursively build up the file system tree, but it almost seems like it goes in alphabetical? random? order

My WAG is it mounts at boot in the previous mounted order.

John
groe...@acm.org

Casper H.S. Dik

unread,
Apr 30, 2015, 6:43:05 PM4/30/15
to
tripledubs <dwayn...@gmail.com> writes:

>That is a good idea. In this case there are users residing in both zpools though.

>zpool2/export/home/user30
>zpool2/export/home/user31

>rpool/export/home (contains many users already)

>Also I could just move their home directories, but I think there will be unintended consequences so I am not going to do that.

>It seems like zfs would be smart enough to recursively build up the file system tree, but it almost seems like it goes in alphabetical? random? order

The problem is you're trying to mount /export/home twice.

Why not making two different /pool/export/home hierarchies and then mount
them all using automount to /home?

Casper

John D Groenveld

unread,
Apr 30, 2015, 8:16:32 PM4/30/15
to
In article <5542aff6$0$2871$e4fe...@news2.news.xs4all.nl>,
Casper H.S. Dik <Caspe...@OrSPaMcle.COM> wrote:
>Why not making two different /pool/export/home hierarchies and then mount
>them all using automount to /home?

AFAICT it breaks automount(1M)'s wildcarding.

John
groe...@acm.org

Casper H.S. Dik

unread,
May 1, 2015, 2:09:01 AM5/1/15
to
There are many way to fix that. You can create an
executable map (instead of a textual map, make the
map file executable)


#!/bin/sh


for homedir in /rpool/export/home /zpool/export/home; do
dir="$homedir"/"$1"
if [[ -f $dir ]]; then
echo localhost:"$dir"
exit 0
fi
done

exit 1
0 new messages