Snapshots, Replication, and Boot-Environments by Kris Moore

EuroBSDCon 2014EuroBSDCon 2014
Snapshots, Replication, and Boot-EnvironmentsSnapshots, Replication, and Boot-Environments
--
How new ZFS utilities are changing FreeBSD & PC-BSD.How new ZFS utilities are changing FreeBSD & PC-BSD.
Kris MooreKris Moore
PC-BSD / iXsystemsPC-BSD / iXsystems
kris@pcbsd.orgkris@pcbsd.org
Why ZFS?Why ZFS?
Why ZFS?Why ZFS?
●
The benefits have begun to greatlyThe benefits have begun to greatly
outweigh the drawbacks for workstationoutweigh the drawbacks for workstation
usageusage
●
Since moving to only 64bit for PC-BSD 9.2Since moving to only 64bit for PC-BSD 9.2
and later, the last major hurdle has beenand later, the last major hurdle has been
overcomeovercome
●
A new class of utilities and methods haveA new class of utilities and methods have
been made possible by building on top ofbeen made possible by building on top of
ZFSZFS
A closer look at Boot-EnvironmentsA closer look at Boot-Environments
A closer look at Boot-EnvironmentsA closer look at Boot-Environments
●
First originated in Solaris 10First originated in Solaris 10
●
Provides a method of using ZFSProvides a method of using ZFS
snapshots and clones to create instantsnapshots and clones to create instant
bootable backups of a systembootable backups of a system
●
Most commonly used before doingMost commonly used before doing
“dangerous” tasks, such as updating“dangerous” tasks, such as updating
kernels, world or critical packageskernels, world or critical packages
PC-BSD boot-environment implementationPC-BSD boot-environment implementation
●
GRUB used to perform the direct bootupGRUB used to perform the direct bootup
of FreeBSD kernel (using kfreebsd)of FreeBSD kernel (using kfreebsd)
●
Special ZFS dataset layoutSpecial ZFS dataset layout
●
““beadm” command and GUI utility forbeadm” command and GUI utility for
managementmanagement
So why GRUB?So why GRUB?
●
Ability to easily tie into “beadm”, provideAbility to easily tie into “beadm”, provide
menus and sub-menus for Boot-menus and sub-menus for Boot-
EnvironmentsEnvironments
●
It's what Solaris usesIt's what Solaris uses
●
In 2014 it is nice to have a graphical boot-In 2014 it is nice to have a graphical boot-
loaderloader
●
Fast loading of Kernel + ModulesFast loading of Kernel + Modules
●
Support for FDE using GELI and singleSupport for FDE using GELI and single
zpoolzpool
Can I still use the BSD loader?Can I still use the BSD loader?
●
Yes, in 10.0 the BSD loader can beYes, in 10.0 the BSD loader can be
selected during installationselected during installation
●
It doesIt does notnot have automatic integration withhave automatic integration with
“beadm”“beadm”
Will PC-BSD switch back to the BSD
loader?
Will PC-BSD switch back to the BSD
loader?
●
Possible, depending if the BSD loaderPossible, depending if the BSD loader
begins to gain the features that webegins to gain the features that we
currently use in GRUBcurrently use in GRUB
A closer look at the ZFS layoutA closer look at the ZFS layout
●
By default a <pool>/ROOT/default datasetBy default a <pool>/ROOT/default dataset
is created, which is mounted on “/”is created, which is mounted on “/”
●
This dataset will be snapped / cloned toThis dataset will be snapped / cloned to
create new BEscreate new BEs
A closer look at the ZFS layoutA closer look at the ZFS layout
●
Any additional ZFS datasets areAny additional ZFS datasets are notnot
included in the BEincluded in the BE
●
We create /usr and /var datasets with theWe create /usr and /var datasets with the
“canmount=off” flag“canmount=off” flag
A closer look at the ZFS layoutA closer look at the ZFS layout
So how do I manage these Boot-
Environments?
So how do I manage these Boot-
Environments?
●
From the command-line, using theFrom the command-line, using the
“beadm” utility“beadm” utility
●
When creating / removing new BE's,When creating / removing new BE's,
GRUB configuration will be automaticallyGRUB configuration will be automatically
updated with new boot entriesupdated with new boot entries
●
During package updates, grub may be re-During package updates, grub may be re-
stamped as well.stamped as well.
Via the CLIVia the CLI
Via the GUIVia the GUI
●
Can be accessed via Control Panel →Can be accessed via Control Panel →
Boot ManagerBoot Manager
Snapshots, Replication, and Boot-Environments by Kris Moore
So how do I boot it?So how do I boot it?
●
When only a single BE exists, the menu isWhen only a single BE exists, the menu is
hidden unless Left-Shift is held downhidden unless Left-Shift is held down
●
Once BE's are created, the menu willOnce BE's are created, the menu will
appear, booting the first entry by defaultappear, booting the first entry by default
Snapshots, Replication, and Boot-Environments by Kris Moore
Customizing the GRUB menusCustomizing the GRUB menus
●
Most GRUB customization can be doneMost GRUB customization can be done
via knobs in /usr/local/etc/default/grubvia knobs in /usr/local/etc/default/grub
●
After making changes to this file, runAfter making changes to this file, run
“grub-mkconfig -o /boot/grub/grub.cfg”“grub-mkconfig -o /boot/grub/grub.cfg”
●
/boot/grub/grub.cfg contains the bootup/boot/grub/grub.cfg contains the bootup
script, written in mostly 'sh' syntaxscript, written in mostly 'sh' syntax
Common CustomizationsCommon Customizations
●
GRUB_HIDDEN_TIMEOUT_QUIET=true/falseGRUB_HIDDEN_TIMEOUT_QUIET=true/false
●
GRUB_HIDDEN_TIMEOUT=<number>GRUB_HIDDEN_TIMEOUT=<number>
●
GRUB_DEFAULT=<number>GRUB_DEFAULT=<number>
●
GRUB_TIMEOUT=<number>GRUB_TIMEOUT=<number>
●
GRUB_THEME=<theme path>GRUB_THEME=<theme path>
●
GRUB_FONT=<pf2 file>GRUB_FONT=<pf2 file>
Adding menu entries to GRUBAdding menu entries to GRUB
●
The grub-mkconfig command runs aThe grub-mkconfig command runs a
series of shell scripts located inseries of shell scripts located in
/usr/local/etc/grub.d/usr/local/etc/grub.d
●
Files in this directory are “ordered” byFiles in this directory are “ordered” by
number.number.
●
Existing files may be overwritten by pkgExisting files may be overwritten by pkg
upgrades, adding a new 50_* file isupgrades, adding a new 50_* file is
recommended.recommended.
●
Additionally a /boot/grub/custom.cfg fileAdditionally a /boot/grub/custom.cfg file
can be created, which will be sourced forcan be created, which will be sourced for
the end of grub.cfgthe end of grub.cfg
Adding menu entries to GRUBAdding menu entries to GRUB
menuentry "My Menu Entry" {menuentry "My Menu Entry" {
insmod zfsinsmod zfs
search --no-floppy -s -l tank1search --no-floppy -s -l tank1
kfreebsd /ROOT/default/@/boot/kernel/kernelkfreebsd /ROOT/default/@/boot/kernel/kernel
kfreebsd_loadenv /ROOT/default@/boot/device.hintskfreebsd_loadenv /ROOT/default@/boot/device.hints
kfreebsd_module /ROOT/default/@/boot/zfs/zpool.cachekfreebsd_module /ROOT/default/@/boot/zfs/zpool.cache
type=/boot/zfs/zpool.cachetype=/boot/zfs/zpool.cache
set kFreeBSD.vfs.root.mountfrom=zfs:tank1/ROOT/defaultset kFreeBSD.vfs.root.mountfrom=zfs:tank1/ROOT/default
kfreebsd_module_elf /ROOT/default/@/boot/modules/vboxdrv.kokfreebsd_module_elf /ROOT/default/@/boot/modules/vboxdrv.ko
kfreebsd_module_elf /ROOT/default/@/boot/modules/nvidia.kokfreebsd_module_elf /ROOT/default/@/boot/modules/nvidia.ko
kfreebsd_module_elf /ROOT/default/@/boot/kernel/zfs.kokfreebsd_module_elf /ROOT/default/@/boot/kernel/zfs.ko
kfreebsd_module_elfkfreebsd_module_elf
/ROOT/default/@/boot/kernel/opensolaris.ko/ROOT/default/@/boot/kernel/opensolaris.ko
kfreebsd_module_elf /ROOT/default/@/boot/kernel/tmpfs.kokfreebsd_module_elf /ROOT/default/@/boot/kernel/tmpfs.ko
kfreebsd_module_elf /ROOT/default/@/boot/kernel/linux.kokfreebsd_module_elf /ROOT/default/@/boot/kernel/linux.ko
set kFreeBSD.kern.ipc.shmseg=1024set kFreeBSD.kern.ipc.shmseg=1024
set kFreeBSD.kern.ipc.shmmni=1024set kFreeBSD.kern.ipc.shmmni=1024
}}
A closer look at Life-PreserverA closer look at Life-Preserver
What is this Life-Preserver utility?What is this Life-Preserver utility?
●
A command-line and graphical front-endA command-line and graphical front-end
to:to:
●
Scheduled ZFS snapshots / pruningScheduled ZFS snapshots / pruning
●
Scheduled ZFS send/recv replicationScheduled ZFS send/recv replication
●
Zpool monitoringZpool monitoring
●
Bare-Metal restore using PC-BSD mediaBare-Metal restore using PC-BSD media
How do I get this utility?How do I get this utility?
●
Included out of box on PC-BSD 10.x andIncluded out of box on PC-BSD 10.x and
laterlater
●
Via FreeBSD ports / packages:Via FreeBSD ports / packages:
●
sysutils/pcbsd-utils (Command-line)sysutils/pcbsd-utils (Command-line)
●
sysutils/pcbsd-utils-qt4 (GUI front-ends)sysutils/pcbsd-utils-qt4 (GUI front-ends)
Scheduling SnapshotsScheduling Snapshots
●
To get started with a snapshot schedule,To get started with a snapshot schedule,
we can use the following command:we can use the following command:
# lpreserver cronsnap tank1 start daily@22 10# lpreserver cronsnap tank1 start daily@22 10
●
Replace “tank1” with your zpoolReplace “tank1” with your zpool
●
daily@XX / hourly / 30min / 10min / 5min / autodaily@XX / hourly / 30min / 10min / 5min / auto
●
Replace 10 with number to keepReplace 10 with number to keep
What does that command do?What does that command do?
●
Creates the following entry in /etc/crontabCreates the following entry in /etc/crontab
0 14 * * * root /usr/local/share/lpreserver/backend/runsnap.sh tank1 100 14 * * * root /usr/local/share/lpreserver/backend/runsnap.sh tank1 10
●
When run, the script does the followingWhen run, the script does the following
●
Confirm zpool / datasetConfirm zpool / dataset
●
Create new snapshot, recursivelyCreate new snapshot, recursively
●
Selectively auto-prune snapshotsSelectively auto-prune snapshots
●
Send out notification e-mail (if enabled)Send out notification e-mail (if enabled)
●
Start auto-replication (if enabled)Start auto-replication (if enabled)
Scheduling Snapshots – Auto ModeScheduling Snapshots – Auto Mode
●
Snapshots will be created every 5 minutesSnapshots will be created every 5 minutes
and kept for an hour.and kept for an hour.
●
A hourly snapshot will be kept for a day.A hourly snapshot will be kept for a day.
●
A daily snapshot will be kept for a month.A daily snapshot will be kept for a month.
●
A monthly snapshot will be kept for a year.A monthly snapshot will be kept for a year.
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
●
The life-preserver daemon will also keepThe life-preserver daemon will also keep
track of the zpool disk spacetrack of the zpool disk space
●
If the capacity falls below 75%, the oldestIf the capacity falls below 75%, the oldest
snapshot will be auto-pruned.snapshot will be auto-pruned.
How do I enable e-mail notifications?How do I enable e-mail notifications?
●
Using the command:Using the command:
# lpreserver set <email> (Uses the “mail” command)# lpreserver set <email> (Uses the “mail” command)
●
Additional commands:Additional commands:
●
# lpreserver set duwarn <percent># lpreserver set duwarn <percent>
●
Will send warning when disk free falls below %Will send warning when disk free falls below %
●
Additional commands (continued):Additional commands (continued):
●
# lpreserver set emailopts ALL/WARN/ERROR# lpreserver set emailopts ALL/WARN/ERROR
●
Send mail for all actions, warnings + errors, or errors onlySend mail for all actions, warnings + errors, or errors only
Scheduling ScrubsScheduling Scrubs
* Recent Update ** Recent Update *
●
Support for scheduling ZFS scrubs hasSupport for scheduling ZFS scrubs has
recently been added.recently been added.
●
Will be included in 10.1 this fallWill be included in 10.1 this fall
What about replication?What about replication?
●
Once snapshots are enabled, replication can beOnce snapshots are enabled, replication can be
setup to run automatically, or at a specificsetup to run automatically, or at a specific
intervalinterval
●
Replication by default runs over SSHReplication by default runs over SSH
●
Uses ZFS send/recv (Requires that target haveUses ZFS send/recv (Requires that target have
supported ZFS version)supported ZFS version)
Starting replicationStarting replication
●
First, prepare a remote systemFirst, prepare a remote system
●
Create a ZFS dataset / SSH userCreate a ZFS dataset / SSH user
●
Now set ZFS allow properties on datasetNow set ZFS allow properties on dataset
# zfs allow -u <user> create,receive,mount,userprop,destroy,send,hold <dataset># zfs allow -u <user> create,receive,mount,userprop,destroy,send,hold <dataset>
●
Next start replication on systemNext start replication on system
# lpreserver replicate add <host> <user> 22 tank1 remotepool/backups sync# lpreserver replicate add <host> <user> 22 tank1 remotepool/backups sync
●
Replace <host>, <user>, 22/Port, etcReplace <host>, <user>, 22/Port, etc
What does this replication do?What does this replication do?
●
Checks specified zpoolChecks specified zpool
●
Checks “backup:lpreserver” ZFS property forChecks “backup:lpreserver” ZFS property for
last replicationlast replication
●
Check if doing a first-time / “full” replication orCheck if doing a first-time / “full” replication or
else perform incrementalelse perform incremental
●
Start the ZFS send/recv commandsStart the ZFS send/recv commands
●
After successful send, mark “backup:lpreserver”After successful send, mark “backup:lpreserver”
property with last snapshot replicatedproperty with last snapshot replicated
What does this replication do? (Contd)What does this replication do? (Contd)
●
Build a complete list of zpool / datasetBuild a complete list of zpool / dataset
propertiesproperties
●
Save this list to remote systemSave this list to remote system
●
Check if e-mail reporting is enabled, sendCheck if e-mail reporting is enabled, send
results / logsresults / logs
Notes on replicationNotes on replication
●
First time replication can take some timeFirst time replication can take some time
●
During replication new snapshots can beDuring replication new snapshots can be
created, but auto-pruning is disabledcreated, but auto-pruning is disabled
●
If a replication fails, it may be required to re-If a replication fails, it may be required to re-
initialize the remote side.initialize the remote side.
●
# lpreserver replicate init <mypool># lpreserver replicate init <mypool>
Getting my stuff back!Getting my stuff back!
●
Once snapshots are being created, there areOnce snapshots are being created, there are
several ways to revert or restore filesseveral ways to revert or restore files
●
Via the CLI you can run:Via the CLI you can run:
# lpreserver revertsnap <dataset> <snap># lpreserver revertsnap <dataset> <snap>
●
Additionally you can browse files in theAdditionally you can browse files in the
<mountpoint>/.zfs/snapshot directory<mountpoint>/.zfs/snapshot directory
Getting my stuff back!Getting my stuff back!
●
Via the GUI utility, it is possible toVia the GUI utility, it is possible to
“browse” snapshot data, as well as scroll“browse” snapshot data, as well as scroll
backwards in time.backwards in time.
Getting my stuff back!Getting my stuff back!
Getting my stuff back!Getting my stuff back!
How about bare-metal restores?How about bare-metal restores?
●
The PC-BSD 10.x install DVD/USB media canThe PC-BSD 10.x install DVD/USB media can
provide “bare-metal” restore functionalityprovide “bare-metal” restore functionality
●
Currently limited to the GUI install, but will beCurrently limited to the GUI install, but will be
added to the text-installer in the futureadded to the text-installer in the future
●
Allows you to adjust / change zpool optionsAllows you to adjust / change zpool options
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
What does a bare-metal restore look like?What does a bare-metal restore look like?
The bare-metal nitty grittyThe bare-metal nitty gritty
●
PC-BSD uses the pc-sysinstall installationPC-BSD uses the pc-sysinstall installation
backendbackend
●
Supports the “zfsrestore” installMode,Supports the “zfsrestore” installMode,
allowing installs from a ZFS replicationallowing installs from a ZFS replication
●
Uses SSH as the transfer agentUses SSH as the transfer agent
●
Uses normal pc-sysinstall disk-setupUses normal pc-sysinstall disk-setup
The bare-metal nitty gritty (contd)The bare-metal nitty gritty (contd)
●
Example pc-sysinstall configExample pc-sysinstall config
installMode=zfsrestoreinstallMode=zfsrestore
sshHost=backuphostsshHost=backuphost
sshUser=backupusersshUser=backupuser
sshPort=22sshPort=22
sshKey=/root/.ssh/backupkey_rsasshKey=/root/.ssh/backupkey_rsa
zfsProps=.lp-props-backups-systemnamezfsProps=.lp-props-backups-systemname
zfsRemoteDataset=/backups/systemnamezfsRemoteDataset=/backups/systemname
What about ZFS mirroring?What about ZFS mirroring?
●
During system installation, you may have setupDuring system installation, you may have setup
with a single-disk, or raidz.with a single-disk, or raidz.
●
Life-Preserver can “attach” new disks, creatingLife-Preserver can “attach” new disks, creating
a mirror or adding additional raidz disks.a mirror or adding additional raidz disks.
What about ZFS mirroring? (Contd)What about ZFS mirroring? (Contd)
●
Attaching a new disk to existing zpoolAttaching a new disk to existing zpool
# lpreserver zpool attach tank1 /dev/da0# lpreserver zpool attach tank1 /dev/da0
●
Life-Preserver takes the following stepsLife-Preserver takes the following steps
●
Wipes partitions on new diskWipes partitions on new disk
●
Creates matching GPT/MBR partitionCreates matching GPT/MBR partition
●
Makes the disk bootable with GRUBMakes the disk bootable with GRUB
●
Inserts disk into zpool to begin resilverInserts disk into zpool to begin resilver
processprocess
Questions?Questions?
ReferencesReferences
http://www.slideshare.net/krispcbsd/lpreservereurobsd2014http://www.slideshare.net/krispcbsd/lpreservereurobsd2014
BSDCan pc-sysinstall talk 2010BSDCan pc-sysinstall talk 2010
http://www.bsdcan.org/2010/schedule/events/173.en.htmlhttp://www.bsdcan.org/2010/schedule/events/173.en.html
1 of 61

Recommended

Self 2013 by
Self 2013Self 2013
Self 2013krispcbsd
1.3K views51 slides
Lpreservereurobsd2014 by
Lpreservereurobsd2014Lpreservereurobsd2014
Lpreservereurobsd2014krispcbsd
495 views61 slides
Life Preserver - AsiaBSDCon2014 by
Life Preserver - AsiaBSDCon2014Life Preserver - AsiaBSDCon2014
Life Preserver - AsiaBSDCon2014krispcbsd
1.1K views58 slides
vbsd2013 by
vbsd2013vbsd2013
vbsd2013krispcbsd
758 views47 slides
eurobsd2013 by
eurobsd2013eurobsd2013
eurobsd2013krispcbsd
393 views47 slides
Ilf2013 by
Ilf2013Ilf2013
Ilf2013krispcbsd
671 views47 slides

More Related Content

What's hot

QEMU in Cross building by
QEMU in Cross buildingQEMU in Cross building
QEMU in Cross buildingTetsuyuki Kobayashi
3.3K views31 slides
NetBSDworkshop by
NetBSDworkshopNetBSDworkshop
NetBSDworkshopJun Ebihara
845 views13 slides
Nise BOSH in Action by
Nise BOSH in ActionNise BOSH in Action
Nise BOSH in Actioni_yudai
3.8K views23 slides
Simple and efficient way to get the last log using MMAP by
Simple and efficient way to get the last log using MMAPSimple and efficient way to get the last log using MMAP
Simple and efficient way to get the last log using MMAPTetsuyuki Kobayashi
8.5K views27 slides
Keith Paskett - Postgres on ZFS @ Postgres Open by
Keith Paskett - Postgres on ZFS @ Postgres OpenKeith Paskett - Postgres on ZFS @ Postgres Open
Keith Paskett - Postgres on ZFS @ Postgres OpenPostgresOpen
1.7K views27 slides
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu... by
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...NETWAYS
120 views42 slides

What's hot(20)

Nise BOSH in Action by i_yudai
Nise BOSH in ActionNise BOSH in Action
Nise BOSH in Action
i_yudai3.8K views
Simple and efficient way to get the last log using MMAP by Tetsuyuki Kobayashi
Simple and efficient way to get the last log using MMAPSimple and efficient way to get the last log using MMAP
Simple and efficient way to get the last log using MMAP
Tetsuyuki Kobayashi8.5K views
Keith Paskett - Postgres on ZFS @ Postgres Open by PostgresOpen
Keith Paskett - Postgres on ZFS @ Postgres OpenKeith Paskett - Postgres on ZFS @ Postgres Open
Keith Paskett - Postgres on ZFS @ Postgres Open
PostgresOpen1.7K views
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu... by NETWAYS
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
NETWAYS120 views
What every data programmer needs to know about disks by iammutex
What every data programmer needs to know about disksWhat every data programmer needs to know about disks
What every data programmer needs to know about disks
iammutex11.3K views
Comparison of-foss-distributed-storage by Marian Marinov
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
Marian Marinov234 views
Qemu - Raspberry | while42 Singapore #2 by While42
Qemu - Raspberry | while42 Singapore #2Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2
While421.3K views
LSA2 - 01 Virtualization with KVM by Marian Marinov
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVM
Marian Marinov7.6K views
NFD9 - Matt Peterson, Data Center Operations by Cumulus Networks
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
Cumulus Networks1K views
Xgboost readthedocs-io-en-release 1.3.3 by Angie Ihirwe
Xgboost readthedocs-io-en-release 1.3.3Xgboost readthedocs-io-en-release 1.3.3
Xgboost readthedocs-io-en-release 1.3.3
Angie Ihirwe137 views
Dev ops by Tom Hall
Dev opsDev ops
Dev ops
Tom Hall291 views
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc by Sanjay Adhikari
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9ccQemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Sanjay Adhikari231 views
Linux fundamental - Chap 08 proc by Kenny (netman)
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
Kenny (netman)971 views
Btrfs and Snapper - The Next Steps from Pure Filesystem Features to Integrati... by Gábor Nyers
Btrfs and Snapper - The Next Steps from Pure Filesystem Features to Integrati...Btrfs and Snapper - The Next Steps from Pure Filesystem Features to Integrati...
Btrfs and Snapper - The Next Steps from Pure Filesystem Features to Integrati...
Gábor Nyers4.7K views
Troubleshooting vm's presen by kiwimjg
Troubleshooting vm's presenTroubleshooting vm's presen
Troubleshooting vm's presen
kiwimjg154 views

Similar to Snapshots, Replication, and Boot-Environments by Kris Moore

BSDCan2013 by
BSDCan2013BSDCan2013
BSDCan2013krispcbsd
336 views46 slides
2.2 install boot manager by
2.2 install boot manager2.2 install boot manager
2.2 install boot managerAcácio Oliveira
312 views28 slides
101 2.2 install boot manager by
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot managerAcácio Oliveira
309 views28 slides
Edup wifi for raspberry zero by
Edup wifi  for raspberry zeroEdup wifi  for raspberry zero
Edup wifi for raspberry zeroSoheilSabzevari2
38 views13 slides
Bundling Packages and Deploying Applications with RPM by
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMAlexander Shopov
3.2K views65 slides
Fedora Linux by
Fedora LinuxFedora Linux
Fedora LinuxGaurav Paliwal
513 views13 slides

Similar to Snapshots, Replication, and Boot-Environments by Kris Moore (20)

BSDCan2013 by krispcbsd
BSDCan2013BSDCan2013
BSDCan2013
krispcbsd336 views
Bundling Packages and Deploying Applications with RPM by Alexander Shopov
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
Alexander Shopov3.2K views
Ci For The Web 2.0 Guy Or Gal by Chad Woolley
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
Chad Woolley2.3K views
The Deck by Phil Polstra GrrCON2012 by Philip Polstra
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
Philip Polstra2.4K views
Description of GRUB 2 by iamumr
Description of GRUB 2Description of GRUB 2
Description of GRUB 2
iamumr1.6K views
EuroBSDCon 2021 - (auto)Installing BSD Systems by Vinícius Zavam
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD Systems
Vinícius Zavam265 views
Crafting GNU/ linux distributions for embedded target using Builroot by Sourabh Singh Tomar
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using Builroot
Towards the perfect Drupal Dev Machine by Krimson
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev Machine
Krimson1.4K views
Grub2 and troubleshooting_ol7_boot_problems by Tommy Lee
Grub2 and troubleshooting_ol7_boot_problemsGrub2 and troubleshooting_ol7_boot_problems
Grub2 and troubleshooting_ol7_boot_problems
Tommy Lee1.1K views
How to configure an environment to cross-compile applications for beagleboard-xM by Dalton Valadares
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xM
Dalton Valadares3.6K views
Installing nagios core_from_source by laonap166
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_source
laonap166497 views

More from eurobsdcon

EuroBSDCon 2014 Program Front by
EuroBSDCon 2014 Program FrontEuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program Fronteurobsdcon
688 views1 slide
EuroBSDCon 2014 tutorials program Thursday & Friday by
EuroBSDCon 2014 tutorials program Thursday & FridayEuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & Fridayeurobsdcon
425 views1 slide
EuroBSDCon 2014 Sofia Welcome by
EuroBSDCon 2014 Sofia WelcomeEuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia Welcomeeurobsdcon
487 views20 slides
EuroBSDCon 2014 Sofia Closing talk by
EuroBSDCon 2014 Sofia Closing talkEuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkeurobsdcon
1.1K views28 slides
Submitting documents anonymously by Atanas Chobanov by
Submitting documents anonymously by Atanas ChobanovSubmitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas Chobanoveurobsdcon
861 views22 slides
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot by
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois TigeotPorting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeoteurobsdcon
1.4K views28 slides

More from eurobsdcon(20)

EuroBSDCon 2014 Program Front by eurobsdcon
EuroBSDCon 2014 Program FrontEuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program Front
eurobsdcon688 views
EuroBSDCon 2014 tutorials program Thursday & Friday by eurobsdcon
EuroBSDCon 2014 tutorials program Thursday & FridayEuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & Friday
eurobsdcon425 views
EuroBSDCon 2014 Sofia Welcome by eurobsdcon
EuroBSDCon 2014 Sofia WelcomeEuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia Welcome
eurobsdcon487 views
EuroBSDCon 2014 Sofia Closing talk by eurobsdcon
EuroBSDCon 2014 Sofia Closing talkEuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talk
eurobsdcon1.1K views
Submitting documents anonymously by Atanas Chobanov by eurobsdcon
Submitting documents anonymously by Atanas ChobanovSubmitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas Chobanov
eurobsdcon861 views
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot by eurobsdcon
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois TigeotPorting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
eurobsdcon1.4K views
University of Oslo's TSD service - storing sensitive & restricted data by D... by eurobsdcon
  University of Oslo's TSD service - storing sensitive & restricted data by D...  University of Oslo's TSD service - storing sensitive & restricted data by D...
University of Oslo's TSD service - storing sensitive & restricted data by D...
eurobsdcon703 views
secure lazy binding, and the 64bit time_t development process by Philip Guenther by eurobsdcon
secure lazy binding, and the 64bit time_t development process by Philip Guenthersecure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenther
eurobsdcon654 views
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell by eurobsdcon
  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
eurobsdcon797 views
The LLDB Debugger in FreeBSD by Ed Maste by eurobsdcon
The LLDB Debugger in FreeBSD by Ed MasteThe LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed Maste
eurobsdcon1.6K views
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi by eurobsdcon
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
eurobsdcon1.2K views
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov by eurobsdcon
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
eurobsdcon865 views
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel by eurobsdcon
OpenStack and OpenContrail for FreeBSD platform by Michał DubielOpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
eurobsdcon2.8K views
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau by eurobsdcon
Porting NetBSD to the LatticeMico32 open source CPU by Yann SionneauPorting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
eurobsdcon680 views
Smartcom's control plane software, a customized version of FreeBSD by Boris A... by eurobsdcon
Smartcom's control plane software, a customized version of FreeBSD by Boris A...Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
eurobsdcon1.5K views
Bugs Ex Ante by Kristaps Dzonsons by eurobsdcon
Bugs Ex Ante by Kristaps DzonsonsBugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps Dzonsons
eurobsdcon498 views
Cross Building the FreeBSD ports tree by Baptiste Daroussin by eurobsdcon
Cross Building the FreeBSD ports tree by Baptiste DaroussinCross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste Daroussin
eurobsdcon1.3K views
Building packages through emulation by Sean Bruno by eurobsdcon
Building packages through emulation by Sean BrunoBuilding packages through emulation by Sean Bruno
Building packages through emulation by Sean Bruno
eurobsdcon1.5K views
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti by eurobsdcon
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
eurobsdcon1.1K views
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum by eurobsdcon
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
eurobsdcon5.7K views

Recently uploaded

Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPoolShapeBlue
84 views10 slides
The Power of Heat Decarbonisation Plans in the Built Environment by
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built EnvironmentIES VE
69 views20 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
156 views32 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
80 views38 slides
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineShapeBlue
181 views19 slides
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
385 views86 slides

Recently uploaded(20)

Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue84 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE69 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson156 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue181 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software385 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue79 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue112 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue117 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue154 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu365 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue132 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash153 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue88 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue140 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue158 views

Snapshots, Replication, and Boot-Environments by Kris Moore

  • 1. EuroBSDCon 2014EuroBSDCon 2014 Snapshots, Replication, and Boot-EnvironmentsSnapshots, Replication, and Boot-Environments -- How new ZFS utilities are changing FreeBSD & PC-BSD.How new ZFS utilities are changing FreeBSD & PC-BSD. Kris MooreKris Moore PC-BSD / iXsystemsPC-BSD / iXsystems kris@pcbsd.orgkris@pcbsd.org
  • 3. Why ZFS?Why ZFS? ● The benefits have begun to greatlyThe benefits have begun to greatly outweigh the drawbacks for workstationoutweigh the drawbacks for workstation usageusage ● Since moving to only 64bit for PC-BSD 9.2Since moving to only 64bit for PC-BSD 9.2 and later, the last major hurdle has beenand later, the last major hurdle has been overcomeovercome ● A new class of utilities and methods haveA new class of utilities and methods have been made possible by building on top ofbeen made possible by building on top of ZFSZFS
  • 4. A closer look at Boot-EnvironmentsA closer look at Boot-Environments
  • 5. A closer look at Boot-EnvironmentsA closer look at Boot-Environments ● First originated in Solaris 10First originated in Solaris 10 ● Provides a method of using ZFSProvides a method of using ZFS snapshots and clones to create instantsnapshots and clones to create instant bootable backups of a systembootable backups of a system ● Most commonly used before doingMost commonly used before doing “dangerous” tasks, such as updating“dangerous” tasks, such as updating kernels, world or critical packageskernels, world or critical packages
  • 6. PC-BSD boot-environment implementationPC-BSD boot-environment implementation ● GRUB used to perform the direct bootupGRUB used to perform the direct bootup of FreeBSD kernel (using kfreebsd)of FreeBSD kernel (using kfreebsd) ● Special ZFS dataset layoutSpecial ZFS dataset layout ● ““beadm” command and GUI utility forbeadm” command and GUI utility for managementmanagement
  • 7. So why GRUB?So why GRUB? ● Ability to easily tie into “beadm”, provideAbility to easily tie into “beadm”, provide menus and sub-menus for Boot-menus and sub-menus for Boot- EnvironmentsEnvironments ● It's what Solaris usesIt's what Solaris uses ● In 2014 it is nice to have a graphical boot-In 2014 it is nice to have a graphical boot- loaderloader ● Fast loading of Kernel + ModulesFast loading of Kernel + Modules ● Support for FDE using GELI and singleSupport for FDE using GELI and single zpoolzpool
  • 8. Can I still use the BSD loader?Can I still use the BSD loader? ● Yes, in 10.0 the BSD loader can beYes, in 10.0 the BSD loader can be selected during installationselected during installation ● It doesIt does notnot have automatic integration withhave automatic integration with “beadm”“beadm”
  • 9. Will PC-BSD switch back to the BSD loader? Will PC-BSD switch back to the BSD loader? ● Possible, depending if the BSD loaderPossible, depending if the BSD loader begins to gain the features that webegins to gain the features that we currently use in GRUBcurrently use in GRUB
  • 10. A closer look at the ZFS layoutA closer look at the ZFS layout ● By default a <pool>/ROOT/default datasetBy default a <pool>/ROOT/default dataset is created, which is mounted on “/”is created, which is mounted on “/” ● This dataset will be snapped / cloned toThis dataset will be snapped / cloned to create new BEscreate new BEs
  • 11. A closer look at the ZFS layoutA closer look at the ZFS layout ● Any additional ZFS datasets areAny additional ZFS datasets are notnot included in the BEincluded in the BE ● We create /usr and /var datasets with theWe create /usr and /var datasets with the “canmount=off” flag“canmount=off” flag
  • 12. A closer look at the ZFS layoutA closer look at the ZFS layout
  • 13. So how do I manage these Boot- Environments? So how do I manage these Boot- Environments? ● From the command-line, using theFrom the command-line, using the “beadm” utility“beadm” utility ● When creating / removing new BE's,When creating / removing new BE's, GRUB configuration will be automaticallyGRUB configuration will be automatically updated with new boot entriesupdated with new boot entries ● During package updates, grub may be re-During package updates, grub may be re- stamped as well.stamped as well.
  • 14. Via the CLIVia the CLI
  • 15. Via the GUIVia the GUI ● Can be accessed via Control Panel →Can be accessed via Control Panel → Boot ManagerBoot Manager
  • 17. So how do I boot it?So how do I boot it? ● When only a single BE exists, the menu isWhen only a single BE exists, the menu is hidden unless Left-Shift is held downhidden unless Left-Shift is held down ● Once BE's are created, the menu willOnce BE's are created, the menu will appear, booting the first entry by defaultappear, booting the first entry by default
  • 19. Customizing the GRUB menusCustomizing the GRUB menus ● Most GRUB customization can be doneMost GRUB customization can be done via knobs in /usr/local/etc/default/grubvia knobs in /usr/local/etc/default/grub ● After making changes to this file, runAfter making changes to this file, run “grub-mkconfig -o /boot/grub/grub.cfg”“grub-mkconfig -o /boot/grub/grub.cfg” ● /boot/grub/grub.cfg contains the bootup/boot/grub/grub.cfg contains the bootup script, written in mostly 'sh' syntaxscript, written in mostly 'sh' syntax
  • 21. Adding menu entries to GRUBAdding menu entries to GRUB ● The grub-mkconfig command runs aThe grub-mkconfig command runs a series of shell scripts located inseries of shell scripts located in /usr/local/etc/grub.d/usr/local/etc/grub.d ● Files in this directory are “ordered” byFiles in this directory are “ordered” by number.number. ● Existing files may be overwritten by pkgExisting files may be overwritten by pkg upgrades, adding a new 50_* file isupgrades, adding a new 50_* file is recommended.recommended.
  • 22. ● Additionally a /boot/grub/custom.cfg fileAdditionally a /boot/grub/custom.cfg file can be created, which will be sourced forcan be created, which will be sourced for the end of grub.cfgthe end of grub.cfg Adding menu entries to GRUBAdding menu entries to GRUB
  • 23. menuentry "My Menu Entry" {menuentry "My Menu Entry" { insmod zfsinsmod zfs search --no-floppy -s -l tank1search --no-floppy -s -l tank1 kfreebsd /ROOT/default/@/boot/kernel/kernelkfreebsd /ROOT/default/@/boot/kernel/kernel kfreebsd_loadenv /ROOT/default@/boot/device.hintskfreebsd_loadenv /ROOT/default@/boot/device.hints kfreebsd_module /ROOT/default/@/boot/zfs/zpool.cachekfreebsd_module /ROOT/default/@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cachetype=/boot/zfs/zpool.cache set kFreeBSD.vfs.root.mountfrom=zfs:tank1/ROOT/defaultset kFreeBSD.vfs.root.mountfrom=zfs:tank1/ROOT/default kfreebsd_module_elf /ROOT/default/@/boot/modules/vboxdrv.kokfreebsd_module_elf /ROOT/default/@/boot/modules/vboxdrv.ko kfreebsd_module_elf /ROOT/default/@/boot/modules/nvidia.kokfreebsd_module_elf /ROOT/default/@/boot/modules/nvidia.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/zfs.kokfreebsd_module_elf /ROOT/default/@/boot/kernel/zfs.ko kfreebsd_module_elfkfreebsd_module_elf /ROOT/default/@/boot/kernel/opensolaris.ko/ROOT/default/@/boot/kernel/opensolaris.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/tmpfs.kokfreebsd_module_elf /ROOT/default/@/boot/kernel/tmpfs.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/linux.kokfreebsd_module_elf /ROOT/default/@/boot/kernel/linux.ko set kFreeBSD.kern.ipc.shmseg=1024set kFreeBSD.kern.ipc.shmseg=1024 set kFreeBSD.kern.ipc.shmmni=1024set kFreeBSD.kern.ipc.shmmni=1024 }}
  • 24. A closer look at Life-PreserverA closer look at Life-Preserver
  • 25. What is this Life-Preserver utility?What is this Life-Preserver utility? ● A command-line and graphical front-endA command-line and graphical front-end to:to: ● Scheduled ZFS snapshots / pruningScheduled ZFS snapshots / pruning ● Scheduled ZFS send/recv replicationScheduled ZFS send/recv replication ● Zpool monitoringZpool monitoring ● Bare-Metal restore using PC-BSD mediaBare-Metal restore using PC-BSD media
  • 26. How do I get this utility?How do I get this utility? ● Included out of box on PC-BSD 10.x andIncluded out of box on PC-BSD 10.x and laterlater ● Via FreeBSD ports / packages:Via FreeBSD ports / packages: ● sysutils/pcbsd-utils (Command-line)sysutils/pcbsd-utils (Command-line) ● sysutils/pcbsd-utils-qt4 (GUI front-ends)sysutils/pcbsd-utils-qt4 (GUI front-ends)
  • 27. Scheduling SnapshotsScheduling Snapshots ● To get started with a snapshot schedule,To get started with a snapshot schedule, we can use the following command:we can use the following command: # lpreserver cronsnap tank1 start daily@22 10# lpreserver cronsnap tank1 start daily@22 10 ● Replace “tank1” with your zpoolReplace “tank1” with your zpool ● daily@XX / hourly / 30min / 10min / 5min / autodaily@XX / hourly / 30min / 10min / 5min / auto ● Replace 10 with number to keepReplace 10 with number to keep
  • 28. What does that command do?What does that command do? ● Creates the following entry in /etc/crontabCreates the following entry in /etc/crontab 0 14 * * * root /usr/local/share/lpreserver/backend/runsnap.sh tank1 100 14 * * * root /usr/local/share/lpreserver/backend/runsnap.sh tank1 10 ● When run, the script does the followingWhen run, the script does the following ● Confirm zpool / datasetConfirm zpool / dataset ● Create new snapshot, recursivelyCreate new snapshot, recursively ● Selectively auto-prune snapshotsSelectively auto-prune snapshots ● Send out notification e-mail (if enabled)Send out notification e-mail (if enabled) ● Start auto-replication (if enabled)Start auto-replication (if enabled)
  • 29. Scheduling Snapshots – Auto ModeScheduling Snapshots – Auto Mode ● Snapshots will be created every 5 minutesSnapshots will be created every 5 minutes and kept for an hour.and kept for an hour. ● A hourly snapshot will be kept for a day.A hourly snapshot will be kept for a day. ● A daily snapshot will be kept for a month.A daily snapshot will be kept for a month. ● A monthly snapshot will be kept for a year.A monthly snapshot will be kept for a year.
  • 35. Scheduling SnapshotsScheduling Snapshots ● The life-preserver daemon will also keepThe life-preserver daemon will also keep track of the zpool disk spacetrack of the zpool disk space ● If the capacity falls below 75%, the oldestIf the capacity falls below 75%, the oldest snapshot will be auto-pruned.snapshot will be auto-pruned.
  • 36. How do I enable e-mail notifications?How do I enable e-mail notifications? ● Using the command:Using the command: # lpreserver set <email> (Uses the “mail” command)# lpreserver set <email> (Uses the “mail” command) ● Additional commands:Additional commands: ● # lpreserver set duwarn <percent># lpreserver set duwarn <percent> ● Will send warning when disk free falls below %Will send warning when disk free falls below %
  • 37. ● Additional commands (continued):Additional commands (continued): ● # lpreserver set emailopts ALL/WARN/ERROR# lpreserver set emailopts ALL/WARN/ERROR ● Send mail for all actions, warnings + errors, or errors onlySend mail for all actions, warnings + errors, or errors only
  • 38. Scheduling ScrubsScheduling Scrubs * Recent Update ** Recent Update * ● Support for scheduling ZFS scrubs hasSupport for scheduling ZFS scrubs has recently been added.recently been added. ● Will be included in 10.1 this fallWill be included in 10.1 this fall
  • 39. What about replication?What about replication? ● Once snapshots are enabled, replication can beOnce snapshots are enabled, replication can be setup to run automatically, or at a specificsetup to run automatically, or at a specific intervalinterval ● Replication by default runs over SSHReplication by default runs over SSH ● Uses ZFS send/recv (Requires that target haveUses ZFS send/recv (Requires that target have supported ZFS version)supported ZFS version)
  • 40. Starting replicationStarting replication ● First, prepare a remote systemFirst, prepare a remote system ● Create a ZFS dataset / SSH userCreate a ZFS dataset / SSH user ● Now set ZFS allow properties on datasetNow set ZFS allow properties on dataset # zfs allow -u <user> create,receive,mount,userprop,destroy,send,hold <dataset># zfs allow -u <user> create,receive,mount,userprop,destroy,send,hold <dataset> ● Next start replication on systemNext start replication on system # lpreserver replicate add <host> <user> 22 tank1 remotepool/backups sync# lpreserver replicate add <host> <user> 22 tank1 remotepool/backups sync ● Replace <host>, <user>, 22/Port, etcReplace <host>, <user>, 22/Port, etc
  • 41. What does this replication do?What does this replication do? ● Checks specified zpoolChecks specified zpool ● Checks “backup:lpreserver” ZFS property forChecks “backup:lpreserver” ZFS property for last replicationlast replication ● Check if doing a first-time / “full” replication orCheck if doing a first-time / “full” replication or else perform incrementalelse perform incremental ● Start the ZFS send/recv commandsStart the ZFS send/recv commands ● After successful send, mark “backup:lpreserver”After successful send, mark “backup:lpreserver” property with last snapshot replicatedproperty with last snapshot replicated
  • 42. What does this replication do? (Contd)What does this replication do? (Contd) ● Build a complete list of zpool / datasetBuild a complete list of zpool / dataset propertiesproperties ● Save this list to remote systemSave this list to remote system ● Check if e-mail reporting is enabled, sendCheck if e-mail reporting is enabled, send results / logsresults / logs
  • 43. Notes on replicationNotes on replication ● First time replication can take some timeFirst time replication can take some time ● During replication new snapshots can beDuring replication new snapshots can be created, but auto-pruning is disabledcreated, but auto-pruning is disabled ● If a replication fails, it may be required to re-If a replication fails, it may be required to re- initialize the remote side.initialize the remote side. ● # lpreserver replicate init <mypool># lpreserver replicate init <mypool>
  • 44. Getting my stuff back!Getting my stuff back! ● Once snapshots are being created, there areOnce snapshots are being created, there are several ways to revert or restore filesseveral ways to revert or restore files ● Via the CLI you can run:Via the CLI you can run: # lpreserver revertsnap <dataset> <snap># lpreserver revertsnap <dataset> <snap> ● Additionally you can browse files in theAdditionally you can browse files in the <mountpoint>/.zfs/snapshot directory<mountpoint>/.zfs/snapshot directory
  • 45. Getting my stuff back!Getting my stuff back! ● Via the GUI utility, it is possible toVia the GUI utility, it is possible to “browse” snapshot data, as well as scroll“browse” snapshot data, as well as scroll backwards in time.backwards in time.
  • 46. Getting my stuff back!Getting my stuff back!
  • 47. Getting my stuff back!Getting my stuff back!
  • 48. How about bare-metal restores?How about bare-metal restores? ● The PC-BSD 10.x install DVD/USB media canThe PC-BSD 10.x install DVD/USB media can provide “bare-metal” restore functionalityprovide “bare-metal” restore functionality ● Currently limited to the GUI install, but will beCurrently limited to the GUI install, but will be added to the text-installer in the futureadded to the text-installer in the future ● Allows you to adjust / change zpool optionsAllows you to adjust / change zpool options
  • 49. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 50. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 51. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 52. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 53. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 54. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 55. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 56. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 57. The bare-metal nitty grittyThe bare-metal nitty gritty ● PC-BSD uses the pc-sysinstall installationPC-BSD uses the pc-sysinstall installation backendbackend ● Supports the “zfsrestore” installMode,Supports the “zfsrestore” installMode, allowing installs from a ZFS replicationallowing installs from a ZFS replication ● Uses SSH as the transfer agentUses SSH as the transfer agent ● Uses normal pc-sysinstall disk-setupUses normal pc-sysinstall disk-setup
  • 58. The bare-metal nitty gritty (contd)The bare-metal nitty gritty (contd) ● Example pc-sysinstall configExample pc-sysinstall config installMode=zfsrestoreinstallMode=zfsrestore sshHost=backuphostsshHost=backuphost sshUser=backupusersshUser=backupuser sshPort=22sshPort=22 sshKey=/root/.ssh/backupkey_rsasshKey=/root/.ssh/backupkey_rsa zfsProps=.lp-props-backups-systemnamezfsProps=.lp-props-backups-systemname zfsRemoteDataset=/backups/systemnamezfsRemoteDataset=/backups/systemname
  • 59. What about ZFS mirroring?What about ZFS mirroring? ● During system installation, you may have setupDuring system installation, you may have setup with a single-disk, or raidz.with a single-disk, or raidz. ● Life-Preserver can “attach” new disks, creatingLife-Preserver can “attach” new disks, creating a mirror or adding additional raidz disks.a mirror or adding additional raidz disks.
  • 60. What about ZFS mirroring? (Contd)What about ZFS mirroring? (Contd) ● Attaching a new disk to existing zpoolAttaching a new disk to existing zpool # lpreserver zpool attach tank1 /dev/da0# lpreserver zpool attach tank1 /dev/da0 ● Life-Preserver takes the following stepsLife-Preserver takes the following steps ● Wipes partitions on new diskWipes partitions on new disk ● Creates matching GPT/MBR partitionCreates matching GPT/MBR partition ● Makes the disk bootable with GRUBMakes the disk bootable with GRUB ● Inserts disk into zpool to begin resilverInserts disk into zpool to begin resilver processprocess
  • 61. Questions?Questions? ReferencesReferences http://www.slideshare.net/krispcbsd/lpreservereurobsd2014http://www.slideshare.net/krispcbsd/lpreservereurobsd2014 BSDCan pc-sysinstall talk 2010BSDCan pc-sysinstall talk 2010 http://www.bsdcan.org/2010/schedule/events/173.en.htmlhttp://www.bsdcan.org/2010/schedule/events/173.en.html