Child pages
  • Advanced - Split-root installation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added /opt/local (pkgsrc) to the mix of split-off paths

...

Now that you have the new root filesystem, prepare it for children, using your selection of sub-datasets. These will be individual to each OS installation, cloned and updated along with their BE. Generally this includes all locations with files delivered by "system" packages, which are likely to be updated in the future.  Also included below is /opt/local as the path used by Joyent PKGSRC releases usable on most illumos distributions and likely to consume lots of space.

To follow the example settings defined above:

Code Block
:; cd "$BENEW_MNT" && for D in \
    usr var opt usr/local var/pkg opt/local \
   ; do mkdir "$D" && /bin/chmod S+ci "$D" && \
        zfs create -o canmount=noauto -o compression=gzip-9 "$BENEW_DS/$D" && \
        zfs mount -O "$BENEW_DS/$D" || break; \
   done
 
:; /bin/df -k | grep " $BENEW_MNT"
### Example listing:
rpool/ROOT/oi_151a8           8193024     34     3738737     1%    /a
rpool/ROOT/oi_151a8/usr       8193024     32     3738737     1%    /a/usr
rpool/ROOT/oi_151a8/var       8193024     31     3738737     1%    /a/var
rpool/ROOT/oi_151a8/opt       8193024     31     3738737     1%    /a/opt
rpool/ROOT/oi_151a8/usr/local 8193024     31     3738737     1%    /a/usr/local
rpool/ROOT/oi_151a8/var/pkg   8193024     31     3738737     1%    /a/var/pkg

...

  • Download the script:

    Code Block
    :; wget -O /root/beadm-clone.sh "http://wiki.openindiana.org/download/attachments/27230229/beadm-clone.sh && \
       chmod +x /root/beadm-clone.sh
  • Source it into the current shell so it sets all the variables as it goes (by default it will propose a new BE name based on the first token of the current BE before a separator such as the dash character, and suffix it with current timestamp); the script prints the variables it is going to use and pauses before proceeding (press ENTER to go on):

    Code Block
    :; . /root/beadm-clone.sh 

    Alternately, don't source but rather run the script and copy-paste the reported variable values into your shell.

  • When the script is done cloning and has reported no errors, copy-paste the suggestions from the end of its output, i.e.:

    Code Block
    :; pkg -R "$BENEW_MNT" image-update --deny-new-be --no-backup-be && \
       touch "$BENEW_MNT/reconfigure" && \
       bootadm update-archive -R "$BENEW_MNT" && \
       beadm umount "$BENEW"
    
    :; TS="`date -u "+%Y%m%dZ%H%M%S"`" && \
       zfs snapshot -r "$RPOOL_SHARED@postupgrade-$TS" &&\
       zfs snapshot -r "$BENEW_DS@postupgrade-$TS"
  • If all was ok – activate and gracefully reboot:

    Code Block
    :; beadm activate "$BENEW" && \
       init 6

    Hopefully, everything goes up nicely and quickly, and a `df -k /` would show the new root dataset (wink)

...