summaryrefslogtreecommitdiff
path: root/package/aboot/src/doc/man/sdisklabel.sgml
blob: 959219ff2091b0dcd3cd42343b389fbde4b4294d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!DOCTYPE RefEntry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<refentry id="sdisklabel">

<refmeta>
<refentrytitle>sdisklabel</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>sdisklabel</refmiscinfo>
</refmeta>

<refnamediv>
<refname>sdisklabel</refname>
<refpurpose>
Create/modify disklabels on Linux/Alpha systems
</refpurpose>
</refnamediv>

<!-- This is the proper SGML way, but somehow doesn't work here -->
<refsynopsisdiv>
 <cmdsynopsis>
   <command>sdisklabel</command>
     <arg choice="plain">device</arg>
     <group choice="opt"><arg choice="plain">print</arg>
       <arg choice="plain">zero</arg>
       <arg choice="plain">sum</arg>
     </group>
 </cmdsynopsis>
 <cmdsynopsis>
   <command>sdisklabel</command>
     <arg choice="plain">device</arg>
     <arg choice="plain">size</arg>
     <arg choice="plain">partsize</arg>
 </cmdsynopsis>
 <cmdsynopsis>
   <command>sdisklabel</command>
     <arg choice="plain">device</arg>
     <arg choice="plain">partnum</arg>
     <arg choice="plain">offset</arg>
     <arg choice="plain">size</arg>
     <arg choice="plain">parttype</arg>
 </cmdsynopsis>
</refsynopsisdiv>
<!-- <refsect1><title>SYNOPSIS</title>
<para>sdisklabel <parameter>drive [print|zero|sum]</parameter></para>
<para>sdisklabel <parameter>drive size partsize</parameter></para>
<para>sdisklabel <parameter>drive partnum offset size parttype</parameter></para>
</refsect1> -->

<refsect1><title>COPYRIGHT</title>
<para>
<application>sdisklabel</application> is Copyright (C) by Red Hat Inc. The
author of this man page tried to track down the original author, but was
unable to do so. A final Bugzilla entry with RedHat yielded the following
reply:
<quote>
I can't track down a Bob Manson (and I cannot find any record of his association
with Red Hat in the aboot sources), but any work he did on behalf of Red Hat
would be property of Red Hat, and you can consider all our changes to be release
under the GPL the same as the rest of the aboot package.</quote>

</para>
</refsect1>

<refsect1><title>DESCRIPTIONS</title>
<para>
<indexterm><primary>sdisklabel</primary></indexterm>
<application>sdisklabel</application>
can be used to create partitions (called disklabels) on Linux/Alpha
systems. You <emphasis>must</emphasis> use disklabels instead of the
<productname>DOS</productname> type
partitioning scheme on any hard disk which you want to boot from via SRM or
which you want to share with <productname>HP Tru64</productname>.
If you instead are booting from <application>milo</application>
then you <emphasis>must not</emphasis> use disklabels on your boot hard disk.
</para>

<para>
Even if you are using disklabels, it is recommended to use 
<application>fdisk</application>(8) instead
of <application>sdisklabel</application>.
</para>

<para>
<application>sdisklabel</application> also assumes 
you have a SCSI disk with 512-byte sectors,
though it should work fine on an IDE drive as well.  All sizes are
specified on the command line in sectors.
</para>

<para>
There are 8 partitions in total which are numbered from 0 to 7. They
correspond to BSD disklabels A to H.
Partitions have to be added sequentially, as 
<application>sdisklabel</application> won't let
you leave empty partitions unlike many BSD disklabel programs. If you
want this (or if you want overlapping disk labels) 
use <application>fdisk</application>(8) instead.
</para>

<para>
First off, if you have an invalid disk label (you've never run 
<application>sdisklabel</application> on this disk
before) you have to issue
</para>

<para>
<command>
sdisklabel <parameter>/dev/sda zero</parameter>
</command>
</para>

<para>
(<filename>/dev/sda</filename> is the device you're partitioning, 
substitute as appropriate).
</para>

<para>
This zeros out your disk label. Only do this if you really want to
zero your disk label. It just does it; it doesn't ask, or warn, or
anything.
</para>

<para>
The program also probably printed out the size of your disk in kb. If
it was wrong, you now get to use the "<parameter>size xxx</parameter>"
option along with the
rest of these commands. The size isn't critical, it's just used to try
and make sure you don't go past the end of the disk.
</para>

<para>
Next, add your first partition. This <emphasis>doesn't</emphasis>
start from 0, as you
have to leave room for the boot loader and other stuff. 256K (or 512
sectors) will be enough.
</para>

<para>
Let's pretend that you want to make a 250000 kb partition starting
from sector offset 512:
</para>

<para>
<command>
sdisklabel <parameter>/dev/sda 0 512 500000 8 print</parameter>
</command>
</para>

<para>
The last number is the filesystem type, and is currently 8 for ext2fs
filesystems. (A different number would be used to specify an
<productname>Tru64</productname>
partition, for example).
</para>

<para>
If all was successful, the program should print out the partition (the
last keyword, "print", specifies that it should print the partition
after modifying it with the previous command), and you should see
something like
</para>

<para>
<blockquote>
<literallayout>
----------------------------------------------------------
I think your disk is 528870K total size.
If I'm wrong, override the size with the 'size num' option

partition 0: type 8, starts sector 512, size 500000
----------------------------------------------------------
</literallayout>
</blockquote>
</para>

<para>
You can then add the next partition, which would be partition 1.
To add a second partition that is 200000 kb long, you'd run
</para>

<para>
<command>
sdisklabel <parameter>/dev/sda 1 512256 400000 8 print</parameter>
</command>
</para>
<para>
And both partitions would then be printed out.
</para>

<para>
If for some reason the size got determined incorrectly, you'd do
instead
</para>
<para>
<command>
sdisklabel <parameter>/dev/sda size 528870 0 512 400000 8 print</parameter>
</command>
</para>

<para>
The size option should come immediately after the device name, and the
size is the total # of sectors on the drive.
</para>

</refsect1>
<refsect1><title>BUGS</title>
<para>
<application>sdisklabel</application> does not check for all errors, so
use with care.
</para>
</refsect1>
<refsect1><title>NOTES</title>
<para>
If you want to share the disk with <productname>HP Tru64</productname>
(<productname>OSF/1</productname>) it is recommended to
use the <productname>Tru64</productname> 
partitioning tools to prepare the disk.
</para>
<para>
To actually boot from the freshly labeled disk you also need to install
a boot strap as well, see
<application>aboot</application>(8) and <application>swriteboot</application>(8)
for details.
</para>
<para>
The print command may be placed before or after any other command.
</para>
<para>
In case you do want to leave empty partitions or create labels which
extend beyond the end of the disk (e.g., when you know 
<application>sdisklabel</application> is reporting a wrong size) then
use can use the <parameter>force</parameter> switch on the command line.
</para>
</refsect1>
<refsect1><title>AUTHOR</title>
<para>
This man page was written by Helge Kreutzmann <email>debian@helgefjell.de</email> for the Debian GNU/Linux project but may be used by others. It is
heavily based on the <filename>README</filename> provided along with the
<application>sdisklabel</application> source.
</para>
</refsect1>
<refsect1><title>SEE ALSO</title>
<para> 
<application>fdisk</application>(8), <application>aboot</application>(8), <application>swriteboot</application>(8)
</para>
</refsect1>
</refentry>