root/trunk/freewrt/tools/afdisk/README

Revision 1146, 4.7 kB (checked in by n0-1, 6 years ago)

Initially imported afdisk (neither the Linux, nor the FreeBSD one).
Designed for automated hard disk partitioning it should fit perfect
for FreeWRT to provide a portable and flexible tool for paritioning
CompactFlash? disks as target devices inside a script.
Still needs some rework, anyway thanks alot to David Roetzel (the
author of afdisk).

Line 
1 afdisk - Automatic fdisk
2 ========================
3
4 This is the Readme file for afdisk, the automatic fdisk program.
5
6 Table of contents
7 1.What is afdisk
8 2.Usage
9 3.Configuration file
10 4.Examples
11
12 1. What is afdisk ?
13 -------------------
14
15 afdisk is a tool to create MSDOS-Partitions (and FreeBSD disklabels)
16 on a x86 machine without user interaction. Directives given in a
17 configuratiion file (see 3.) affect how afdisk tries to accomplish
18 its task.
19
20 afdisk tries to autodetect harddrives and to a certain degree it tries
21 to layout the partitions it wants to create on the found harddrives.
22
23 afdisk can either create a new partition table, possibly erasing all
24 existing data, or leave existing partitions alone.
25
26 afdisk is meant to be included in a larger system that is able to
27 install either Linux or FreeBSD automatically from a CD-ROM without any
28 user interaction.
29
30 2. Usage
31 --------
32
33 This is pretty straightforward. If you know what you are doing, simply
34 run afdisk as root (possibly from a boot-floppy).
35
36 If you don't provide any Configuration it will try to create a Linux
37 a Linux swap partition. See 3. for information about how to provide a
38 configuration.
39
40 Please bear in mind that afdisk will certainly destroy data on your
41 machine. Use at your own risk.
42
43 3. Configuration file
44 ---------------------
45
46 afdisk looks for a file named afdisk.conf in the current working
47 directory.
48
49 With directives given in this file one can tell afdisk what partitions
50 it should try to create and how to do it.
51
52 The file should consist of one [global] section and one [partition]
53 section for each partition that one wants to be created.
54
55 Within these section there are several possible attributes that one
56 can assign a value to simply writing
57         <attribute> = <value>
58 using exactly one line. Most attributes can be omitted but some simply
59 shouldn't be left out (like the overwrite attribute that controls
60 whether existing partitions are overwritten).
61
62 afdisk is not picky about the syntax of the configuration file. In fact
63 it tolerates a lot of mistakes. But you should check your configuration
64 very carefully because even a small mistake could lead to undocumented
65 behaviour.
66
67 The possible attributes are :
68
69 [global] - section
70
71         target_os       Possible Values are linux and freebsd
72                         This affects some default values for
73                         partitions.
74                         If freebsd is given, afdisk will produce
75                         'slices' and an output for the FreeBSD
76                         disklabel program.
77        
78         min             One can specify a minimum size of free
79                         space that is necessary for the partitions
80                         that are to be created. afdisks checks for
81                         the availability of this space first, so
82                         one may save a little time by assigning a
83                         value to this attribute.
84        
85         overwrite       Possible values are yes and no.
86                         Yes means, that any existing partitions may
87                         be overwritten. If no is given here existing
88                         partitions will not be touched by afdisk.
89                         While this attribute is not mandatory, one
90                         should always supply a value.
91
92 [partition] - section
93
94         name            afdisk does not evaluate this attribute but
95                         uses it for its output. While not necessary
96                         it is highly recommended to provide a name
97                         (e.g. swap, root, tmp) so one can find out
98                         where afdisk created the partition.
99
100         type            For MSDOS-partitions this is an 8-bit
101                         hexadecimal value (e.g. 82 for a Linux
102                         partition).
103                         If the target_os is freebsd the value is
104                         expected to be either 4.2BSD or swap.
105        
106         device          afdisk tries to autodetect available hard
107                         disk. But if one knows hardware details of
108                         the target system, one can specify on which
109                         hard disk the partition should be on.
110        
111         min_size        This attribute is used to specify the minimum
112                         size that the partition needs to have.
113                         This should always be specified if no exact_size
114                         is given.
115        
116         exact_size      If one wants the partition to have an
117                         (approximately) exact size this attribute needs
118                         to be specified. It makes no sense to use
119                         the min_size and max_size attributes together
120                         with exact size.
121
122         max_size        This can be used to specifiy the maximum size
123                         of a partition. This is useful e.g. for swap
124                         partitions. If no value is given for max_size
125                         afdisk tries to make the partition as large as
126                         possible.
127
128 4. Examples
129 -----------
130
131 The following example would tell afdisk to try to create a Linux and a
132 Linux swap partition while leaving existing partitions alone.
133 The partition with the label "root" is meant to become the root
134 filesystem and can grow indefinately. On the other hand it needs to have
135 at least 800MB for the linux distribution.
136 The swap partition should at least have 64MB, but on most machines there
137 is no need for it to have more than 256 MB.
138
139 [global]
140         target_os = linux
141         overwrite = no
142
143 [partition]
144         name = root
145         type = 83
146         min_size = 800MB
147
148 [partition]
149         name = swap
150         type = 82
151         min_size = 64MB
152         max_size = 256MB
153
Note: See TracBrowser for help on using the browser.