SlideShare a Scribd company logo
1 of 58
Download to read offline
AsiaBSDCon 2014AsiaBSDCon 2014AsiaBSDCon 2014AsiaBSDCon 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 desktopoutweigh the drawbacks for desktop
usageusage
●
Since moving to only 64bit for 9.2 andSince moving to only 64bit for 9.2 and
later, the last major hurdle has beenlater, 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
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?
●
Eventually, as the BSD loader begins toEventually, as the BSD loader begins to
gain the features that we currently use ingain the features that we currently use in
GRUBGRUB
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
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
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
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>
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 / 5mindaily@XX / hourly / 30min / 10min / 5min
●
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 SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Scheduling SnapshotsScheduling Snapshots
Recent UpdateRecent Update
●
New “auto” mode for snapshot schedulingNew “auto” mode for snapshot scheduling
●
Added for 10.0.1 / quarterly PC-BSDAdded for 10.0.1 / quarterly PC-BSD
updateupdate
Scheduling SnapshotsScheduling Snapshots
●
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
●
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
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
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

More Related Content

What's hot

What every data programmer needs to know about disks
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 disksiammutex
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsCumulus Networks
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Bud Siddhisena
 
Using cobbler in a not so small environment 1.77
Using cobbler in a not so small environment 1.77Using cobbler in a not so small environment 1.77
Using cobbler in a not so small environment 1.77chhorn
 
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...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...NETWAYS
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622Todd Deshane
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISORVanika Kapoor
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procKenny (netman)
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMMarian Marinov
 
A Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry PiA Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry PiJian-Hong Pan
 
Upgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaeseUpgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaeseGratien D'haese
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo家榮 吳
 

What's hot (18)

What every data programmer needs to know about disks
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
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
 
Os Bernier
Os BernierOs Bernier
Os Bernier
 
Using cobbler in a not so small environment 1.77
Using cobbler in a not so small environment 1.77Using cobbler in a not so small environment 1.77
Using cobbler in a not so small environment 1.77
 
NetBSDworkshop
NetBSDworkshopNetBSDworkshop
NetBSDworkshop
 
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...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
 
Chap 17 advfs
Chap 17 advfsChap 17 advfs
Chap 17 advfs
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVM
 
A Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry PiA Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry Pi
 
Upgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaeseUpgrade ux-fosdem-2015-gdhaese
Upgrade ux-fosdem-2015-gdhaese
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo
 

Similar to Life Preserver - AsiaBSDCon2014

Snapshots, Replication, and Boot-Environments by Kris Moore
Snapshots, Replication, and Boot-Environments by Kris Moore Snapshots, Replication, and Boot-Environments by Kris Moore
Snapshots, Replication, and Boot-Environments by Kris Moore eurobsdcon
 
Ci For The Web 2.0 Guy Or Gal
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 GalChad Woolley
 
Ubuntu alternate ubuntu installation
Ubuntu alternate ubuntu installationUbuntu alternate ubuntu installation
Ubuntu alternate ubuntu installationarunkumar sadhasivam
 
Crafting GNU/ linux distributions for embedded target using Builroot
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 BuilrootSourabh Singh Tomar
 
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceCrafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceSourabh Singh Tomar
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012Philip Polstra
 
Repositories as Code
Repositories as CodeRepositories as Code
Repositories as CodeKris Buytaert
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot managerAcácio Oliveira
 
Perfect Linux Desktop - OpenSuSE 12.2
Perfect Linux Desktop - OpenSuSE 12.2Perfect Linux Desktop - OpenSuSE 12.2
Perfect Linux Desktop - OpenSuSE 12.2Davor Guttierrez
 
The origin: Init (compact version)
The origin: Init (compact version)The origin: Init (compact version)
The origin: Init (compact version)Tzung-Bi Shih
 
Getting Started with Buildroot - Lab
Getting Started with Buildroot - LabGetting Started with Buildroot - Lab
Getting Started with Buildroot - LabTrevor Woerner
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineKrimson
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with PuppetKris Buytaert
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootKenny (netman)
 
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebulaOpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebulaOpenNebula Project
 
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606Eunice Lin
 

Similar to Life Preserver - AsiaBSDCon2014 (20)

Snapshots, Replication, and Boot-Environments by Kris Moore
Snapshots, Replication, and Boot-Environments by Kris Moore Snapshots, Replication, and Boot-Environments by Kris Moore
Snapshots, Replication, and Boot-Environments by Kris Moore
 
Ci For The Web 2.0 Guy Or Gal
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
 
Ubuntu alternate ubuntu installation
Ubuntu alternate ubuntu installationUbuntu alternate ubuntu installation
Ubuntu alternate ubuntu installation
 
Crafting GNU/ linux distributions for embedded target using Builroot
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
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceCrafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
Repositories as Code
Repositories as CodeRepositories as Code
Repositories as Code
 
2.2 install boot manager
2.2 install boot manager2.2 install boot manager
2.2 install boot manager
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot manager
 
OpenSolaris 2009.06 Workshop
OpenSolaris 2009.06 WorkshopOpenSolaris 2009.06 Workshop
OpenSolaris 2009.06 Workshop
 
Perfect Linux Desktop - OpenSuSE 12.2
Perfect Linux Desktop - OpenSuSE 12.2Perfect Linux Desktop - OpenSuSE 12.2
Perfect Linux Desktop - OpenSuSE 12.2
 
The origin: Init (compact version)
The origin: Init (compact version)The origin: Init (compact version)
The origin: Init (compact version)
 
Getting Started with Buildroot - Lab
Getting Started with Buildroot - LabGetting Started with Buildroot - Lab
Getting Started with Buildroot - Lab
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev Machine
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with Puppet
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebulaOpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Life Preserver - AsiaBSDCon2014

  • 1. AsiaBSDCon 2014AsiaBSDCon 2014AsiaBSDCon 2014AsiaBSDCon 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 desktopoutweigh the drawbacks for desktop usageusage ● Since moving to only 64bit for 9.2 andSince moving to only 64bit for 9.2 and later, the last major hurdle has beenlater, 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
  • 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? ● Eventually, as the BSD loader begins toEventually, as the BSD loader begins to gain the features that we currently use ingain the features that we currently use in GRUBGRUB
  • 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
  • 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
  • 16.
  • 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
  • 18.
  • 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. A closer look at Life-PreserverA closer look at Life-Preserver
  • 22. 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
  • 23. 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)
  • 24. 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 / 5mindaily@XX / hourly / 30min / 10min / 5min ● Replace 10 with number to keepReplace 10 with number to keep
  • 25. 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)
  • 31. Scheduling SnapshotsScheduling Snapshots Recent UpdateRecent Update ● New “auto” mode for snapshot schedulingNew “auto” mode for snapshot scheduling ● Added for 10.0.1 / quarterly PC-BSDAdded for 10.0.1 / quarterly PC-BSD updateupdate
  • 32. Scheduling SnapshotsScheduling Snapshots ● 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.
  • 33. 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.
  • 34. 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 %
  • 35. ● 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
  • 36. 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)
  • 37. 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
  • 38. 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
  • 39. 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
  • 40. 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>
  • 41. 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
  • 42. 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.
  • 43. Getting my stuff back!Getting my stuff back!
  • 44. Getting my stuff back!Getting my stuff back!
  • 45. 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
  • 46. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 47. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 48. What does a bare-metal restore look like?What does a bare-metal restore look like?
  • 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. 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
  • 55. 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
  • 56. 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.
  • 57. 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
  • 58. Questions?Questions? ReferencesReferences 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