# Setting up ZFS for BEADM



## dvl@ (Dec 4, 2013)

I'm creating a ZFS root system and I'm getting confused and not really sure I'm doing the right stuff.

My last step of the process is setting the mountpoint, and I'm not sure I've succeeded in setting it.  Why?  The output of `zfs list` says the mountpoint is still /mnt.


```
# zfs set mountpoint=/ system/ROOT/default
 
# zfs list
NAME                                      USED  AVAIL  REFER  MOUNTPOINT
system                                    716M   444G   144K  none
system/ROOT                               715M   444G   144K  none
system/ROOT/default                       715M   444G   713M  /mnt
system/ROOT/default/root                  160K   444G   160K  /mnt/root
system/ROOT/default/tmp                   144K   444G   144K  /mnt/tmp
system/ROOT/default/usr                  1.13M   444G   144K  /mnt/usr
system/ROOT/default/usr/home              288K   444G   144K  /mnt/usr/home
system/ROOT/default/usr/home/dan          144K   444G   144K  /mnt/usr/home/dan
system/ROOT/default/usr/local             144K   444G   144K  /mnt/usr/local
system/ROOT/default/usr/obj               144K   444G   144K  /mnt/usr/obj
system/ROOT/default/usr/ports             296K   444G   152K  /mnt/usr/ports
system/ROOT/default/usr/ports/distfiles   144K   444G   144K  /mnt/usr/ports/distfiles
system/ROOT/default/usr/src               144K   444G   144K  /mnt/usr/src
system/ROOT/default/var                   600K   444G   144K  /mnt/var
system/ROOT/default/var/audit             160K   444G   160K  /mnt/var/audit
system/ROOT/default/var/log               144K   444G   144K  /mnt/var/log
system/ROOT/default/var/tmp               152K   444G   152K  /mnt/var/tmp
 
 
# zfs get mountpoint
NAME                                     PROPERTY    VALUE                     SOURCE
system                                   mountpoint  none                      local
system/ROOT                              mountpoint  none                      inherited from system
system/ROOT/default                      mountpoint  /mnt                      local
system/ROOT/default/root                 mountpoint  /mnt/root                 inherited from system/ROOT/default
system/ROOT/default/tmp                  mountpoint  /mnt/tmp                  inherited from system/ROOT/default
system/ROOT/default/usr                  mountpoint  /mnt/usr                  inherited from system/ROOT/default
system/ROOT/default/usr/home             mountpoint  /mnt/usr/home             inherited from system/ROOT/default
system/ROOT/default/usr/home/dan         mountpoint  /mnt/usr/home/dan         inherited from system/ROOT/default
system/ROOT/default/usr/local            mountpoint  /mnt/usr/local            inherited from system/ROOT/default
system/ROOT/default/usr/obj              mountpoint  /mnt/usr/obj              inherited from system/ROOT/default
system/ROOT/default/usr/ports            mountpoint  /mnt/usr/ports            inherited from system/ROOT/default
system/ROOT/default/usr/ports/distfiles  mountpoint  /mnt/usr/ports/distfiles  inherited from system/ROOT/default
system/ROOT/default/usr/src              mountpoint  /mnt/usr/src              inherited from system/ROOT/default
system/ROOT/default/var                  mountpoint  /mnt/var                  inherited from system/ROOT/default
system/ROOT/default/var/audit            mountpoint  /mnt/var/audit            inherited from system/ROOT/default
system/ROOT/default/var/log              mountpoint  /mnt/var/log              inherited from system/ROOT/default
system/ROOT/default/var/tmp              mountpoint  /mnt/var/tmp              inherited from system/ROOT/default
```


----------



## usdmatt (Dec 4, 2013)

Did you import your pool with an alternate root? You may have to unmount them all first as well, otherwise it's going to try and mount over your live system (or whatever you're installing from). 

I usually set the mountpoint to legacy (As per https://forums.freebsd.org/viewtopic.php?t=31662) but then I normally only have one pool/ROOT/default filesystem. I'm not if that works when you have sub-filesystems.


----------



## dvl@ (Dec 4, 2013)

I admit I don't know enough about `zfs import` to know what I'm doing.  I'm merging stuff from several different scripts.

I just now managed to get a layout shown to my by Allan Jude.  I'm going to use that as a starting point and go from there.  Thank you for the suggestion.  I'll look at that.


----------



## J65nko (Dec 5, 2013)

I posted  a Makefile to automate a ZFS beadm setup at viewtopic.php?f=39&t=41274


----------

