3 I have got a 250GB SATA harddisk with DragonFlyBSD 2.3.2 32-bit installed on it.
5 Actually I want to repartition my harddisk in order to install other OSes besides DragonFly, so for that I need to shrink the current installation size. Above all, I would like my system just like it is now.
7 Although several methods could be used, as this is a HAMMER installation, I'm going to use HAMMERS's mirror-{read,write} capabilities.
8 This assumes you cannot store the PFSs in another HAMMER disk so that you have to store physical data compressed in files that can be put in any share you have.
9 Here I will be using a NFS share.
13 You should check that your HAMMER version is at least 2 (NORM 2.3 - New directory entry layout).
15 smash64# hammer version /
16 min=1 wip=3 max=2 current=2 description="2.3 - New directory entry layout"
18 1 NORM 2.0 - First HAMMER release
19 2 NORM 2.3 - New directory entry layout
21 If not, you would have to use hammer version-upgrade. See [hammer(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=hammer§ion=8) for details.
24 You will need a DragonFlyBSD LiveCD in order to perform steps for the new installation. Release 2.4.0 or later is recommended.
25 Download the ISOs from [here](http://www.dragonflybsd.org/mirrors/).
29 At this point you should have a place ready to store all the compressed files you are going to generate.
32 smash64# df -h /mnt/pfs
33 Filesystem Size Used Avail Capacity Mounted on
34 dualsmash:/home/data/pfs 364G 235G 111G 68% /mnt/pfs
37 So we can start saving all our data:
41 smash64# hammer mirror-read / | gzip -3 -c > root.gz
42 histogram range 0000000000000000 - 000000129a02c4b0
43 Mirror-read: Mirror from 0000000000000000 to 000000129a02c4b0
46 smash64# hammer mirror-read /var | gzip -3 -c > var.gz
47 histogram range 0000000000000001 - 000000129a02c4f0
48 Mirror-read: Mirror from 0000000000000001 to 000000129a02c4f0
49 Mirror-read /var succeeded
52 smash64# hammer mirror-read /tmp | gzip -3 -c > tmp.gz
53 histogram range 0000000000000001 - 000000129a02c790
54 Mirror-read: Mirror from 0000000000000001 to 000000129a02c790
55 Mirror-read /tmp succeeded
60 Make sure the shared storage you have used is available for the LiveCD.
62 # New installation process
66 Boot the LiveCD in the machine you want to install.
67 You can run installer in order to do some basic configurations for the LiveCD environment, under option "LiveCD utilities", and then exit again to the shell.
69 ## Backup data accesibility
71 Prepare the share where you have the backup data:
73 # mount 192.168.3.1:/home/data/pfs /root/pfs
75 Filesystem Size Used Avail Capacity Mounted on
76 192.168.3.1:/home/data/pfs 364G 247G 98G 72% /root/pfs
78 ## Creating disk layout
79 This part is critical. With this you will lose all the data on the disk you have chosen.
81 **Warning: You are discouraged to use fdisk. Use another partition utility while you can **
83 Initalize the disk and partition it. After that, you will have to manually partition your disk, and with fdisk can be no fun.
88 ( this is only an extract )
92 Do you want to change our idea of what BIOS thinks ? [n]
93 Media sector size is 512
94 Warning: BIOS sector numbering starts with sector 1
95 Information from DOS bootblock is:
96 The data for partition 1 is:
97 sysid 165,(DragonFly/FreeBSD/NetBSD/386BSD)
98 start 63, size 148990401 (72749 Meg), flag 0
99 beg: cyl 0/ head 1/ sector 1;
100 end: cyl 1023/ head 255/ sector 63
101 Do you want to change it? [n] y
102 Supply a decimal value for "sysid (165=DragonFly)" [0] 165
103 Supply a decimal value for "start" [0] 63
104 Supply a decimal value for "size" [0] 148990401
105 Explicitly specify beg/end address ? [n]
106 Warning: ending cylinder wraps, using all 1's
107 sysid 165,(DragonFly/FreeBSD/NetBSD/386BSD)
108 start 63, size 148990401 (72749 Meg), flag 0
109 beg: cyl 0/ head 1/ sector 1;
110 end: cyl 1023/ head 255/ sector 63
111 Are we happy with this entry? [n] y
112 Do you want to change the active partition? [n] y
113 Supply a decimal value for "active partition" [1] 1
114 Are you happy with this choice [n] y
118 Information from DOS bootblock is:
119 1: sysid 165,(DragonFly/FreeBSD/NetBSD/386BSD)
120 start 63, size 148990401 (72749 Meg), flag 80 (active)
121 beg: cyl 0/ head 1/ sector 1;
122 end: cyl 1023/ head 255/ sector 63
126 Should we write new partition table? [n] y
128 Now that we have the partition, we can create the slices for our new installation.
130 As of now, the recommended configuration is ***/boot*** on UFS and ***/*** can be HAMMER.
133 # disklabel64 -r -w ad4s1 auto
134 # disklabel64 -e ad4s1
136 (do the layout you want)
139 # size offset fstype fsuuid
140 a: 262144 0 4.2BSD # 256.000MB
141 b: 1048576 262144 swap # 1024.000MB
142 d: 73184440 1310720 HAMMER # 71469.180MB
144 Finally, we create the filesystems:
147 /dev/ad4s1a: media size 256.00MB
148 Warning: Block size restricts cylinders per group to 94.
149 /dev/ad4s1a: 524288 sectors in 128 cylinders of 1 tracks, 4096 sectors
150 256.0MB in 2 cyl groups (94 c/g, 188.00MB/g, 16256 i/g)
151 super-block backups (for fsck -b #) at:
154 # newfs_hammer -L ROOT /dev/ad4s1d
155 Volume 0 DEVICE /dev/ad4s1d size 69.79GB
156 initialize freemap volume 0
157 ---------------------------------------------
158 1 volume total size 69.79GB version 2
159 boot-area-size: 64.00MB
160 memory-log-size: 256.00MB
161 undo-buffer-size: 104.00MB
162 total-pre-allocated: 120.00MB
163 fsid: 738615f8-a702-11de-8ec9-011617eff231
167 ## Prepare mount points
172 # Fixing the configuration