2 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.
6 ## Disk, Partition layout, Mount points, PFSes, Snapshots
8 If you followed the default options during installation you will be
9 left with a system with the following disk configuration
13 Filesystem Size Used Avail Capacity Mounted on
14 ROOT 288G 12G 276G 4% /
15 devfs 1.0K 1.0K 0B 100% /dev
16 /dev/serno/9VMBWDM1.s1a 756M 138M 558M 20% /boot
17 /pfs/@@-1:00001 288G 12G 276G 4% /var
18 /pfs/@@-1:00002 288G 12G 276G 4% /tmp
19 /pfs/@@-1:00003 288G 12G 276G 4% /usr
20 /pfs/@@-1:00004 288G 12G 276G 4% /home
21 /pfs/@@-1:00005 288G 12G 276G 4% /usr/obj
22 /pfs/@@-1:00006 288G 12G 276G 4% /var/crash
23 /pfs/@@-1:00007 288G 12G 276G 4% /var/tmp
24 procfs 4.0K 4.0K 0B 100% /proc
28 **/dev/serno/9VMBWDM1** is the hard disk specified with QUID
30 **/dev/serno/9VMBWDM1.s1** is the first slice on the hard disk.
32 Let us see its disklabel
35 # sudo disklabel /dev/serno/9VMBWDM1.s1
36 # /dev/serno/9VMBWDM1.s1:
38 # Informational fields calculated from the above
39 # All byte equivalent offsets must be aligned
41 # boot space: 1044992 bytes
42 # data space: 312567643 blocks # 305241.84 MB (320069266944 bytes)
44 # NOTE: If the partition data base looks odd it may be
45 # physically aligned instead of slice-aligned
47 diskid: e67030af-d2af-11df-b588-01138fad54f5
49 boot2 data base: 0x000000001000
50 partitions data base: 0x000000100200
51 partitions data stop: 0x004a85ad7000
52 backup label: 0x004a85ad7000
53 total size: 0x004a85ad8200 # 305242.84 MB
55 display block size: 1024 # for partition display only
58 # size offset fstype fsuuid
59 a: 786432 0 4.2BSD # 768.000MB
60 b: 8388608 786432 swap # 8192.000MB
61 d: 303392600 9175040 HAMMER # 296281.836MB
62 a-stor_uuid: eb1c8aac-d2af-11df-b588-01138fad54f5
63 b-stor_uuid: eb1c8aec-d2af-11df-b588-01138fad54f5
64 d-stor_uuid: eb1c8b21-d2af-11df-b588-01138fad54f5
67 The slice 1 has 3 partitions
72 c- is usually for the whole hard disk in BSDs but it is not shown here
74 d - the hammer File system labeled ROOT
76 When you create a hammer file system you should give it a label, here the Installer labeled it as "ROOT" and mounted it as
78 ROOT 288G 12G 276G 4% /
80 Now a PFS is a Pseudo hammer 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
81 because it is mounted as / )
83 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
86 # Device Mountpoint FStype Options Dump Pass#
87 /dev/serno/9VMBWDM1.s1a /boot ufs rw 1 1
88 /dev/serno/9VMBWDM1.s1b none swap sw 0 0
89 /dev/serno/9VMBWDM1.s1d / hammer rw 1 1
90 /pfs/var /var null rw 0 0
91 /pfs/tmp /tmp null rw 0 0
92 /pfs/usr /usr null rw 0 0
93 /pfs/home /home null rw 0 0
94 /pfs/usr.obj /usr/obj null rw 0 0
95 /pfs/var.crash /var/crash null rw 0 0
96 /pfs/var.tmp /var/tmp null rw 0 0
97 proc /proc procfs rw 0 0
100 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§ion=8).
102 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.
104 Now if you look in /var
108 account backups caps cron empty log msgs run spool yp at
109 cache crash db games lib mail preserve rwho tmp
111 you will find the above directories.
113 If you look at the status of one of the PFSes say /usr you will see /var/hammer is the default snapshot directory.
116 # hammer pfs-status /usr/
118 sync-beg-tid=0x0000000000000001
119 sync-end-tid=0x0000000117ac6270
120 shared-uuid=f33e318e-d2af-11df-b588-01138fad54f5
121 unique-uuid=f33e31cb-d2af-11df-b588-01138fad54f5
124 operating as a MASTER
125 snapshots directory defaults to /var/hammer/<pfs>
128 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
131 Snapshots on /usr PFS #3
132 Transaction ID Timestamp Note
135 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.
137 # sudo hammer cleanup
138 cleanup / - HAMMER UPGRADE: Creating snapshots
139 Creating snapshots in /var/hammer/root
140 handle PFS #0 using /var/hammer/root
146 cleanup /var - HAMMER UPGRADE: Creating snapshots
147 Creating snapshots in /var/hammer/var
148 handle PFS #1 using /var/hammer/var
154 cleanup /tmp - HAMMER UPGRADE: Creating snapshots
155 Creating snapshots in /var/hammer/tmp
156 handle PFS #2 using /var/hammer/tmp
162 cleanup /usr - HAMMER UPGRADE: Creating snapshots
163 Creating snapshots in /var/hammer/usr
164 handle PFS #3 using /var/hammer/usr
170 cleanup /home - HAMMER UPGRADE: Creating snapshots
171 Creating snapshots in /var/hammer/home
172 handle PFS #4 using /var/hammer/home
178 cleanup /usr/obj - HAMMER UPGRADE: Creating snapshots
179 Creating snapshots in /var/hammer/usr/obj
180 handle PFS #5 using /var/hammer/usr/obj
186 cleanup /var/crash - HAMMER UPGRADE: Creating snapshots
187 Creating snapshots in /var/hammer/var/crash
188 handle PFS #6 using /var/hammer/var/crash
194 cleanup /var/tmp - HAMMER UPGRADE: Creating snapshots
195 Creating snapshots in /var/hammer/var/tmp
196 handle PFS #7 using /var/hammer/var/tmp
202 cleanup /var/isos - HAMMER UPGRADE: Creating snapshots
203 Creating snapshots in /var/hammer/var/isos
204 handle PFS #8 using /var/hammer/var/isos
212 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.
214 Let us look again in /var now
217 account backups caps cron empty hammer log msgs run spool yp
218 at cache crash db games lib mail preserve rwho tmp
221 We have a new directory called "hammer" with the following sub directories
227 drwxr-xr-x 1 root wheel 0 Oct 13 11:51 home
228 drwxr-xr-x 1 root wheel 0 Oct 13 11:42 root
229 drwxr-xr-x 1 root wheel 0 Oct 13 11:43 tmp
230 drwxr-xr-x 1 root wheel 0 Oct 13 11:51 usr
231 drwxr-xr-x 1 root wheel 0 Oct 13 11:54 var
234 Well let us look inside /var/hammer/usr
240 drwxr-xr-x 1 root wheel 0 Oct 13 11:54 obj
241 lrwxr-xr-x 1 root wheel 25 Oct 13 11:43 snap-20101013-1143 -> /usr/@@0x0000000117ac6cb0
244 We have a symlink pointing to the snapshot Transaction ID shown below.
249 Snapshots on /usr PFS #3
250 Transaction ID Timestamp Note
251 0x0000000117ac6cb0 2010-10-13 11:43:04 IST -
255 You can read more about snapshots, prune, reblance,reblock,recopy etc from [hammer(8)](
256 http://leaf.dragonflybsd.org/cgi/web-man?command=hammer§ion=8) especially look under the heading " cleanup [filesystem ...]"
258 You can learn more about PFS mirroring [here](http://www.dragonflybsd.org/docs/how_to_implement_hammer_pseudo_file_system__40___pfs___41___slave_mirroring_from_pfs_master/)
260 ## Configuring and Starting the SSH Server
262 Described in detail [here](http://www.dragonflybsd.org/docs/docs/newhandbook/sshserver/)
264 ## Software/Programs and Configuration Files Location
266 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>".
268 The base programs are located in the folders
272 /usr/local/bin /usr/local/sbin
274 Their configuration files are found mainly in <b>/etc</b>. there is also <b> /usr/local/etc </b>
276 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>.
278 ## Installing new Software from pkgsrc packages
280 A Detailed description on how to use packages and pkgsrc are given [[here|docs/howtos/HowToPkgsrc]].
282 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.
284 **pkgin** does things similar to **apt-get** or **aptitude** or **yum** for that matter.
286 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.
289 #echo "http://mirror.datacenter.by/pub/DragonFlyBSD/packages/i386/DragonFly-2.7/stable/All/" > /usr/pkg/etc/pkgin/repositories.conf
292 Now to update pkgin with the list of latest packages available from that repository.
296 cleaning database from
297 http://mirror.datacenter.by/pub/DragonFlyBSD/packages/i386/DragonFly-2.7/stable/
299 downloading pkg_summary.bz2: 100%
300 processing remote summary
301 (http://mirror.datacenter.by/pub/DragonFlyBSD/packages/i386/DragonFly-2.7/stable/All)...
302 updating database: 100%
304 Now to upgrade packages that are already installed in the system
308 6 packages to be upgraded: freetype2-2.3.12 gtar-info-1.22
309 openldap-client-2.4.21 png-1.4.2 python26-2.6.5 tiff-3.9.4
310 1 packages to be removed: asciidoc-8.6.1
311 6 packages to be installed: png-1.4.3 python26-2.6.5nb1 tiff-3.9.4nb1
312 freetype2-2.4.2 gtar-info-1.23 openldap-client-2.4.23 (15M to
313 download, 59M to install)
315 downloading packages...
316 downloading png-1.4.3.tgz: 100%
317 downloading python26-2.6.5nb1.tgz: 100%
318 downloading tiff-3.9.4nb1.tgz: 100%
319 downloading freetype2-2.4.2.tgz: 100%
320 downloading gtar-info-1.23.tgz: 100%
321 downloading openldap-client-2.4.23.tgz: 100%
324 In order to search for a new Package for example **rdesktop**.
327 # pkgin search rdesktop
328 rdesktop-1.6.0 = Open-source Remote Desktop Protocol client
329 tsclient-0.132nb25 GNOME2 Frontend for rdesktop
331 =: package is installed and up-to-date
332 <: package is installed but newer version is available
333 >: installed package has a greater version than available package
336 If there are symbols **=** or **<** or **>** after a package name in the output then the last 3 lines of the output will explain them.
338 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.
341 dfly-vmsrv# pkgin search mysql-client
342 mysql-client-4.1.22nb4 MySQL 4, a free SQL database (client)
343 mysql-client-5.0.91 MySQL 5, a free SQL database (client)
344 mysql-client-5.1.49 MySQL 5, a free SQL database (client)
346 =: package is installed and up-to-date
347 <: package is installed but newer version is available
348 >: installed package has a greater version than available package
349 dfly-vmsrv# pkgin install mysql-client
350 there's more than one version available for this package.
351 please re-run pkgin with a package name matching one of the following:
352 mysql-client-4.1.22nb4
356 dfly-vmsrv# pkgin install mysql-client-5.1.49
357 calculating dependencies for mysql-client-5.1.49...
359 1 packages to be installed: mysql-client-5.1.49 (7620K to download, 24M to install)
361 downloading packages...
362 downloading mysql-client-5.1.49.tgz: 100%
363 installing packages...
364 installing mysql-client-5.1.49...
365 ===========================================================================
366 $NetBSD: MESSAGE,v 1.1.1.1 2010/03/04 16:27:18 taca Exp $
368 To use the ``mysqlhotcopy'' script, you'll have to install the following
371 databases/p5-DBD-mysql
374 ===========================================================================
375 processing local summary...
376 updating database: 100%
377 marking mysql-client-5.1.49 as non auto-removable
383 # pkgin remove mysql-client
384 1 packages to delete: mysql-client-5.1.49
386 removing mysql-client-5.1.49...
387 processing local summary...
388 updating database: 100%
391 **pkgin** is very similar to **apt-get, aptitude , yum, emerge, pacman** and friends in the linux world.
393 All the **pkgin** commands can be seen [here](http://imil.net/pkgin/). **pkgin** comes installed with the default DragonFly install so you can skip the installation part on that page
395 To install a desktop you can [read the following](http://www.dragonflybsd.org/docs/newhandbook/X/)
396 Other Docs can be found [here](http://www.dragonflybsd.org/docs/newhandbook/X/). When ever you find **pkg_add** or **pkg_radd** used to install a software just use **pkgin** instead.