ZFS Boot Environments Reloaded NLUUG ZFS Boot Environments Reloaded

Total Page:16

File Type:pdf, Size:1020Kb

ZFS Boot Environments Reloaded NLUUG ZFS Boot Environments Reloaded ZFS Boot Environments Reloaded NLUUG ZFS Boot Environments Reloaded Sławomir Wojciech Wojtczak [email protected] vermaden.wordpress.com twitter.com/vermaden https://is.gd/BECTL ntro !"#$%##%#& ZFS Boot Environments Reloaded NLUUG What is ZFS Boot Environment? Its bootable clone%sna(shot of the working system. What it is' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG What is ZFS Boot Environment? Its bootable clone%sna(shot of the working system. ● In ZFS terminology its clone of the snapshot. ZFS dataset → ZFS dataset@snapshot → ZFS clone (origin=dataset@snapshot) What it is' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG What is ZFS Boot Environment? Its bootable clone%sna(shot of the working system. ● In ZFS terminology its clone of the snapshot. ZFS dataset → ZFS dataset@snapshot → ZFS clone (origin=dataset@snapshot) ● In ZFS (as everywhere) sna(shot is read onl). What it is' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG What is ZFS Boot Environment? Its bootable clone%sna(shot of the working system. ● In ZFS terminology its clone of the snapshot. ZFS dataset → ZFS dataset@snapshot → ZFS clone (origin=dataset@snapshot) ● In ZFS (as everywhere) sna(shot is read onl). ● In ZFS clone can be mounted read write (and you can boot from it). What it is' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG What is ZFS Boot Environment? Its bootable clone%sna(shot of the working system. ● In ZFS terminology its clone of the snapshot. ZFS dataset → ZFS dataset@snapshot → ZFS clone (origin=dataset@snapshot) ● In ZFS (as everywhere) sna(shot is read onl). ● In ZFS clone can be mounted read write (and you can boot from it). ● The B s are !laced in the (ool/R**+ ZFS dataset !ath. sys/ROOT/default sys/ROOT/safe sys/ROOT/pre-upgrade ( .) What it is' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. ● &!date system inside new ZFS Boot nvironment without touching running system. Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. ● &!date system inside new ZFS Boot nvironment without touching running system. ● 'erform u!grade and test the results inside FreeBSD 0ail. Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. ● &!date system inside new ZFS Boot nvironment without touching running system. ● 'erform u!grade and test the results inside FreeBSD 0ail. ● 1o()%move ZFS Boot nvironment into another machine. Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. ● &!date system inside new ZFS Boot nvironment without touching running system. ● 'erform u!grade and test the results inside FreeBSD 0ail. ● 1o()%move ZFS Boot nvironment into another machine. ● 2ajor recon34-ration (Bareos/Post()#*). Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. ● &!date system inside new ZFS Boot nvironment without touching running system. ● 'erform u!grade and test the results inside FreeBSD 0ail. ● 1o()%move ZFS Boot nvironment into another machine. ● 2ajor recon34-ration (Bareos/Post()#*). ● 2ass (o(-late large amount of servers with one con(gured B . Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Use cases' "llows ,ullet(roo. upgrades/changes to the system. ● Create sa.e .ail,ack ZFS Boot nvironment before u!grade or major changes to system. ● &!date system inside new ZFS Boot nvironment without touching running system. ● 'erform u!grade and test the results inside FreeBSD 0ail. ● 1o()%move ZFS Boot nvironment into another machine. ● 2ajor recon34-ration (Bareos/Post()#*). ● 2ass (o(-late large amount of servers with one con(gured B . ● Bare metal ,ack-( solution. Use cases' !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Can I test and break ZFS BEs witho-t conse5-ences' Bullet(roo. !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Can I test and break ZFS BEs witho-t conse5-ences' +es you can, *ver and over again. Bullet(roo. !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Can I test and break ZFS BEs witho-t conse5-ences' +es you can, *ver and over again. -roundhog .ay (1001) Bullet(roo. !"#$%##%#& ZFS Boot Environments Reloaded NLUUG 6ow the World was be.ore BEs' 2endors used s(lit mirror or co(yin4 3les to the other#second disk. B2 7 8 SUN Solaris Live Upgrade alt_disk_copy lucreate alt_disk_install luactivate nimadm luupgrade unmirrorvg ludelete (...) (...) 69:U8 GNU/Lin-; lvsplit mdadm lvmerge mirrorlv vgchange lvconvert vgcfgrestore (...) (...) /ark ages !"#$%##%#& ZFS Boot Environments Reloaded NLUUG 2istyped command? Felling luck)3 4aiders of the 5ost "rk (106/) *ne mistake and )o- have a disaster ... recover) !"#$%##%#& ZFS Boot Environments Reloaded 'olish BSD UserNLUUG Grou! +he beadm command 7ne simple command 8 beadm 8 to create#activate#destroy ZFS Boot nvironments. # beadm usage: beadm activate <beName> beadm create [-e nonActiveBe | -e beName@snapshot] <beName> beadm create <beName@snapshot> beadm destroy [-F] <beName | beName@snapshot> beadm list [-a] [-s] [-D] [-H] beadm rename <origBeName> <newBeName> beadm mount <beName> [mountpoint] beadm { umount | unmount } [-f] <beName> beadm version beadm command !"#$%##%#& ZFS Boot Environments Reloaded NLUUG +he beadm is written in P*S 8 /bin/sh beadm code !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Example beadm usa4e (1/5) 5ist current B s and create new one named new,e. # beadm list BE Active Mountpoint Space Created 11.2-RELEASE NR / 6.3G 2018-11-15 16:01 # beadm create newbe Created successfully # beadm list BE Active Mountpoint Space Created 11.2-RELEASE NR / 6.3G 2018-11-15 16:01 newbe - - 296.0K 2018-11-15 17:04 E;am(le #%& !"#$%##%#& ZFS Boot Environments Reloaded NLUUG E;ample beadm usa4e (2/5) 2erify which sna(shot is used for this clone used as new,e B . # beadm list -s BE/Dataset/Snapshot Active Mountpoint Space Created 11.2-RELEASE sys/ROOT/11.2-RELEASE NR / 6.3G 2018-11-15 16:01 sys/ROOT/11.2-RELEASE@2018-11-15-17:04:22 - - 288.0K 2018-11-15 10:04 newbe sys/ROOT/newbe - - 8.0K 2018-11-15 10:04 11.2-RELEASE@2018-11-15-17:04:22 - - 288.0K 2018-11-15 10:04 # zfs get origin sys/ROOT/newbe NAME PROPERTY VALUE SOURCE sys/ROOT/newbe origin sys/ROOT/11.2-RELEASE@2018-11-15-17:04:22 - E;am(le !%& !"#$%##%#& ZFS Boot Environments Reloaded 'olish BSD UserNLUUG Grou! E;ample beadm -sage (3/5) 4ename sna(shot used for this clone. # zfs rename sys/ROOT/11.2-RELEASE@2018-11-15-17:04:22 sys/ROOT/11.2-RELEASE@newbe # zfs get origin sys/ROOT/newbe NAME PROPERTY VALUE SOURCE sys/ROOT/newbe origin sys/ROOT/11.2-RELEASE@newbe - # beadm list -s BE/Dataset/Snapshot Active Mountpoint Space Created 11.2-RELEASE sys/ROOT/11.2-RELEASE NR / 6.3G 2018-11-15 16:01 sys/ROOT/11.2-RELEASE@newbe - - 516.0K 2018-11-15 17:04 newbe sys/ROOT/newbe - - 8.0K 2018-11-15 17:04 11.2-RELEASE@newbe - - 516.0K 2018-11-15 17:04 E;am(le =%& !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Example beadm usa4e (4/5) "ctivate the new,e B to be booted after the restart. # beadm list BE Active Mountpoint Space Created 11.2-RELEASE NR / 6.4G 2018-11-15 16:01 newbe - - 68.8M 2018-11-15 17:04 # beadm activate newbe Activated successfully # beadm list BE Active Mountpoint Space Created 11.2-RELEASE N / 187.5M 2018-11-15 16:01 newbe R - 6.3G 2018-11-15 17:04 Exam(le >%& !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Example beadm usa4e (5/5) 4emove new,e. It will ask for additional con(rmation as we renamed sna!shot. # beadm list BE Active Mountpoint Space Created 11.2-RELEASE NR / 6.4G 2018-11-15 16:01 newbe - - 68.8M 2018-11-15 17:04 # beadm destroy newbe Are you sure you want to destroy 'newbe'? This action cannot be undone (y/[n]): y Boot environment 'newbe' was created from existing snapshot Destroy '11.2-RELEASE@newbe' snapshot? (y/[n]): y Destroyed successfully # beadm list BE Active Mountpoint Space Created 11.2-RELEASE NR / 6.4G 2018-11-15 16:01 Exam(le &%& !"#$%##%#& ZFS Boot Environments Reloaded NLUUG FreeBS/ loader inte4ration Selection of B at boot is integrated into the FreeBSD loader. FreeBSD loader integration #%! !"#$%##%#& ZFS Boot Environments Reloaded NLUUG FreeBS/ loader inte4ration The test B is selected to boot instead of the default one. FreeBSD loader integration !%! !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Not j-st FreeBS/ loader <<< Its integrated into other o(eratin4 systems as well. ● BSDs ● FreeBS. ● HardenedBS. (rolling Free!SD for#) ● ll-mos ● 7!enIndiana ● OmniOS Not j-st FreeBS/ loader <<< !"#$%##%#& ZFS Boot Environments Reloaded NLUUG Not j-st FreeBS/ loader <<< Its integrated idea implemented into other o(eratin4 systems as well. ● BSDs EuroBSDcon 2018 : B-ildin4 Boot Environment 2anager .or /ragonFly BSD ● FreeBS. "s many users may be aware; .ragonFly BSD<s recently declared the 9"== 4> ● HardenedBS.
Recommended publications
  • Copy on Write Based File Systems Performance Analysis and Implementation
    Copy On Write Based File Systems Performance Analysis And Implementation Sakis Kasampalis Kongens Lyngby 2010 IMM-MSC-2010-63 Technical University of Denmark Department Of Informatics Building 321, DK-2800 Kongens Lyngby, Denmark Phone +45 45253351, Fax +45 45882673 [email protected] www.imm.dtu.dk Abstract In this work I am focusing on Copy On Write based file systems. Copy On Write is used on modern file systems for providing (1) metadata and data consistency using transactional semantics, (2) cheap and instant backups using snapshots and clones. This thesis is divided into two main parts. The first part focuses on the design and performance of Copy On Write based file systems. Recent efforts aiming at creating a Copy On Write based file system are ZFS, Btrfs, ext3cow, Hammer, and LLFS. My work focuses only on ZFS and Btrfs, since they support the most advanced features. The main goals of ZFS and Btrfs are to offer a scalable, fault tolerant, and easy to administrate file system. I evaluate the performance and scalability of ZFS and Btrfs. The evaluation includes studying their design and testing their performance and scalability against a set of recommended file system benchmarks. Most computers are already based on multi-core and multiple processor architec- tures. Because of that, the need for using concurrent programming models has increased. Transactions can be very helpful for supporting concurrent program- ming models, which ensure that system updates are consistent. Unfortunately, the majority of operating systems and file systems either do not support trans- actions at all, or they simply do not expose them to the users.
    [Show full text]
  • ZFS (On Linux) Use Your Disks in Best Possible Ways Dobrica Pavlinušić CUC Sys.Track 2013-10-21 What Are We Going to Talk About?
    ZFS (on Linux) use your disks in best possible ways Dobrica Pavlinušić http://blog.rot13.org CUC sys.track 2013-10-21 What are we going to talk about? ● ZFS history ● Disks or SSD and for what? ● Installation ● Create pool, filesystem and/or block device ● ARC, L2ARC, ZIL ● snapshots, send/receive ● scrub, disk reliability (smart) ● tuning zfs ● downsides ZFS history 2001 – Development of ZFS started with two engineers at Sun Microsystems. 2005 – Source code was released as part of OpenSolaris. 2006 – Development of FUSE port for Linux started. 2007 – Apple started porting ZFS to Mac OS X. 2008 – A port to FreeBSD was released as part of FreeBSD 7.0. 2008 – Development of a native Linux port started. 2009 – Apple's ZFS project closed. The MacZFS project continued to develop the code. 2010 – OpenSolaris was discontinued, the last release was forked. Further development of ZFS on Solaris was no longer open source. 2010 – illumos was founded as the truly open source successor to OpenSolaris. Development of ZFS continued in the open. Ports of ZFS to other platforms continued porting upstream changes from illumos. 2012 – Feature flags were introduced to replace legacy on-disk version numbers, enabling easier distributed evolution of the ZFS on-disk format to support new features. 2013 – Alongside the stable version of MacZFS, ZFS-OSX used ZFS on Linux as a basis for the next generation of MacZFS. 2013 – The first stable release of ZFS on Linux. 2013 – Official announcement of the OpenZFS project. Terminology ● COW - copy on write ○ doesn’t
    [Show full text]
  • Pete's All Things Sun (PATS): the State Of
    We are in the midst of a file sys - tem revolution, and it is called ZFS. File sys- p e t e R B a e R G a Lv i n tem revolutions do not happen very often, so when they do, excitement ensues— Pete’s all things maybe not as much excitement as during a political revolution, but file system revolu- Sun (PATS): the tions are certainly exciting for geeks. What are the signs that we are in a revolution? By state of ZFS my definition, a revolution starts when the Peter Baer Galvin (www.galvin.info) is the Chief peasants (we sysadmins) are unhappy with Technologist for Corporate Technologies, a premier the status quo, some group comes up with systems integrator and VAR (www.cptech.com). Be- fore that, Peter was the systems manager for Brown a better idea, and the idea spreads beyond University’s Computer Science Department. He has written articles and columns for many publications that group and takes on a life of its own. Of and is coauthor of the Operating Systems Concepts course, in a successful revolution the new and Applied Operating Systems Concepts textbooks. As a consultant and trainer, Peter teaches tutorials idea actually takes hold and does improve and gives talks on security and system administra- tion worldwide. the peasant’s lot. [email protected] ;login: has had two previous articles about ZFS. The first, by Tom Haynes, provided an overview of ZFS in the context of building a home file server (;login:, vol. 31, no. 3). In the second, Dawidek and McKusick (;login:, vol.
    [Show full text]
  • Uefi وبعض أنظمة Bios Uefi واجهة الربنامج الثابت املوحدة والقابلة للتمديد
    - جدول أقسامGUID GUID Partition Table جدول أقسام )أو تقسيم( يستخدم املعرفات الفريدة العميمة "! G % تعري. و-يي, ا+قسام *( ال)'ي& املقسم % أ$#مة !0/ و2ع1 أ$#مة 45!3 UEFI واج=ة ال>$ا;: ال9ا82 امل)7دة والقا62ة ل6تمديد مس جد? % ;<رم ّو@B @AA دة 'Cتمرب/أي6)ل DE@F2 " F جدول أقسام GUID *باIة *H تخGيط )أو تقسيم( جدول أقسام ;عياJI *( أج=,ة التخ,يH الفي,ياKيةM9; L ا+قراN الثا2تةL أو أقراN الحالة الC6OةPQ Lا التخGيط يستخدم املعرR الفريد العميم U@TS % متيي, ا+قسام وأ$)ا*هاL وXIم أ$W ج,H; V ;عياI واج=ة ال>نا;: الثا82 امل)حدة والقا62ة ل6تمديد !U ZD S YL /0 )املق^[ ;H ;\تد] h _`abc /0! 0defgبديM ل6\ظام التق6يدJ 45!3( $ظام Hlm GPj ا'تخدا;W أيضا % 2ع1 أ$#مة 45!3 بسnC ;حدو?ية جدول أقسام Lo3p الذJ يستخدم 82qTD فقط % تخ,يH ;ع6)مات ال<rم و*ناويr7 v; us3t Hم القGاw التق6يدqx@D Jبايu8 ;ع#م أ$#مة التشyيM تد*م P\; LGPj العام LDE@E 2ع1 ا+$#مة ;M9 ما{ أوu|} ومايكرو')ف8 ويندو~ )x86( تد*م فقط اإلقالH; w أقسام GPj % أ$#مة !L /0!B/0 2ي\ام ;ع#م ت)~يعات لي\lس و ت)~يعات 2ريhيل ي)$lس ;M9 فرJ يب |} ?lm J\ها اإلقالH; w أقسام GPj % أج=,ة 45!3 أو أج=,ة !u /0 6A TD % ا+قراN الثا2تة التي تستخدم r7م القطاw املعياx@D JI بايL8 ال<rم ا+قىص ل6قرN با'تخدام DuD (Q o3p ترياباي8 أو ) x@D × D بايuU @ S )8 2ي\ام ال<rم ا+قىص ل6قرN با'تخدام GPj 'يك)ن FuA ~يتاباي8 أو ) x@D × D بايU T S U @ S )8 والسnC % ذلك ا'تخدام H; 82 6A أجM *ناويH الكتM امل\Gقية % جدول أقسام u GPj تاIيخياL رشhة |$تي LM كا$8 وIاV تG)ير LGPj أواخر التسعينات )L)DEEE الذJ أصCح ج,H; V ;)اصفة !U D S Y /0 % عام DE@E وت<8 |?اIة Qيئة خاصة تد*ى !P\; u _`abc /0 عام uDEEF قطاعات GPT % عام LDE@E *ندما بدأ ;\تr)ن ا+قراN الثا2تة الت<)ل |ىل ت)ظي.
    [Show full text]
  • The Parallel File System Lustre
    The parallel file system Lustre Roland Laifer STEINBUCH CENTRE FOR COMPUTING - SCC KIT – University of the State Rolandof Baden Laifer-Württemberg – Internal and SCC Storage Workshop National Laboratory of the Helmholtz Association www.kit.edu Overview Basic Lustre concepts Lustre status Vendors New features Pros and cons INSTITUTSLustre-, FAKULTÄTS systems-, ABTEILUNGSNAME at (inKIT der Masteransicht ändern) Complexity of underlying hardware Remarks on Lustre performance 2 16.4.2014 Roland Laifer – Internal SCC Storage Workshop Steinbuch Centre for Computing Basic Lustre concepts Client ClientClient Directory operations, file open/close File I/O & file locking metadata & concurrency INSTITUTS-, FAKULTÄTS-, ABTEILUNGSNAME (in der Recovery,Masteransicht ändern)file status, Metadata Server file creation Object Storage Server Lustre componets: Clients offer standard file system API (POSIX) Metadata servers (MDS) hold metadata, e.g. directory data, and store them on Metadata Targets (MDTs) Object Storage Servers (OSS) hold file contents and store them on Object Storage Targets (OSTs) All communicate efficiently over interconnects, e.g. with RDMA 3 16.4.2014 Roland Laifer – Internal SCC Storage Workshop Steinbuch Centre for Computing Lustre status (1) Huge user base about 70% of Top100 use Lustre Lustre HW + SW solutions available from many vendors: DDN (via resellers, e.g. HP, Dell), Xyratex – now Seagate (via resellers, e.g. Cray, HP), Bull, NEC, NetApp, EMC, SGI Lustre is Open Source INSTITUTS-, LotsFAKULTÄTS of organizational-, ABTEILUNGSNAME
    [Show full text]
  • Introduzione Al Mondo Freebsd
    Introduzione al mondo FreeBSD Corso avanzato Netstudent Netstudent http://netstudent.polito.it E.Richiardone [email protected] maggio 2009 CC-by http://creativecommons.org/licenses/by/2.5/it/ The FreeBSD project - 1 ·EÁ un progetto software open in parte finanziato ·Lo scopo eÁ mantenere e sviluppare il sistema operativo FreeBSD ·Nasce su CDROM come FreeBSD 1.0 nel 1993 ·Deriva da un patchkit per 386BSD, eredita codice da UNIX versione Berkeley 1977 ·Per problemi legali subisce un rallentamento, release 2.0 nel 1995 con codice royalty-free ·Dalla release 5.0 (2003) assume la struttura che ha oggi ·Disponibile per x86 32 e 64bit, ia64, MIPS, ppc, sparc... ·La mascotte (Beastie) nasce nel 1984 The FreeBSD project - 2 ·Erede di 4.4BSD (eÁ la stessa gente...) ·Sistema stabile; sviluppo uniforme; codice molto chiaro, ordinato e ben commentato ·Documentazione ufficiale ben curata ·Licenza molto permissiva, spesso attrae aziende per progetti commerciali: ·saltuariamente esterni collaborano con implementazioni ex-novo (i.e. Intel, GEOM, atheros, NDISwrapper, ZFS) ·a volte no (i.e. Windows NT) ·Semplificazione di molte caratteristiche tradizionali UNIX Di cosa si tratta Il progetto FreeBSD include: ·Un sistema base ·Bootloader, kernel, moduli, librerie di base, comandi e utility di base, servizi tradizionali ·Sorgenti completi in /usr/src (~500MB) ·EÁ giaÁ abbastanza completo (i.e. ipfw, ppp, bind, ...) ·Un sistema di gestione per software aggiuntivo ·Ports e packages ·Documentazione, canali di assistenza, strumenti di sviluppo ·i.e. Handbook,
    [Show full text]
  • Porting the ZFS File System to the Freebsd Operating System
    Porting the ZFS file system to the FreeBSD operating system Pawel Jakub Dawidek [email protected] 1 Introduction within the same ”pool”, share the whole storage assigned to the ”pool”. A pool is a collection of storage devices. It The ZFS file system makes a revolutionary (as opposed may be constructured from one partition only, as well as to evolutionary) step forward in file system design. ZFS from hundreds of disks. If we need more storage we just authors claim that they throw away 20 years of obsolute add more disks. The new disks are added at run time and assumptions and designed an integrated system from the space is automatically available to all file systems. scratch. Thus there is no need to manually grow or shrink the file systems when space allocation requirements change. The ZFS file system was developed by Sun Microsys- There is also no need to create slices or partitions, one tems, Inc. and was first available in Solaris 10 operating can simply forget about tools like fdisk(8), bsdlabel(8), system. Although we cover some of the key features of newfs(8), tunefs(8) and fsck(8) when working with ZFS. the ZFS file system, the primary focus of this paper is to cover how ZFS was ported to the FreeBSD operating system. 2.2 Copy-on-write design FreeBSD is an advanced, secure, stable and scalable To ensure the file system is functioning in a stable and UNIX-like operating system, which is widely deployed reliable manner, it must be in a consistent state.
    [Show full text]
  • BSD UNIX Toolbox 1000+ Commands for Freebsd, Openbsd
    76034ffirs.qxd:Toolbox 4/2/08 12:50 PM Page iii BSD UNIX® TOOLBOX 1000+ Commands for FreeBSD®, OpenBSD, and NetBSD®Power Users Christopher Negus François Caen 76034ffirs.qxd:Toolbox 4/2/08 12:50 PM Page ii 76034ffirs.qxd:Toolbox 4/2/08 12:50 PM Page i BSD UNIX® TOOLBOX 76034ffirs.qxd:Toolbox 4/2/08 12:50 PM Page ii 76034ffirs.qxd:Toolbox 4/2/08 12:50 PM Page iii BSD UNIX® TOOLBOX 1000+ Commands for FreeBSD®, OpenBSD, and NetBSD®Power Users Christopher Negus François Caen 76034ffirs.qxd:Toolbox 4/2/08 12:50 PM Page iv BSD UNIX® Toolbox: 1000+ Commands for FreeBSD®, OpenBSD, and NetBSD® Power Users Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-37603-4 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Library of Congress Cataloging-in-Publication Data is available from the publisher. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permis- sion should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.
    [Show full text]
  • Mandoc: Becoming the Main BSD Manual Toolbox
    mandoc: becoming the main BSD manual toolbox BSDCan 2015, June 13, Ottawa Ingo Schwarze <[email protected]> Cynthia Livingston’sOTTB “Bedifferent” (c) 2013 C. Livingston (with permission) > Ingo Schwarze: mandoc page 2: INTROI BSDCan 2015, June 13, Ottawa Brief history of UNIX documentation • The key point: All documentation in one place and one format. Easy to find, uniform and easy to read and write. Be correct, complete, concise. • 1964: RUNOFF/roffmarkup syntax by Jerome H. Saltzer,MIT. Unobtrusive,diff(1)-friendly,easy to hand-edit, simple tools, high quality output. • 1971: Basic manual structure by Ken Thompson and Dennis Ritchie for the AT&T Version 1 UNIX manuals, Bell Labs. • 1979: man(7) physical markup language for AT&T Version 7 UNIX. • 1989: mdoc(7) semantic markup by Cynthia Livingston for 4.3BSD-Reno. Powerful, self-contained, portable. • 1989: GNU troffbyJames Clarke. • 2001: mdoc(7) rewrite by Werner Lemberg and Ruslan Ermilovfor groff-1.17. • 2008: mandoc(1) started by Kristaps Dzonsons. • 2010: mandoc(1) is the only documentation formatter in the OpenBSD base system. • 2014: mandoc(1) used by default in OpenBSD, FreeBSD, NetBSD, illumos. 16:19:30 What is the mandoc toolbox? → < > Ingo Schwarze: mandoc page 3: INTROIIBSDCan 2015, June 13, Ottawa What is the mandoc toolbox? User perspective:man(1), the manual viewer One comprehensive tool! Normal operation always proceeds in three steps: 1. Find one or more manuals in the file system or using a database by manual name — man(1) — or by search query — apropos(1) =man -k The result of this step can be printed out with man -w.
    [Show full text]
  • GELI Boot Booting from Encrypted Disks on Freebsd
    GELI Boot Booting from Encrypted Disks on FreeBSD Allan Jude -- ScaleEngine Inc. [email protected] twitter: @allanjude Introduction Allan Jude ● 13 Years as FreeBSD Server Admin ● FreeBSD src/doc committer (focus: ZFS, bhyve, ucl, xo) ● Co-Author of “FreeBSD Mastery: ZFS” and “FreeBSD Mastery: Advanced ZFS” with Michael W. Lucas (For sale in the hallway) ● Architect of the ScaleEngine CDN (HTTP and Video) ● Host of BSDNow.tv & TechSNAP.tv Podcasts ● Use ZFS for large collections of videos, extremely large website caches, mirrors of PC-BSD pkgs and RaspBSD ● Single Handedly Manage Over 1000TB of ZFS Storage Overview ● Do a lot of work with ZFS ● Helped build the ZFS bits of the installer ● Integrated ZFS Boot Environments ● Created ZFS Boot Env. Menu ● ZFS Boot Env. do not work with GELI ● Booting from GELI encrypted pool requires creating an unencrypted “boot pool” with the kernel and GELI module ● Boot Environments are awesome, you should use them too I Have Written A Thing ● I am a very novice C programmer ● Implemented a minimal version of GELI in the gpt{,zfs}boot (UFS and ZFS) bootcodes ● Took a lot of time to understand the existing bootcode and how it works ● Took a lot of learning about C ● The existing boot code is terrible, and needs much love, too much copy-pasta ● Had to navigate many obstacles ● but, it works! How Do Computers Even Work? ● BIOS reads the 512 bytes MBR ● Consists of 446 byte bootstrap program, and partition table (4 entries) ● This bootstrap is then executed (boot0.S) ● It examines the partition table and finds the active partition, reads the first 512 bytes ● This is boot1.
    [Show full text]
  • Institutionalizing Freebsd Isolated and Virtualized Hosts Using Bsdinstall(8), Zfs(8) and Nfsd(8)
    Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) [email protected] @MichaelDexter BSDCan 2018 Jails and bhyve… FreeBSD’s had Isolation since 2000 and Virtualization since 2014 Why are they still strangers? Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) Integrating as first-class features Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) This example but this is not FreeBSD-exclusive Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) jail(8) and bhyve(8) “guests” Application Binary Interface vs. Instructions Set Architecture Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) The FreeBSD installer The best file system/volume manager available The Network File System Broad Motivations Virtualization! Containers! Docker! Zones! Droplets! More more more! My Motivations 2003: Jails to mitigate “RPM Hell” 2011: “bhyve sounds interesting...” 2017: Mitigating Regression Hell 2018: OpenZFS EVERYWHERE A Tale of Two Regressions Listen up. Regression One FreeBSD Commit r324161 “MFV r323796: fix memory leak in [ZFS] g_bio zone introduced in r320452” Bug: r320452: June 28th, 2017 Fix: r324162: October 1st, 2017 3,710 Commits and 3 Months Later June 28th through October 1st BUT July 27th, FreeNAS MFC Slips into FreeNAS 11.1 Released December 13th Fixed in FreeNAS January 18th 3 Months in FreeBSD HEAD 36 Days
    [Show full text]
  • GELI (8) Freebsd System Manager's Manual GELI (8) NAME Geli
    GELI (8) FreeBSD System Manager’s Manual GELI (8) NAME geli — control utility for cryptographic GEOM class SYNOPSIS To compile GEOM ELI into your kernel, place the following lines in your kernel configuration file: device crypto options GEOM_ELI Alternately, to load the GEOM ELI module at boot time, place the following line in your loader.conf(5): geom_eli_load="YES" Usage of the geli(8) utility: geli init [ -bPv][ -a algo ][ -i iterations ][ -K newkeyfile][ -l keylen ][ -s sectorsize ] prov geli label - an alias for init geli attach [ -dpv ][ -k keyfile ] prov geli detach [ -fl] prov . geli stop - an alias for detach geli onetime [ -d][ -a algo][ -l keylen][ -s sectorsize ] prov . geli setkey [ -pPv ][ -i iterations ][ -k keyfile][ -K newkeyfile][ -n keyno] prov geli delkey [ -afv ][ -n keyno] prov geli kill [ -av][ prov . ] geli backup [ -v] prov file geli restore [ -v] file prov geli clear [ -v] prov . geli dump [ -v] prov . geli list geli status geli load geli unload DESCRIPTION The geli utility is used to configure encryption on GEOM providers. The following is a list of the most important features: • Utilizes the crypto(9) framework, so when there is crypto hardware available, geli will make use of it automatically. • Supports many cryptographic algorithms (currently AES, Blowfish and 3DES). • Can create a key from a couple of components (user entered passphrase, random bits from a file, etc.). • Allows to encrypt the root partition - the user will be asked for the passphrase before the root file system is mounted. • The passphrase of the user is strengthened with: B. Kaliski, PKCS #5: Password-Based Cryptography Specification, Version 2.0.
    [Show full text]