Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2017 20:41:45 +0200
From:      Andrea Venturoli <ml@netfence.it>
To:        freebsd-questions@freebsd.org
Subject:   Some ZFS questions
Message-ID:  <c81a1c46-e3c5-f7ab-deb2-fa2a45493b23@netfence.it>

next in thread | raw e-mail | index | archive | help
Hello.

I'm a novice to ZFS and right now I'm conducting some experiments on 
10.3. I've got some questions which might be obvious or FAQs, but I can 
assure I looked for an afternoon and found no answer.


I first installed from the USB image and choose Auto-ZFS options when 
the installer came to partitioning.
The install was succesful and "zfs list" would show something like the 
following (please note this is not an exact copy & paste, since I 
destroyed that install in the meantime):

> zroot                781M  93.2G   144K  none
> zroot/ROOT           777M  93.2G   144K  none
> zroot/ROOT/default   777M  93.2G   777M  /
> zroot/tmp            176K  93.2G   176K  /tmp
> zroot/usr            616K  93.2G   144K  /usr
> zroot/usr/home       184K  93.2G   184K  /usr/home
> zroot/usr/ports      144K  93.2G   144K  /usr/ports
> zroot/usr/src        144K  93.2G   144K  /usr/src
> zroot/var           1.20M  93.2G   608K  /var
> zroot/var/crash      148K  93.2G   148K  /var/crash
> zroot/var/log        178K  93.2G   178K  /var/log
> zroot/var/mail       144K  93.2G   144K  /var/mail
> zroot/var/tmp        152K  93.2G   152K  /var/tmp

What puzzles me is "zroot/ROOT": why do we need that? Why do we mount 
"zroot/ROOT/default" as root instead of simply mounting "zroot" at /?



Possibly related... the first thing I wanted to try is how I would deal 
with big troubles.
So I booted again from the USB key, went into live mode and tried 
mounting the installed system.

"zpool import -R /mnt zroot" would complain that /mnt is readonly, so I 
would end up with zroot mounted on /mnt, but /mnt appearing empty and no 
other ZFS filesystem mounted.

I tried creating /var/mnt (which is r/w) and issued "zpool import -R 
/var/mnt zroot". No error is displayed, but in /var/mnt I only found the 
mount points (i.e. /tmp, /usr, /usr/home, etc...), but no file!!!

I tried several other ways (like zpool import -N, then using zfs import 
or mount -t zfs), but none worked properly.

Something was achieved by "zpool import -N zroot ; mount -t zfs 
zroot/ROOT/default /var/mnt": however I could then see *everything* 
under /var/mnt/, including the content of /usr, /var, etc... which did 
NOT show as mounted! So I fear writing to this filesystems this way 
could create a mess. Was I right? Was this ok?

How should I mount the main system from an emergency live image?



So I redid the install, loosely following
> https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror
and
> http://daemon-notes.com/articles/system/install-zfs/begin

This times I manually created the following structure:
> #zfs list
> NAME		...	MOUNTPOINT
> zroot		...	/
> zroot/usr	...	/usr
> zroot/var	...	/var

In fact, from a Live USB key, I can now simply issue "zpool import -R 
/mnt/ -f zroot" and I'll see all of my filesystems on /mnt.

Anything wrong with this setup?



I lost the ability to boot via UEFI this way. I've been happily using 
legacy BIOS in all my boxes until now. Would this be a problem? Is UEFI 
that better?



Lastly: I "restore"d an existing UFS-based system's dump on this box. I 
was using ezjail there, obviously configured for not using ZFS.
Is there any howto for converting ezjail? Or would I do better leaving 
it as it is?

  bye & Thanks
	av.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c81a1c46-e3c5-f7ab-deb2-fa2a45493b23>