1 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.
5 ## Disk, Partition layout, Mount points, PFSes, Snapshots
7 If you followed the default options during installation you will be
8 left with a system with the following disk configuration
12 Filesystem Size Used Avail Capacity Mounted on
13 ROOT 288G 12G 276G 4% /
14 devfs 1.0K 1.0K 0B 100% /dev
15 /dev/serno/9VMBWDM1.s1a 756M 138M 558M 20% /boot
16 /pfs/@@-1:00001 288G 12G 276G 4% /var
17 /pfs/@@-1:00002 288G 12G 276G 4% /tmp
18 /pfs/@@-1:00003 288G 12G 276G 4% /usr
19 /pfs/@@-1:00004 288G 12G 276G 4% /home
20 /pfs/@@-1:00005 288G 12G 276G 4% /usr/obj
21 /pfs/@@-1:00006 288G 12G 276G 4% /var/crash
22 /pfs/@@-1:00007 288G 12G 276G 4% /var/tmp
23 procfs 4.0K 4.0K 0B 100% /proc
27 **/dev/serno/9VMBWDM1** is the hard disk specified with QUID
29 **/dev/serno/9VMBWDM1.s1** is the first slice on the hard disk.
31 Let us see its disklabel
34 # sudo disklabel /dev/serno/9VMBWDM1.s1
35 # /dev/serno/9VMBWDM1.s1:
37 # Informational fields calculated from the above
38 # All byte equivalent offsets must be aligned
40 # boot space: 1044992 bytes
41 # data space: 312567643 blocks # 305241.84 MB (320069266944 bytes)
43 # NOTE: If the partition data base looks odd it may be
44 # physically aligned instead of slice-aligned
46 diskid: e67030af-d2af-11df-b588-01138fad54f5
48 boot2 data base: 0x000000001000
49 partitions data base: 0x000000100200
50 partitions data stop: 0x004a85ad7000
51 backup label: 0x004a85ad7000
52 total size: 0x004a85ad8200 # 305242.84 MB
54 display block size: 1024 # for partition display only
57 # size offset fstype fsuuid
58 a: 786432 0 4.2BSD # 768.000MB
59 b: 8388608 786432 swap # 8192.000MB
60 d: 303392600 9175040 HAMMER # 296281.836MB
61 a-stor_uuid: eb1c8aac-d2af-11df-b588-01138fad54f5
62 b-stor_uuid: eb1c8aec-d2af-11df-b588-01138fad54f5
63 d-stor_uuid: eb1c8b21-d2af-11df-b588-01138fad54f5
66 The slice 1 has 3 partitions
71 c- is usually for the whole hard disk in BSDs but it is not shown here
73 d - the hammer File system labeled ROOT
75 When you create a hammer file system you should give it a label, here the Installer labeled it as "ROOT" and mounted it as
77 ROOT 288G 12G 276G 4% /
79 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
80 because it is mounted as / )
82 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
85 # Device Mountpoint FStype Options Dump Pass#
86 /dev/serno/9VMBWDM1.s1a /boot ufs rw 1 1
87 /dev/serno/9VMBWDM1.s1b none swap sw 0 0
88 /dev/serno/9VMBWDM1.s1d / hammer rw 1 1
89 /pfs/var /var null rw 0 0
90 /pfs/tmp /tmp null rw 0 0
91 /pfs/usr /usr null rw 0 0
92 /pfs/home /home null rw 0 0
93 /pfs/usr.obj /usr/obj null rw 0 0
94 /pfs/var.crash /var/crash null rw 0 0
95 /pfs/var.tmp /var/tmp null rw 0 0
96 proc /proc procfs rw 0 0
99 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).
101 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.
103 Now if you look in /var
107 account backups caps cron empty log msgs run spool yp at
108 cache crash db games lib mail preserve rwho tmp
110 you will find the above directories.
112 If you look at the status of one of the PFSes say /usr you will see /var/hammer is the default snapshot directory.
115 # hammer pfs-status /usr/
117 sync-beg-tid=0x0000000000000001
118 sync-end-tid=0x0000000117ac6270
119 shared-uuid=f33e318e-d2af-11df-b588-01138fad54f5
120 unique-uuid=f33e31cb-d2af-11df-b588-01138fad54f5
123 operating as a MASTER
124 snapshots directory defaults to /var/hammer/<pfs>
127 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
130 Snapshots on /usr PFS #3
131 Transaction ID Timestamp Note
134 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.
136 # sudo hammer cleanup
137 cleanup / - HAMMER UPGRADE: Creating snapshots
138 Creating snapshots in /var/hammer/root
139 handle PFS #0 using /var/hammer/root
145 cleanup /var - HAMMER UPGRADE: Creating snapshots
146 Creating snapshots in /var/hammer/var
147 handle PFS #1 using /var/hammer/var
153 cleanup /tmp - HAMMER UPGRADE: Creating snapshots
154 Creating snapshots in /var/hammer/tmp
155 handle PFS #2 using /var/hammer/tmp
161 cleanup /usr - HAMMER UPGRADE: Creating snapshots
162 Creating snapshots in /var/hammer/usr
163 handle PFS #3 using /var/hammer/usr
169 cleanup /home - HAMMER UPGRADE: Creating snapshots
170 Creating snapshots in /var/hammer/home
171 handle PFS #4 using /var/hammer/home
177 cleanup /usr/obj - HAMMER UPGRADE: Creating snapshots
178 Creating snapshots in /var/hammer/usr/obj
179 handle PFS #5 using /var/hammer/usr/obj
185 cleanup /var/crash - HAMMER UPGRADE: Creating snapshots
186 Creating snapshots in /var/hammer/var/crash
187 handle PFS #6 using /var/hammer/var/crash
193 cleanup /var/tmp - HAMMER UPGRADE: Creating snapshots
194 Creating snapshots in /var/hammer/var/tmp
195 handle PFS #7 using /var/hammer/var/tmp
201 cleanup /var/isos - HAMMER UPGRADE: Creating snapshots
202 Creating snapshots in /var/hammer/var/isos
203 handle PFS #8 using /var/hammer/var/isos
211 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.
213 Let us look again in /var now
216 account backups caps cron empty hammer log msgs run spool yp
217 at cache crash db games lib mail preserve rwho tmp
220 We have a new directory called "hammer" with the following sub directories
226 drwxr-xr-x 1 root wheel 0 Oct 13 11:51 home
227 drwxr-xr-x 1 root wheel 0 Oct 13 11:42 root
228 drwxr-xr-x 1 root wheel 0 Oct 13 11:43 tmp
229 drwxr-xr-x 1 root wheel 0 Oct 13 11:51 usr
230 drwxr-xr-x 1 root wheel 0 Oct 13 11:54 var
233 Well let us look inside /var/hammer/usr
239 drwxr-xr-x 1 root wheel 0 Oct 13 11:54 obj
240 lrwxr-xr-x 1 root wheel 25 Oct 13 11:43 snap-20101013-1143 -> /usr/@@0x0000000117ac6cb0
243 We have a symlink pointing to the snapshot Transaction ID shown below.
248 Snapshots on /usr PFS #3
249 Transaction ID Timestamp Note
250 0x0000000117ac6cb0 2010-10-13 11:43:04 IST -
254 You can read more about snapshots, prune, reblance,reblock,recopy etc from [hammer(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=hammer§ion=8) especially look under the heading " cleanup [filesystem ...]"
256 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/)
258 ## Configuring and Starting the SSH Server
260 Described in detail [here](http://www.dragonflybsd.org/docs/docs/newhandbook/sshserver/)
262 ## Software/Programs and Configuration Files Location
264 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>".
266 The base programs are located in the folders
270 /usr/local/bin /usr/local/sbin
272 Their configuration files are found mainly in <b>/etc</b>. there is also <b> /usr/local/etc </b>
274 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>.
276 ## Installing new Software from pkgsrc packages
278 A Detailed description on how to use packages and pkgsrc are given [[here|docs/howtos/HowToPkgsrc]].
280 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.
282 **pkgin** does things similar to **apt-get** or **aptitude** or **yum** for that matter.
284 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.
287 #echo "http://mirror.datacenter.by/pub/DragonFlyBSD/packages/i386/DragonFly-2.7/stable/All/" > /usr/pkg/etc/pkgin/repositories.conf
290 Now to update pkgin with the list of latest packages available from that repository.
294 cleaning database from
295 http://mirror.datacenter.by/pub/DragonFlyBSD/packages/i386/DragonFly-2.7/stable/
297 downloading pkg_summary.bz2: 100%
298 processing remote summary
299 (http://mirror.datacenter.by/pub/DragonFlyBSD/packages/i386/DragonFly-2.7/stable/All)...
300 updating database: 100%
302 Now to upgrade packages that are already installed in the system
306 6 packages to be upgraded: freetype2-2.3.12 gtar-info-1.22
307 openldap-client-2.4.21 png-1.4.2 python26-2.6.5 tiff-3.9.4
308 1 packages to be removed: asciidoc-8.6.1
309 6 packages to be installed: png-1.4.3 python26-2.6.5nb1 tiff-3.9.4nb1
310 freetype2-2.4.2 gtar-info-1.23 openldap-client-2.4.23 (15M to
311 download, 59M to install)
313 downloading packages...
314 downloading png-1.4.3.tgz: 100%
315 downloading python26-2.6.5nb1.tgz: 100%
316 downloading tiff-3.9.4nb1.tgz: 100%
317 downloading freetype2-2.4.2.tgz: 100%
318 downloading gtar-info-1.23.tgz: 100%
319 downloading openldap-client-2.4.23.tgz: 100%
322 In order to search for a new Package for example **rdesktop**.
325 # pkgin search rdesktop
326 rdesktop-1.6.0 = Open-source Remote Desktop Protocol client
327 tsclient-0.132nb25 GNOME2 Frontend for rdesktop
329 =: package is installed and up-to-date
330 <: package is installed but newer version is available
331 >: installed package has a greater version than available package
334 If there are symbols **=** or **<** or **>** after a package name in the output then the last 3 lines of the output will explain them.
336 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.
339 dfly-vmsrv# pkgin search mysql-client
340 mysql-client-4.1.22nb4 MySQL 4, a free SQL database (client)
341 mysql-client-5.0.91 MySQL 5, a free SQL database (client)
342 mysql-client-5.1.49 MySQL 5, a free SQL database (client)
344 =: package is installed and up-to-date
345 <: package is installed but newer version is available
346 >: installed package has a greater version than available package
347 dfly-vmsrv# pkgin install mysql-client
348 there's more than one version available for this package.
349 please re-run pkgin with a package name matching one of the following:
350 mysql-client-4.1.22nb4
354 dfly-vmsrv# pkgin install mysql-client-5.1.49
355 calculating dependencies for mysql-client-5.1.49...
357 1 packages to be installed: mysql-client-5.1.49 (7620K to download, 24M to install)
359 downloading packages...
360 downloading mysql-client-5.1.49.tgz: 100%
361 installing packages...
362 installing mysql-client-5.1.49...
363 ===========================================================================
364 $NetBSD: MESSAGE,v 1.1.1.1 2010/03/04 16:27:18 taca Exp $
366 To use the ``mysqlhotcopy'' script, you'll have to install the following
369 databases/p5-DBD-mysql
372 ===========================================================================
373 processing local summary...
374 updating database: 100%
375 marking mysql-client-5.1.49 as non auto-removable
381 # pkgin remove mysql-client
382 1 packages to delete: mysql-client-5.1.49
384 removing mysql-client-5.1.49...
385 processing local summary...
386 updating database: 100%
389 **pkgin** is very similar to **apt-get, aptitude , yum, emerge, pacman** and friends in the linux world.
391 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
393 To install a desktop you can [read the following](http://www.dragonflybsd.org/docs/newhandbook/X/)
394 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.