aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO_8859-1/books/handbook/disks/chapter.sgml
blob: 31d4d1bd7c4c15c1c94ab37052cbfa1beb57741f (plain) (blame)
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
<!--
     The FreeBSD Documentation Project

     $Id: chapter.sgml,v 1.5 1999-03-08 22:04:38 nik Exp $
-->

<chapter id="disks">
  <title>Disks</title>
  
  <para><emphasis>Contributed by &a.obrien; 26 April 1998</emphasis></para>
    
  <para>Lets say we want to add a new SCSI disk to a machine that currently
    only has a single drive.  First turn off the computer and install the
    drive in the computer following the instructions of the computer,
    controller, and drive manufacturer.  Due the wide variations of procedures
    to do this, the details are beyond the scope of this document.</para>

  <para>Login as user <username>root</username>.  After you've installed the
    drive, inspect <filename>/var/run/dmesg.boot</filename> to ensure the new
    disk was found.  Continuing with our example, the newly added drive will
    be <filename>sd1</filename> and we want to mount it on
    <filename>/1</filename>.  (if you are adding an IDE drive substitute
    <filename>wd</filename> for <filename>sd</filename>)</para>
  
  <para>Because FreeBSD runs on IBM-PC compatible computers, it must take into
    account the PC BIOS partitions.  These are different from the traditional
    BSD partitions.  A PC disk has up to four BIOS partition entries.  If the
    disk is going to be truly dedicated to FreeBSD, you can use the
    <emphasis>dedicated</emphasis> mode.  Otherwise, FreeBSD will have to live
    with in one of the PC BIOS partitions.  FreeBSD calls the PC BIOS
    partitions, <emphasis>slices</emphasis> so as not to confuse them with
    traditional BSD partitions.  You may also use slices on a disk that is
    dedicated to FreeBSD, but used in a computer that also has another
    operating system installed.  This is to not confuse the
    <command>fdisk</command> utility of the other operating system.</para>

  <para>In the slice case the drive will be added as
    <filename>/dev/sd1s1e</filename>.  This is read as: SCSI disk, unit number
    1 (second SCSI disk), slice 1 (PC BIOS partition 1), and
    <filename>e</filename> BSD partition.  In the dedicated case, the drive
    will be added simply as <filename>/dev/sd1e</filename>.</para>

  <sect1>
    <title>Using sysinstall</title>
    
    <para>You may use <command>/stand/sysinstall</command> to partition and
      label a new disk using its easy to use menus.  Either login as user
      <username>root</username> or use the <command>su</command> command.  Run
      <command>/stand/sysinstall</command> and enter the
      <literal>Configure</literal> menu.  With in the <literal>FreeBSD
	Configuration Menu</literal>, scroll down and select the
      <literal>Partition</literal> item.  Next you should be presented with a
      list of hard drives installed in your system.  If you do not see
      <literal>sd1</literal> listed, you need to recheck your physical
      installation and <command>dmesg</command> output in the file
      <filename>/var/run/dmesg.boot</filename>.</para>
    
    <para>Select <literal>sd1</literal> to enter the <literal>FDISK Partition
	Editor</literal>.  Choose <literal>A</literal> to use the entire disk
      for FreeBSD.  When asked if you want to <quote>remain cooperative with
	any future possible operating systems</quote>, answer
      <literal>YES</literal>.  Write the changes to the disk using
      <command>W</command>.  Now exit the FDISK editor using
      <command>q</command>.  Next you will be asked about the Master Boot
      Record.  Since you are adding a disk to an already running system,
      choose <literal>None</literal>.</para>

    <para>Next enter the <literal>Disk Label Editor</literal>.  This is where
      you will create the traditional BSD partitions.  A disk can have up to
      eight partitions, labeled a-h.  A few of the partition labels have
      special uses.  The <literal>a</literal> partition is used for the root
      partition (<filename>/</filename>).  Thus only your system disk (e.g,
      the disk you boot from) should have an <literal>a</literal> partition.
      The <literal>b</literal> partition is used for swap partitions, and you
      may have many disks with swap partitions.  The <literal>c</literal>
      partition addresses the entire disk in dedicated mode, or the entire
      FreeBSD slice in slice mode.  The other partitions are for general
      use.</para>

    <para>Sysinstall's Label editor favors the <literal>e</literal> partition
      for non-root, non-swap partitions.  With in the Label editor, create a
      single file system using <command>C</command>.  When prompted if this
      will be a FS (file  system) or swap, choose <literal>FS</literal> and
      give a mount point (e.g, <filename>/mnt</filename>).  When adding a disk
      in post-install mode, Sysinstall will not create entries in
      <filename>/etc/fstab</filename> for you, so the mount point you specify
      isn't important.</para>

    <para>You are now ready to write the new label to the disk and create a
      file system on it.  Do this by hitting <command>W</command>.  Ignore any
      errors from Sysinstall that it could not mount the new partition.  Exit
      the Label Editor and Sysinstall completely.</para>

    <para>The last step is to edit <filename>/etc/fstab</filename> to add an
      entry for your new disk.</para>
  </sect1>

  <sect1>
    <title>Using command line utilities</title>

    <sect2>
      <title>* Using Slices</title>

      <para></para>
    </sect2>
    
    <sect2>
      <title>Dedicated</title>

      <para>If you will not be sharing the new drive with another operating
	system, you may use the <literal>dedicated</literal> mode.  Remember
	this mode can confuse Microsoft operating systems; however, no damage
	will be done by them.  IBM's OS/2 however, will
	&ldquo;appropriate&rdquo; any partition it finds which it doesn't
	understand.</para>
      
      <screen>&prompt.root; <userinput>dd if=/dev/zero of=/dev/rsd1 bs=1k count=1</userinput>
&prompt.root; <userinput>disklabel -Brw sd1 auto</userinput>
&prompt.root; <userinput>disklabel -e sd</userinput>1				# create the `e' partition
&prompt.root; <userinput>newfs -d0 /dev/rsd1e</userinput>
&prompt.root; <userinput>mkdir -p /1</userinput>
&prompt.root; <userinput>vi /etc/fstab</userinput>					# add an entry for /dev/sd1e
&prompt.root; <userinput>mount /1</userinput></screen>
    
      <para>An alternate method is:</para>
    
      <screen>&prompt.root; <userinput>dd if=/dev/zero of=/dev/rsd1 count=2</userinput>
&prompt.root; <userinput>disklabel /dev/rsd1 | disklabel -BrR sd1 /dev/stdin</userinput>
&prompt.root; <userinput>newfs /dev/rsd1e</userinput>
&prompt.root; <userinput>mkdir -p /1</userinput>
&prompt.root; <userinput>vi /etc/fstab</userinput>					# add an entry for /dev/sd1e
&prompt.root; <userinput>mount /1</userinput></screen>
    </sect2>
  </sect1>
  
  <sect1>
    <title>* Non-traditional Drives</title>
    
    <sect2>
      <title>* Zip Drives</title>

      <para></para>
    </sect2>

    <sect2>
      <title>* Jazz Drives</title>

      <para></para>
    </sect2>
    
    <sect2>
      <title>* Sequest Drives</title>

      <para></para>
    </sect2>
  </sect1>
</chapter>

<!-- 
     Local Variables:
     mode: sgml
     sgml-declaration: "../chapter.decl"
     sgml-indent-data: t
     sgml-omittag: nil
     sgml-always-quote-attributes: t
     sgml-parent-document: ("../handbook.sgml" "part" "chapter")
     End:
-->