sdisklabel.8 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. .\" This manpage has been automatically generated by docbook2man-spec
  2. .\" from a DocBook document. docbook2man-spec can be found at:
  3. .\" <http://shell.ipoline.com/~elmert/hacks/docbook2X/>
  4. .\" Please send any bug reports, improvements, comments, patches,
  5. .\" etc. to Steve Cheng <steve@ggi-project.org>.
  6. .TH "SDISKLABEL" "8" "23 November 2003" "sdisklabel" ""
  7. .SH NAME
  8. sdisklabel \- Create/modify disklabels on Linux/Alpha systems
  9. .SH SYNOPSIS
  10. .sp
  11. \fBsdisklabel\fR \fBdrive\fR [ \fB print zero sum\fR ]
  12. .sp
  13. \fBsdisklabel\fR \fBdrive\fR \fBsize\fR \fBpartsize\fR
  14. .sp
  15. \fBsdisklabel\fR \fBdrive\fR \fBpartnum\fR \fBoffset\fR \fBsize\fR \fBparttype\fR
  16. .SH "COPYRIGHT"
  17. .PP
  18. \fBsdisklabel\fR is Copyright (C) by Red Hat Inc. The
  19. author of this man page tried to track down the original author, but was
  20. unable to do so. A final Bugzilla entry with RedHat yielded the following
  21. reply:
  22. ``I can't track down a Bob Manson (and I cannot find any record of his association
  23. with Red Hat in the aboot sources), but any work he did on behalf of Red Hat
  24. would be property of Red Hat, and you can consider all our changes to be release
  25. under the GPL the same as the rest of the aboot package.''
  26. .SH "DESCRIPTIONS"
  27. .PP
  28. \fBsdisklabel\fR
  29. can be used to create partitions (called disklabels) on Linux/Alpha
  30. systems. You \fBmust\fR use disklabels instead of the
  31. DOS type
  32. partitioning scheme on any hard disk which you want to boot from via SRM or
  33. which you want to share with HP Tru64.
  34. If you instead are booting from \fBmilo\fR
  35. then you \fBmust not\fR use disklabels on your boot hard disk.
  36. .PP
  37. Even if you are using disklabels, it is recommended to use
  38. \fBfdisk\fR(8) instead
  39. of \fBsdisklabel\fR.
  40. .PP
  41. \fBsdisklabel\fR also assumes
  42. you have a SCSI disk with 512-byte sectors,
  43. though it should work fine on an IDE drive as well. All sizes are
  44. specified on the command line in sectors.
  45. .PP
  46. There are 8 partitions in total which are numbered from 0 to 7. They
  47. correspond to BSD disklabels A to H.
  48. Partitions have to be added sequentially, as
  49. \fBsdisklabel\fR won't let
  50. you leave empty partitions unlike many BSD disklabel programs. If you
  51. want this (or if you want overlapping disk labels)
  52. use \fBfdisk\fR(8) instead.
  53. .PP
  54. First off, if you have an invalid disk label (you've never run
  55. \fBsdisklabel\fR on this disk
  56. before) you have to issue
  57. .PP
  58. \fBsdisklabel \fI/dev/sda zero\fB\fR
  59. .PP
  60. (\fI/dev/sda\fR is the device you're partitioning,
  61. substitute as appropriate).
  62. .PP
  63. This zeros out your disk label. Only do this if you really want to
  64. zero your disk label. It just does it; it doesn't ask, or warn, or
  65. anything.
  66. .PP
  67. The program also probably printed out the size of your disk in kb. If
  68. it was wrong, you now get to use the "\fIsize xxx\fR"
  69. option along with the
  70. rest of these commands. The size isn't critical, it's just used to try
  71. and make sure you don't go past the end of the disk.
  72. .PP
  73. Next, add your first partition. This \fBdoesn't\fR
  74. start from 0, as you
  75. have to leave room for the boot loader and other stuff. 256K (or 512
  76. sectors) will be enough.
  77. .PP
  78. Let's pretend that you want to make a 250000 kb partition starting
  79. from sector offset 512:
  80. .PP
  81. \fBsdisklabel \fI/dev/sda 0 512 500000 8 print\fB\fR
  82. .PP
  83. The last number is the filesystem type, and is currently 8 for ext2fs
  84. filesystems. (A different number would be used to specify an
  85. Tru64
  86. partition, for example).
  87. .PP
  88. If all was successful, the program should print out the partition (the
  89. last keyword, "print", specifies that it should print the partition
  90. after modifying it with the previous command), and you should see
  91. something like
  92. .PP
  93. .sp
  94. .RS
  95. .sp
  96. .nf
  97. ----------------------------------------------------------
  98. I think your disk is 528870K total size.
  99. If I'm wrong, override the size with the 'size num' option
  100. partition 0: type 8, starts sector 512, size 500000
  101. ----------------------------------------------------------
  102. .sp
  103. .fi
  104. .RE
  105. .sp
  106. .PP
  107. You can then add the next partition, which would be partition 1.
  108. To add a second partition that is 200000 kb long, you'd run
  109. .PP
  110. \fBsdisklabel \fI/dev/sda 1 512256 400000 8 print\fB\fR
  111. .PP
  112. And both partitions would then be printed out.
  113. .PP
  114. If for some reason the size got determined incorrectly, you'd do
  115. instead
  116. .PP
  117. \fBsdisklabel \fI/dev/sda size 528870 0 512 400000 8 print\fB\fR
  118. .PP
  119. The size option should come immediately after the device name, and the
  120. size is the total # of sectors on the drive.
  121. .SH "BUGS"
  122. .PP
  123. \fBsdisklabel\fR does not check for all errors, so
  124. use with care.
  125. .SH "NOTES"
  126. .PP
  127. If you want to share the disk with HP Tru64
  128. (OSF/1) it is recommended to
  129. use the Tru64
  130. partitioning tools to prepare the disk.
  131. .PP
  132. To actually boot from the freshly labeled disk you also need to install
  133. a boot strap as well, see
  134. \fBaboot\fR(8) and \fBswriteboot\fR(8)
  135. for details.
  136. .PP
  137. The print command may be placed before or after any other command.
  138. .PP
  139. In case you do want to leave empty partitions or create labels which
  140. extend beyond the end of the disk (e.g. when you know
  141. \fBsdisklabel\fR is reporting a wrong size) then
  142. use can use the \fIforce\fR switch on the command line.
  143. .SH "AUTHOR"
  144. .PP
  145. This man page was written by Helge Kreutzmann <kreutzm@itp.uni-hannover.de> for the Debian GNU/Linux project but may be used by others. It is
  146. heavily based on the \fIREADME\fR provided along with the
  147. \fBsdisklabel\fR source.
  148. .SH "SEE ALSO"
  149. .PP
  150. \fBfdisk\fR(8), \fBaboot\fR(8), \fBswriteboot\fR(8)