1 # DragonFly BSD Quick Start
2 This document describes the DragonFly environment one will find on a newly installed system.
7 If you chose to install on the HAMMER file system during installation you will be left with a system with the following disk configuration:
10 Filesystem Size Used Avail Capacity Mounted on
11 ROOT 288G 12G 276G 4% /
12 devfs 1.0K 1.0K 0B 100% /dev
13 /dev/serno/9VMBWDM1.s1a 756M 138M 558M 20% /boot
14 /pfs/@@-1:00001 288G 12G 276G 4% /var
15 /pfs/@@-1:00002 288G 12G 276G 4% /tmp
16 /pfs/@@-1:00003 288G 12G 276G 4% /usr
17 /pfs/@@-1:00004 288G 12G 276G 4% /home
18 /pfs/@@-1:00005 288G 12G 276G 4% /usr/obj
19 /pfs/@@-1:00006 288G 12G 276G 4% /var/crash
20 /pfs/@@-1:00007 288G 12G 276G 4% /var/tmp
21 procfs 4.0K 4.0K 0B 100% /proc
25 * `/dev/serno/9VMBWDM1` is the hard disk specified with serial number,
26 * `/dev/serno/9VMBWDM1.s1` is the first slice on the hard disk.
28 The disklabel looks at follows
30 # disklabel /dev/serno/9VMBWDM1.s1
32 # /dev/serno/9VMBWDM1.s1:
34 # Informational fields calculated from the above
35 # All byte equivalent offsets must be aligned
37 # boot space: 1044992 bytes
38 # data space: 312567643 blocks # 305241.84 MB (320069266944 bytes)
40 # NOTE: If the partition data base looks odd it may be
41 # physically aligned instead of slice-aligned
43 diskid: e67030af-d2af-11df-b588-01138fad54f5
45 boot2 data base: 0x000000001000
46 partitions data base: 0x000000100200
47 partitions data stop: 0x004a85ad7000
48 backup label: 0x004a85ad7000
49 total size: 0x004a85ad8200 # 305242.84 MB
51 display block size: 1024 # for partition display only
54 # size offset fstype fsuuid
55 a: 786432 0 4.2BSD # 768.000MB
56 b: 8388608 786432 swap # 8192.000MB
57 d: 303392600 9175040 HAMMER # 296281.836MB
58 a-stor_uuid: eb1c8aac-d2af-11df-b588-01138fad54f5
59 b-stor_uuid: eb1c8aec-d2af-11df-b588-01138fad54f5
60 d-stor_uuid: eb1c8b21-d2af-11df-b588-01138fad54f5
63 The slice has 3 partitions:
67 * `d` - for `/`, a HAMMER file system labeled ROOT
69 When you create a HAMMER file system you must give it a label, here the installer labeled it as "ROOT" and mounted it as
71 ROOT 288G 12G 276G 4% /
73 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 `/`.
75 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 `/etc/fstab`:
79 # Device Mountpoint FStype Options Dump Pass#
80 /dev/serno/9VMBWDM1.s1a /boot ufs rw 1 1
81 /dev/serno/9VMBWDM1.s1b none swap sw 0 0
82 /dev/serno/9VMBWDM1.s1d / hammer rw 1 1
83 /pfs/var /var null rw 0 0
84 /pfs/tmp /tmp null rw 0 0
85 /pfs/usr /usr null rw 0 0
86 /pfs/home /home null rw 0 0
87 /pfs/usr.obj /usr/obj null rw 0 0
88 /pfs/var.crash /var/crash null rw 0 0
89 /pfs/var.tmp /var/tmp null rw 0 0
90 proc /proc procfs rw 0 0
93 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).
95 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 to all the PFSs. 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.
97 Now if you look in `/var`
101 account backups caps cron empty log msgs run spool yp at
102 cache crash db games lib mail preserve rwho tmp
104 you will find the above directories.
106 If you look at the status of one of the PFSes, e.g. `/usr` you will see `/var/hammer` is the default snapshot directory.
108 # hammer pfs-status /usr/
110 sync-beg-tid=0x0000000000000001
111 sync-end-tid=0x0000000117ac6270
112 shared-uuid=f33e318e-d2af-11df-b588-01138fad54f5
113 unique-uuid=f33e31cb-d2af-11df-b588-01138fad54f5
116 operating as a MASTER
117 snapshots directory defaults to /var/hammer/<pfs>
120 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`
123 Snapshots on /usr PFS #3
124 Transaction ID Timestamp Note
126 Snapshots will appear automatically each night as the system performs housekeeping on the Hammer filesystem. For a new volume, an immediate snapshot can be taken by running the command 'hammer cleanup'. Among other activites, it will take a snapshot of the filesystem.
128 # sudo hammer cleanup
129 cleanup / - HAMMER UPGRADE: Creating snapshots
130 Creating snapshots in /var/hammer/root
131 handle PFS #0 using /var/hammer/root
137 cleanup /var - HAMMER UPGRADE: Creating snapshots
139 cleanup /tmp - HAMMER UPGRADE: Creating snapshots
141 cleanup /usr - HAMMER UPGRADE: Creating snapshots
143 cleanup /home - HAMMER UPGRADE: Creating snapshots
145 cleanup /usr/obj - HAMMER UPGRADE: Creating snapshots
147 cleanup /var/crash - HAMMER UPGRADE: Creating snapshots
149 cleanup /var/tmp - HAMMER UPGRADE: Creating snapshots
151 cleanup /var/isos - HAMMER UPGRADE: Creating snapshots
154 No snapshots were taken for `/tmp`, `/usr/obj` and `/var/tmp`. This is because the PFSes are flagged as `nohistory`. HAMMER tracks history for all files in a PFS, naturally this consumes disk space until the history is pruned. To prevent that temporary files on the mentioned PFSes (e.g., object files, crash dumps) consume disk space, the PFSes are marked as `nohistory`.
156 In `/var` will be a new directory called *hammer* with the following sub directories
162 drwxr-xr-x 1 root wheel 0 Oct 13 11:51 home
163 drwxr-xr-x 1 root wheel 0 Oct 13 11:42 root
164 drwxr-xr-x 1 root wheel 0 Oct 13 11:43 tmp
165 drwxr-xr-x 1 root wheel 0 Oct 13 11:51 usr
166 drwxr-xr-x 1 root wheel 0 Oct 13 11:54 var
169 Well let us look inside `/var/hammer/usr`
175 drwxr-xr-x 1 root wheel 0 Oct 13 11:54 obj
176 lrwxr-xr-x 1 root wheel 25 Oct 13 11:43 snap-20101013-1143 -> /usr/@@0x0000000117ac6cb0
179 We have a symlink pointing to the snapshot transaction ID shown below.
183 Snapshots on /usr PFS #3
184 Transaction ID Timestamp Note
185 0x0000000117ac6cb0 2010-10-13 11:43:04 IST -
189 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 ...]"
191 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/)
193 In order to correctly map hard disk sernos to device names you can use the 'devattr' command.
196 # devattr -d "ad*" -p serno
214 Or if your disks are 'da', just change it as appropiate.
216 ## Configuring and Starting the SSH Server
218 Described in detail [[here|/docs/newhandbook/sshserver/]]
220 ## Software/Programs and Configuration Files Location
222 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 *packages*.
224 The base programs are located in the folders
229 The configuration files for the base system can be found in `/etc`. There is also `/usr/local/etc` which is used by third-party programs. The software/programs from pkgsrc are located in `/usr/pkg/bin` and `/usr/pkg/sbin`. Their configuration files are found in `/usr/pkg/etc`.
231 ## Installing Third-party Software
233 Have a look at the [[dports howto|/docs/howtos/HowToDPorts/]] for an in-depth description about dealing with packaging systems. Note that DragonFly BSD has several older package managers (like `pkgin`), but that the most modern binary package installation system as of 2014, is `pkg`.
237 Read [[dports howto|/docs/howtos/HowToDPorts/]] then read [[this|http://lists.dragonflybsd.org/pipermail/users/2013-November/090339.html]]
239 You can look at the help and the man page for the pkg tool like this:
245 ### Installing an X desktop environment
247 To install a desktop you can [read the following](http://www.dragonflybsd.org/docs/newhandbook/X/)
248 Other Docs can be found [here](http://www.dragonflybsd.org/docs/newhandbook/X/).