~ubuntu-core-dev/debian-installer/ubuntu

664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
1
partman-auto recipe files
2
3
Contents:
4
  0. Introduction
5
  1. Format of the recipes
6
  2. Examples
7
  3. Architecture specific recipes
8
  4. Limitations
664.2.823 by zinoviev
Describe how partman-auto computes the partition sizes.
9
  5. How the actual partition sizes are computed
10
  6. Appendix
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
11
12
0. INTRODUCTION
13
---------------
14
15
partman-auto is the part of the partitioner that automatically partitions
16
disks. It is controlled by recipes, which are provided in partman-auto as
17
files, but may also be provided by other udebs, or by preseeding. This
18
document explains the format of the recipes and how to use them.
19
20
21
1. FORMAT OF THE RECIPES
22
------------------------
23
24
All new lines and tabs in the recipe are converted to spaces.
25
Then two or more consecutive spaces are converted to one space.
26
Almost all tokens must be separated by spaces.  An important exception
27
is the opening curly bracket ("{"); before it there must be _no_
28
space.
29
30
In the following rules we denote spaces by "_".
31
32
<recipe>::=<header>_<partitions>
33
34
<header>::=<simple name>|<debconf name>
35
36
<simple name>::=<name>_:
37
38
<name> can be for example "Multi user system".
39
40
<debconf name>::=<debconf template>_::
41
42
The purpose of <debconf name> is to allow translation of the names of
43
the recipes into different languages.
44
45
<partitions>::=<partition>|<partition>_<partitions>
46
47
<partition>::=<limits>_<specifiers>_.
48
49
<limits>::=<minimal size>_<priority>_<maximal size>_<parted fs>
50
51
<minimal size> is the minimal allowed size of the partition in
52
megabytes.  It is rounded to cylinder size, so if you make <minimal
53
size> to be 20 MB and the cylinder size is 12MB, then it is possible
54
for the partition to be only 12MB.  These sizes may also be given as
55
a percentage, which makes the size be that percentage of the system's
56
total RAM.
57
58
<maximal size> is the maximal size for the partition, i.e. a limit
59
size such that there is no sense to make this partition larger.
60
61
<priority> is some size usually between <minimal size> and <maximal
62
size>.  It determines the priority of this partition in the contest
63
with the other partitions for size.  Notice that if <priority> is too
64
small (relative to the priority of the other partitions) then this
65
partition will have size close to <minimal size>.  That's why it is
66
recommended to give small partitions a <priority> larger than their
67
<maximal size>.
68
69
<parted fs> is the file system as known to parted of this partition.
70
71
72
<specifiers>::=<specifier>|<specifier>_<specifiers>
73
664.3.508 by fjp
Define LVM related specifiers in the correct place
74
<specifier>::=<internal specifier>|<regular specifier>|<type specifier>
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
75
76
<internal specifier>::=$primary{_}|$bootable{_}
77
78
$primary{_} says that the partition should be primary (if possible).
79
$bootable{_} says that the bootable flag will be set.
80
81
<regular specifier>::=<file name>{ <file contents> }
82
83
<file name> is a file to be created in the directory of the partition
84
in partman's filesystem info. (See section 2.4 of the partman manual
85
for details.)
86
<file contents> is the information to write in this file.
87
664.3.508 by fjp
Define LVM related specifiers in the correct place
88
<type specifier>::=$lvmok{_}|$defaultignore{_}|$lvmignore{_}
89
90
$lvmok{_}
91
	Indicates that the partition is permitted to be an LVM logical 
92
	volume should an LVM partitioning scheme be in use.
93
$defaultignore{_}
94
	Used to void a partition definition so that it is ignored in the
95
	default case. That is to say it will be valid in the LVM case.
96
$lvmignore{_}
97
	Used to void a partition definition so that it is ignored in the
98
	LVM case. That is to say it will be valid in the default case.
99
100
The specifiers defaultignore and lvmignore allow one recipe to define different 
101
handling of say the /boot partition between an LVM partitioning scheme and a 
102
non-LVM scheme.
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
103
104
2. EXAMPLES
105
-----------
106
107
Here is a very simple recipe that creates a swap partition and uses the
108
rest of the disk for one large root filesystem.
109
110
partman-auto/text/atomic_scheme ::
111
112
500 10000 1000000 ext3
113
	$primary{ }
114
	$bootable{ }
115
	method{ format }
116
	format{ }
117
	use_filesystem{ }
118
	filesystem{ ext3 }
119
	mountpoint{ / } .
120
121
64 512 300% linux-swap
122
	method{ swap }
123
	format{ } .
124
125
Here the root partition must be at least 500 mb, and has effectively no
126
maximum size. The swap partition ranges from 64 mb to 3 times the system's
127
ram.
128
129
Note the use of $bootable{ } to make the partition bootable, and $primary{ }
130
to mark it as the primary partition.
131
132
The specifiers used in this example are:
133
method{ format }
664.2.2015 by zinoviev
devel/partman-auto-recipe.txt: Clarify the "keep" method, thanks to Free Ekanayaka.
134
	Used to make the partition be formatted. For swap partitions,
135
	change it to "swap". To create a new partition but do not
136
	format it, change "format" to "keep" (such a partition can be
137
	used to reserve for future use some disk space).
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
138
format{ }
139
	Also needed to make the partition be formatted.
140
use_filesystem{ }
141
	Specifies that the partition has a filesystem on it.
142
filesystem{ ext3 }
143
	Specifies the filesystem to put on the partition.
664.3.237 by cjwatson
various typos
144
mountpoint{ / }
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
145
	Where to mount the partition.
146
664.3.509 by fjp
Give an example of how to specify mount options. Tested with the Lenny Beta2 version of the installer.
147
It is also possible to specify mount options. For example, to specify
148
"nodev,ro" for a partition, add the following lines for that partition:
149
	options/nodev{ nodev }
150
	options/ro{ ro }
151
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
152
Here is another example; this time there is a smaller root partition, and a
153
separate /home partition.
154
155
partman-auto/text/home_scheme ::
156
157
300 4000 7000 ext3
158
        $primary{ }
159
        $bootable{ }
160
        method{ format }
161
        format{ }
162
        use_filesystem{ }
163
        filesystem{ ext3 }
164
        mountpoint{ / } .
165
166
64 512 300% linux-swap
167
        method{ swap }
168
        format{ } .
169
170
100 10000 1000000000 ext3
171
        method{ format }
172
        format{ }
173
        use_filesystem{ }
174
        filesystem{ ext3 }
175
        mountpoint{ /home } .
176
177
Notice that the partitions will be created in the order they are defined
178
in the recipe.
179
664.3.237 by cjwatson
various typos
180
3. ARCHITECTURE DEPENDENT RECIPES
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
181
---------------------------------
182
183
Some architectures have specific requirements for their partitions.
184
For example many of them require special partitions to support
185
bootloading.
186
187
For example, newworld powerpc machines need a newworld boot partition at
664.1.1659 by joeyh
merge non-manual, non i18n documentation changes from trunk to sarge branch
188
the start of the disk. Here is an example fragment of a recipe file to
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
189
create one; it should come before other partitions in a recipe. Notice that
190
the partition is not formatted.
191
192
1 1 1 hfs
193
	$bootable{ }
194
	method{ newworld } .
195
196
Another example is a netwinder, which requires a small /boot partition
197
formated in revision 0 ext2.
198
199
50 500 100 ext2
200
	$primary{ }
201
	$bootable{ }
202
	method{ format }
203
	format{ }
204
	use_filesystem{ }
205
	filesystem{ ext2r0 }
206
	mountpoint{ /boot } .
207
208
And finally, an example of how to set up the efi boot partition needed on
209
ia64.
210
211
100 100 150 fat16
212
        $primary{ }
213
        method{ efi }
214
        format{ } .
215
216
For other examples, see the architecture-specific recipes in partman-auto.
217
218
219
4. LIMITATIONS
220
--------------
221
222
Due to limitation of the algorithms in partman-auto, there must be at
223
least one partition with high maximal size so that the whole free
664.2.2015 by zinoviev
devel/partman-auto-recipe.txt: Clarify the "keep" method, thanks to Free Ekanayaka.
224
space can be used.  Usually you can give the partition containing
225
/home a maximal size 1000000000 which is high enough for the present
226
storage devices. If the large /home is not an option for you, you can
227
also define in the recipe one additional partition with size
228
1000000000, method "keep" and leave it unmounted.  When the
229
installation completes you can remove it.
230
231
Do not use higher than 1000000000 numbers because the shell arithmetic
232
is limited to 31 bits (on i386).
233
234
235
5. HOW THE ACTUAL PARTITION SIZES ARE COMPUTED
664.2.823 by zinoviev
Describe how partman-auto computes the partition sizes.
236
----------------------------------------------
237
238
Suppose we have to create N partitions and min[i], max[i] and
239
priority[i] are the minimal size, the maximal size and the priority of
240
the partition #i as described in section 1.
241
242
Let free_space be the size of the free space to partition.
243
244
Then do the following:
245
246
for(i=1;i<=N;i++) {
247
   factor[i] = priority[i] - min[i];
248
}
249
ready = FALSE;
250
while (! ready) {
251
   minsum = min[1] + min[2] + ... + min[N];
252
   factsum = factor[1] + factor[2] + ... + factor[N];
253
   ready = TRUE;
254
   for(i=1;i<=N;i++) {
255
      x = min[i] + (free_space - minsum) * factor[i] / factsum;
256
      if (x > max[i])
257
         x = max[i];
258
      if (x != min[i]) {
259
         ready = FALSE;
260
         min[i] = x;
261
      }
262
   }
263
}
264
265
Then min[i] will be the size of partition #i.
266
267
268
6. APPENDIX
664.1.743 by joeyh
- Move some files to a doc/devel subdirectory.
269
-----------
270
271
On May 25th 2004, it was noted that on i386 systems, the very minimum size of
272
a Debian installation on a classical (/, /usr, /usr, /home) setup was:
273
48MB on / (6MB on /boot)
274
77MB on /usr
275
17MB on /var
276
It is thus wise to use minimum values with this consideration in mind.
277
278
#261244: 70MB are required for /var
279
#265290: 1.8GB are not enough for / with desktop