3e6c4ea3fca2bd6d7459aba2a5105b159e142b3d
[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
64 ## Booting LiveCD
65
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.
68
69 ## Backup data accesibility
70
71 Prepare the share where you have the backup data:
72     # mkdir /root/pfs
73     # mount 192.168.3.1:/home/data/pfs /root/pfs
74     # df -h /root/pfs
75     Filesystem                   Size   Used  Avail Capacity  Mounted on
76     192.168.3.1:/home/data/pfs   364G   247G    98G    72%    /root/pfs
77
78 ## Partition the disk
79 This part is critical. With this you will lose all the data on the disk you have chosen.
80
81 **Warning: You are discouraged to use fdisk. Use another partition utility while you can **
82 Initalize the disk and partition it. After that, you will have to manually 
83 # fdisk -BI ad4
84 # fdisk -i
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 # Restoring the data
100 # Fixing the configuration
101 # Booting
102
103
104