-This document describes the DragonFly environment one will find on a newly installed system using the default options in the installer after selecting HAMMER for the file systems option.

-

-[[!toc levels=3 ]]

-

-## Disk, Partition layout, Mount points, PFSes, Snapshots

-

-If you followed the default options during installation you will be

-left with a system with the following disk configuration

-

-

- # df -h

- Filesystem Size Used Avail Capacity Mounted on

- ROOT 288G 12G 276G 4% /

- devfs 1.0K 1.0K 0B 100% /dev

- /dev/serno/9VMBWDM1.s1a 756M 138M 558M 20% /boot

- /pfs/@@-1:00001 288G 12G 276G 4% /var

- /pfs/@@-1:00002 288G 12G 276G 4% /tmp

- /pfs/@@-1:00003 288G 12G 276G 4% /usr

- /pfs/@@-1:00004 288G 12G 276G 4% /home

- /pfs/@@-1:00005 288G 12G 276G 4% /usr/obj

- /pfs/@@-1:00006 288G 12G 276G 4% /var/crash

- /pfs/@@-1:00007 288G 12G 276G 4% /var/tmp

- procfs 4.0K 4.0K 0B 100% /proc

-

-In this example

-

-**/dev/serno/9VMBWDM1** is the hard disk specified with serial number,

-

-**/dev/serno/9VMBWDM1.s1** is the first slice on the hard disk.

-

-Let us see its disklabel

-

-

- # sudo disklabel /dev/serno/9VMBWDM1.s1

- # /dev/serno/9VMBWDM1.s1:

- #

- # Informational fields calculated from the above

- # All byte equivalent offsets must be aligned

- #

- # boot space: 1044992 bytes

- # data space: 312567643 blocks # 305241.84 MB (320069266944 bytes)

- #

- # NOTE: If the partition data base looks odd it may be

- # physically aligned instead of slice-aligned

- #

- diskid: e67030af-d2af-11df-b588-01138fad54f5

- label:

- boot2 data base: 0x000000001000

- partitions data base: 0x000000100200

- partitions data stop: 0x004a85ad7000

- backup label: 0x004a85ad7000

- total size: 0x004a85ad8200 # 305242.84 MB

- alignment: 4096

- display block size: 1024 # for partition display only

-

- 16 partitions:

- # size offset fstype fsuuid

- a: 786432 0 4.2BSD # 768.000MB

- b: 8388608 786432 swap # 8192.000MB

- d: 303392600 9175040 HAMMER # 296281.836MB

- a-stor_uuid: eb1c8aac-d2af-11df-b588-01138fad54f5

- b-stor_uuid: eb1c8aec-d2af-11df-b588-01138fad54f5

- d-stor_uuid: eb1c8b21-d2af-11df-b588-01138fad54f5

-

-

-The slice has 3 partitions:

-

-a - for /boot

-

-b - for swap

-

-d - for /, a HAMMER file system labeled ROOT

-

-When you create a HAMMER file system you must give it a label, here the Installer labeled it as "ROOT" and mounted it as

-

- ROOT 288G 12G 276G 4% /

-

-Now a PFS is a Pseudo File System inside a HAMMER file system. The HAMMER file system in which the PFSes are created is referred to as the root file system. (You should not confuse the "root" file system with the Label "ROOT", the label can be anything it is just that the installer Labeled it as ROOT

-because it is mounted as /)

-

-Now inside the ROOT HAMMER file system you find the installed created 7 PFSes from the `df -h' output above, let us see how they are mounted in fstab

-

- # cat /etc/fstab

- # Device Mountpoint FStype Options Dump Pass#

- /dev/serno/9VMBWDM1.s1a /boot ufs rw 1 1

- /dev/serno/9VMBWDM1.s1b none swap sw 0 0

- /dev/serno/9VMBWDM1.s1d / hammer rw 1 1

- /pfs/var /var null rw 0 0

- /pfs/tmp /tmp null rw 0 0

- /pfs/usr /usr null rw 0 0

- /pfs/home /home null rw 0 0

- /pfs/usr.obj /usr/obj null rw 0 0

- /pfs/var.crash /var/crash null rw 0 0

- /pfs/var.tmp /var/tmp null rw 0 0

- proc /proc procfs rw 0 0

-

-

-The PFSes are mounted using a NULL mount because they are also HAMMER file systems. You can read more on NULL mounts here [mount_null(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=mount_null&section=8).

-

-You don't need to specify a Size for the PFSes like you do for Logical Volumes inside a Volume Group for LVM. All the Free space in the root HAMMER file system is available for all the PFSes to grow. That is the reason in the `df -h' output above you saw free space is same for all PFSes and the root HAMMER file system.

-

-Now if you look in /var

-

- # cd /var/

- # ls

- account backups caps cron empty log msgs run spool yp at

- cache crash db games lib mail preserve rwho tmp

-

-you will find the above directories.

-

-If you look at the status of one of the PFSes say /usr you will see /var/hammer is the default snapshot directory.

-

-

- # hammer pfs-status /usr/

- /usr/ PFS #3 {

- sync-beg-tid=0x0000000000000001

- sync-end-tid=0x0000000117ac6270

- shared-uuid=f33e318e-d2af-11df-b588-01138fad54f5

- unique-uuid=f33e31cb-d2af-11df-b588-01138fad54f5

- label=""

- prune-min=00:00:00

- operating as a MASTER

- snapshots directory defaults to /var/hammer/<pfs>

- }

- #

-

-

-But there is no "hammer" directory in /var now. That is because no snapshots are yet taken. You can verify this by checking the snapshots available for /usr

-

- # hammer snapls /usr

- Snapshots on /usr PFS #3

- Transaction ID Timestamp Note

- #

-

-The best way to take a snapshot of the whole system is to run the command `hammer cleanup'. It does a lot of things but the fist thing it does during cleanup of a PFS is to take its snapshots as configured.

-

- # sudo hammer cleanup

- cleanup / - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/root

- handle PFS #0 using /var/hammer/root

- snapshots - run

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /var - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/var

- handle PFS #1 using /var/hammer/var

- snapshots - run

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /tmp - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/tmp

- handle PFS #2 using /var/hammer/tmp

- snapshots - disabled

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /usr - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/usr

- handle PFS #3 using /var/hammer/usr

- snapshots - run

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /home - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/home

- handle PFS #4 using /var/hammer/home

- snapshots - run

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /usr/obj - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/usr/obj

- handle PFS #5 using /var/hammer/usr/obj

- snapshots - disabled

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /var/crash - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/var/crash

- handle PFS #6 using /var/hammer/var/crash

- snapshots - run

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /var/tmp - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/var/tmp

- handle PFS #7 using /var/hammer/var/tmp

- snapshots - disabled

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- cleanup /var/isos - HAMMER UPGRADE: Creating snapshots

- Creating snapshots in /var/hammer/var/isos

- handle PFS #8 using /var/hammer/var/isos

- snapshots - run

- prune - run

- rebalance - run..

- reblock - run....

- recopy - run....

- #

-

-You must have noticed that snapshots were not taken for '/tmp', '/usr/obj' and '/var/tmp'. That is how it is automatically configured by the installer.

-

-Let us look again in /var now

-

- # ls

- account backups caps cron empty hammer log msgs run spool yp

- at cache crash db games lib mail preserve rwho tmp

-

-

-We have a new directory called "hammer" with the following sub directories

-DragonFly default installation contains the base software/programs from the DragonFly project itself and few other software from [pkgsrc](http://www.netbsd.org/docs/software/packages.html) which is the DragonFly official package management system. Ready to install binary software from pkgsrc is referred to as "<b>Packages</b>".

-

-The base programs are located in the folders

-

- /bin /sbin

- /usr/bin /usr/sbin

- /usr/local/bin /usr/local/sbin

-

-Their configuration files are found mainly in <b>/etc</b>. there is also <b> /usr/local/etc </b>

-

-The software/programs from pkgsrc are located in <b>/usr/pkg/bin and /usr/pkg/sbin</b>. Their configuration files are found in <b>/usr/pkg/etc</b>.

-

-## Installing new Software from pkgsrc packages

-

-A Detailed description on how to use packages and pkgsrc are given [[here|docs/howtos/HowToPkgsrc]].

-

-For those who are new to the BSD way of doing things can also have the Debian's apt like way of installing, removing and updating packages.

-

-**pkgin** does things similar to **apt-get** or **aptitude** or **yum** for that matter.

-

-First we need to configure pkgin to use a repository which contains the pkgsrc binary packages. You can get a list of DragonFly mirrors [here](http://www.dragonflybsd.org/mirrors/). For this example we will use the <b>Belarus</b> [HTTP mirror](http://mirror.datacenter.by/pub/DragonFlyBSD/) shown on that page first under Europe.

-If there are symbols **=** or **<** or **>** after a package name in the output then the last 3 lines of the output will explain them.

-

-To search for a package and install it you can do the following. If there are different versions of the package available in the repository it will show you the list and you need to specify one from them explicitly. At the end of the installation it will show you a message if you need any further configuration for the software to work in a particular way.

-

-

- dfly-vmsrv# pkgin search mysql-client

- mysql-client-4.1.22nb4 MySQL 4, a free SQL database (client)

- mysql-client-5.0.91 MySQL 5, a free SQL database (client)

- mysql-client-5.1.49 MySQL 5, a free SQL database (client)

-

- =: package is installed and up-to-date

- <: package is installed but newer version is available

- >: installed package has a greater version than available package

- dfly-vmsrv# pkgin install mysql-client

- there's more than one version available for this package.

- please re-run pkgin with a package name matching one of the following:

- mysql-client-4.1.22nb4

- mysql-client-5.0.91

- mysql-client-5.1.49

- nothing to do.

- dfly-vmsrv# pkgin install mysql-client-5.1.49

- calculating dependencies for mysql-client-5.1.49...

- nothing to upgrade.

- 1 packages to be installed: mysql-client-5.1.49 (7620K to download, 24M to install)