(no commit message)
[ikiwiki.git] / docs / handbook / handbook-disks-adding.mdwn
CommitLineData
a3e50cd7 1
2
3## 12.3 Adding Disks
4
5
6
7***Originally contributed by David O'Brien.***
8
9
10
11Lets 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 to the wide variations of procedures to do this, the details are beyond the scope of this document.
12
13
14
15Login as user `root`. After you have installed the drive, inspect `/var/run/dmesg.boot` to ensure the new disk was found. Continuing with our example, the newly added drive will be `da1` and we want to mount it on `/1` (if you are adding an IDE drive, the device name will be `ad1`).
16
17
18
19Because DragonFly 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 DragonFly, you can use the ***dedicated*** mode. Otherwise, DragonFly will have to live within one of the PC BIOS partitions. DragonFly calls the PC BIOS partitions ***slices*** so as not to confuse them with traditional BSD partitions. You may also use slices on a disk that is dedicated to DragonFly, but used in a computer that also has another operating system installed. This is to not confuse the `fdisk` utility of the other operating system.
20
21
22
23In the slice case the drive will be added as `/dev/da1s1e`. This is read as: SCSI disk, unit number 1 (second SCSI disk), slice 1 (PC BIOS partition 1), and `e` BSD partition. In the dedicated case, the drive will be added simply as `/dev/da1s0e`.
24
25
26
27### 12.3.1 Using Command Line Utilities
28
29
30
31#### 12.3.1.1 Using Slices
32
33
34
35This setup will allow your disk to work correctly with other operating systems that might be installed on your computer and will not confuse other operating systems' `fdisk` utilities. It is recommended to use this method for new disk installs. Only use `dedicated` mode if you have a good reason to do so!
36
37
38
39
40
41 # dd if=/dev/zero of=/dev/da1 bs=1k count=1
42
43 # fdisk -BI da1 # Initialize your new disk
44
45 # disklabel -B -w -r da1s1 auto # Label it.
46
47 # disklabel -e da1s1 # Edit the disklabel just created and add any partitions
48
49 # mkdir -p /1
50
51 # newfs /dev/da1s1e # Repeat this for every partition you created
52
53 # mount /dev/da1s1e /1 # Mount the partition(s)
54
55 # vi /etc/fstab # Add the appropriate entry/entries to your `/etc/fstab`
56
57
58
59
60
61If you have an IDE disk, substitute `ad` for `da`.
62
63
64
65#### 12.3.1.2 Dedicated
66
67
68
69If you will not be sharing the new drive with another operating system, you may use the `dedicated` mode. Remember this mode can confuse Microsoft operating systems; however, no damage will be done by them. IBM's OS/2® however, will "appropriate" any partition it finds which it does not understand.
70
71
72
73
74
75 # dd if=/dev/zero of=/dev/da1 bs=1k count=1
76
77 # disklabel -Brw da1s0 auto
78
79 # disklabel -e da1s0 # Create the `e' partition
80
81 # newfs -d0 /dev/da1s0e
82
83 # mkdir -p /1
84
85 # vi /etc/fstab # Add an entry for /dev/da1s0e
86
87 # mount /1
88
89
90
91
92
93An alternate method is:
94
95
96
97
98
99 # dd if=/dev/zero of=/dev/da1 count=2
100
101 # disklabel /dev/da1s0 | disklabel -BrR da1s0 /dev/stdin
102
103 # newfs /dev/da1s0e
104
105 # mkdir -p /1
106
107 # vi /etc/fstab # add an entry for /dev/da1s0e
108
109 # mount /1
110
111
112
113
114
115
116
117
118
119CategoryHandbook
120
121CategoryHandbook-storage
122