c0d9fa39597de75ba955ba66f0477ddc622d5ab4
[ikiwiki.git] / docs / howtos / howto_reinstall_hammer / index.mdwn
1 [[!toc]]
2 # Scenario
3 I have got a 250GB SATA harddisk with DragonFlyBSD 2.3.2 32-bit installed on it. 
4
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.
6
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.
10
11 # Pre-steps
12 ## HAMMER version
13 You should check that your HAMMER version is at least 2 (NORM    2.3 - New directory entry layout).
14
15     smash64# hammer version /
16     min=1 wip=3 max=2 current=2 description="2.3 - New directory entry layout"
17     available versions:
18         1   NORM    2.0 - First HAMMER release
19         2   NORM    2.3 - New directory entry layout
20
21 If not, you would have to use hammer version-upgrade. See [hammer(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=hammer&section=8) for details.
22
23 ## LiveCD
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/).
26
27
28 # Data backup
29 At this point you should have a place ready to store all the compressed files you are going to generate.
30 In our case:
31
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
35     smash64#
36
37 So we can start saving all our data:
38     
39     smash64# cd /mnt/pfs
40
41     smash64# hammer mirror-read / | gzip -3 -c > root.gz
42     histogram range 0000000000000000 - 000000129a02c4b0
43     Mirror-read: Mirror from 0000000000000000 to 000000129a02c4b0
44     smash64#
45
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
50     smash64#
51
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
56     smash64#
57     
58     ....
59
60 Make sure the shared storage you have used is available for the LiveCD.
61
62 # New installation process
63 ## Booting LiveCD
64 Boot the LiveCD in the machine you want to install. 
65 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.
66
67 ## Backup data accesibility
68 Prepare the share where you have the backup data:
69 # mkdir /root/pfs
70 # mount 192.168.3.1:/home/data/pfs /root/pfs
71 # df -h /root/pfs
72 Filesystem                   Size   Used  Avail Capacity  Mounted on
73 192.168.3.1:/home/data/pfs   364G   247G    98G    72%    /root/pfs
74
75 ## Partition the disk
76 This part is critical. With this you will lose all the data on the disk you have chosen.
77
78 Initalize the disk and partition it:
79 # fdisk -BI ad4
80
81
82
83
84
85
86
87
88
89
90
91
92 # Restoring the data
93 # Fixing the configuration
94 # Booting
95
96
97