sdisklabel.sgml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <!DOCTYPE RefEntry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
  2. <refentry id="sdisklabel">
  3. <refmeta>
  4. <refentrytitle>sdisklabel</refentrytitle>
  5. <manvolnum>8</manvolnum>
  6. <refmiscinfo>sdisklabel</refmiscinfo>
  7. </refmeta>
  8. <refnamediv>
  9. <refname>sdisklabel</refname>
  10. <refpurpose>
  11. Create/modify disklabels on Linux/Alpha systems
  12. </refpurpose>
  13. </refnamediv>
  14. <!-- This is the proper SGML way, but somehow doesn't work here -->
  15. <refsynopsisdiv>
  16. <cmdsynopsis>
  17. <command>sdisklabel</command>
  18. <arg choice="plain">device</arg>
  19. <group choice="opt"><arg choice="plain">print</arg>
  20. <arg choice="plain">zero</arg>
  21. <arg choice="plain">sum</arg>
  22. </group>
  23. </cmdsynopsis>
  24. <cmdsynopsis>
  25. <command>sdisklabel</command>
  26. <arg choice="plain">device</arg>
  27. <arg choice="plain">size</arg>
  28. <arg choice="plain">partsize</arg>
  29. </cmdsynopsis>
  30. <cmdsynopsis>
  31. <command>sdisklabel</command>
  32. <arg choice="plain">device</arg>
  33. <arg choice="plain">partnum</arg>
  34. <arg choice="plain">offset</arg>
  35. <arg choice="plain">size</arg>
  36. <arg choice="plain">parttype</arg>
  37. </cmdsynopsis>
  38. </refsynopsisdiv>
  39. <!-- <refsect1><title>SYNOPSIS</title>
  40. <para>sdisklabel <parameter>drive [print|zero|sum]</parameter></para>
  41. <para>sdisklabel <parameter>drive size partsize</parameter></para>
  42. <para>sdisklabel <parameter>drive partnum offset size parttype</parameter></para>
  43. </refsect1> -->
  44. <refsect1><title>COPYRIGHT</title>
  45. <para>
  46. <application>sdisklabel</application> is Copyright (C) by Red Hat Inc. The
  47. author of this man page tried to track down the original author, but was
  48. unable to do so. A final Bugzilla entry with RedHat yielded the following
  49. reply:
  50. <quote>
  51. I can't track down a Bob Manson (and I cannot find any record of his association
  52. with Red Hat in the aboot sources), but any work he did on behalf of Red Hat
  53. would be property of Red Hat, and you can consider all our changes to be release
  54. under the GPL the same as the rest of the aboot package.</quote>
  55. </para>
  56. </refsect1>
  57. <refsect1><title>DESCRIPTIONS</title>
  58. <para>
  59. <indexterm><primary>sdisklabel</primary></indexterm>
  60. <application>sdisklabel</application>
  61. can be used to create partitions (called disklabels) on Linux/Alpha
  62. systems. You <emphasis>must</emphasis> use disklabels instead of the
  63. <productname>DOS</productname> type
  64. partitioning scheme on any hard disk which you want to boot from via SRM or
  65. which you want to share with <productname>HP Tru64</productname>.
  66. If you instead are booting from <application>milo</application>
  67. then you <emphasis>must not</emphasis> use disklabels on your boot hard disk.
  68. </para>
  69. <para>
  70. Even if you are using disklabels, it is recommended to use
  71. <application>fdisk</application>(8) instead
  72. of <application>sdisklabel</application>.
  73. </para>
  74. <para>
  75. <application>sdisklabel</application> also assumes
  76. you have a SCSI disk with 512-byte sectors,
  77. though it should work fine on an IDE drive as well. All sizes are
  78. specified on the command line in sectors.
  79. </para>
  80. <para>
  81. There are 8 partitions in total which are numbered from 0 to 7. They
  82. correspond to BSD disklabels A to H.
  83. Partitions have to be added sequentially, as
  84. <application>sdisklabel</application> won't let
  85. you leave empty partitions unlike many BSD disklabel programs. If you
  86. want this (or if you want overlapping disk labels)
  87. use <application>fdisk</application>(8) instead.
  88. </para>
  89. <para>
  90. First off, if you have an invalid disk label (you've never run
  91. <application>sdisklabel</application> on this disk
  92. before) you have to issue
  93. </para>
  94. <para>
  95. <command>
  96. sdisklabel <parameter>/dev/sda zero</parameter>
  97. </command>
  98. </para>
  99. <para>
  100. (<filename>/dev/sda</filename> is the device you're partitioning,
  101. substitute as appropriate).
  102. </para>
  103. <para>
  104. This zeros out your disk label. Only do this if you really want to
  105. zero your disk label. It just does it; it doesn't ask, or warn, or
  106. anything.
  107. </para>
  108. <para>
  109. The program also probably printed out the size of your disk in kb. If
  110. it was wrong, you now get to use the "<parameter>size xxx</parameter>"
  111. option along with the
  112. rest of these commands. The size isn't critical, it's just used to try
  113. and make sure you don't go past the end of the disk.
  114. </para>
  115. <para>
  116. Next, add your first partition. This <emphasis>doesn't</emphasis>
  117. start from 0, as you
  118. have to leave room for the boot loader and other stuff. 256K (or 512
  119. sectors) will be enough.
  120. </para>
  121. <para>
  122. Let's pretend that you want to make a 250000 kb partition starting
  123. from sector offset 512:
  124. </para>
  125. <para>
  126. <command>
  127. sdisklabel <parameter>/dev/sda 0 512 500000 8 print</parameter>
  128. </command>
  129. </para>
  130. <para>
  131. The last number is the filesystem type, and is currently 8 for ext2fs
  132. filesystems. (A different number would be used to specify an
  133. <productname>Tru64</productname>
  134. partition, for example).
  135. </para>
  136. <para>
  137. If all was successful, the program should print out the partition (the
  138. last keyword, "print", specifies that it should print the partition
  139. after modifying it with the previous command), and you should see
  140. something like
  141. </para>
  142. <para>
  143. <blockquote>
  144. <literallayout>
  145. ----------------------------------------------------------
  146. I think your disk is 528870K total size.
  147. If I'm wrong, override the size with the 'size num' option
  148. partition 0: type 8, starts sector 512, size 500000
  149. ----------------------------------------------------------
  150. </literallayout>
  151. </blockquote>
  152. </para>
  153. <para>
  154. You can then add the next partition, which would be partition 1.
  155. To add a second partition that is 200000 kb long, you'd run
  156. </para>
  157. <para>
  158. <command>
  159. sdisklabel <parameter>/dev/sda 1 512256 400000 8 print</parameter>
  160. </command>
  161. </para>
  162. <para>
  163. And both partitions would then be printed out.
  164. </para>
  165. <para>
  166. If for some reason the size got determined incorrectly, you'd do
  167. instead
  168. </para>
  169. <para>
  170. <command>
  171. sdisklabel <parameter>/dev/sda size 528870 0 512 400000 8 print</parameter>
  172. </command>
  173. </para>
  174. <para>
  175. The size option should come immediately after the device name, and the
  176. size is the total # of sectors on the drive.
  177. </para>
  178. </refsect1>
  179. <refsect1><title>BUGS</title>
  180. <para>
  181. <application>sdisklabel</application> does not check for all errors, so
  182. use with care.
  183. </para>
  184. </refsect1>
  185. <refsect1><title>NOTES</title>
  186. <para>
  187. If you want to share the disk with <productname>HP Tru64</productname>
  188. (<productname>OSF/1</productname>) it is recommended to
  189. use the <productname>Tru64</productname>
  190. partitioning tools to prepare the disk.
  191. </para>
  192. <para>
  193. To actually boot from the freshly labeled disk you also need to install
  194. a boot strap as well, see
  195. <application>aboot</application>(8) and <application>swriteboot</application>(8)
  196. for details.
  197. </para>
  198. <para>
  199. The print command may be placed before or after any other command.
  200. </para>
  201. <para>
  202. In case you do want to leave empty partitions or create labels which
  203. extend beyond the end of the disk (e.g., when you know
  204. <application>sdisklabel</application> is reporting a wrong size) then
  205. use can use the <parameter>force</parameter> switch on the command line.
  206. </para>
  207. </refsect1>
  208. <refsect1><title>AUTHOR</title>
  209. <para>
  210. 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
  211. heavily based on the <filename>README</filename> provided along with the
  212. <application>sdisklabel</application> source.
  213. </para>
  214. </refsect1>
  215. <refsect1><title>SEE ALSO</title>
  216. <para>
  217. <application>fdisk</application>(8), <application>aboot</application>(8), <application>swriteboot</application>(8)
  218. </para>
  219. </refsect1>
  220. </refentry>