279361a0dde4efb2955194f41bf55f64a6a07ec2
[ikiwiki.git] / docs / handbook / handbook-disks-adding.mdwn
1 \r
2 \r
3 ## 12.3 Adding Disks \r
4 \r
5 ***Originally contributed by David O'Brien.***\r
6 \r
7 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 to the wide variations of procedures to do this, the details are beyond the scope of this document.\r
8 \r
9 Login 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`).\r
10 \r
11 Because 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.\r
12 \r
13 In 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`.\r
14 \r
15 ### 12.3.1 Using Command Line Utilities \r
16 \r
17 #### 12.3.1.1 Using Slices \r
18 \r
19 This 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!\r
20 \r
21     \r
22     # dd if#/dev/zero of/dev/da1 bs=1k count=1\r
23     # fdisk -BI da1                     # Initialize your new disk\r
24     # disklabel -B -w -r da1s1 auto     # Label it.\r
25     # disklabel -e da1s1                # Edit the disklabel just created and add any partitions\r
26     # mkdir -p /1\r
27     # newfs /dev/da1s1e         # Repeat this for every partition you created\r
28     # mount /dev/da1s1e /1              # Mount the partition(s)\r
29     # vi /etc/fstab                     # Add the appropriate entry/entries to your `/etc/fstab`\r
30 \r
31 \r
32 If you have an IDE disk, substitute `ad` for `da`.\r
33 \r
34 #### 12.3.1.2 Dedicated \r
35 \r
36 If 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.\r
37 \r
38     \r
39     # dd if#/dev/zero of/dev/da1 bs=1k count=1\r
40     # disklabel -Brw da1s0 auto\r
41     # disklabel -e da1s0                # Create the `e' partition\r
42     # newfs -d0 /dev/da1s0e\r
43     # mkdir -p /1\r
44     # vi /etc/fstab                     # Add an entry for /dev/da1s0e\r
45     # mount /1\r
46 \r
47 \r
48 An alternate method is:\r
49 \r
50     \r
51     # dd if#/dev/zero of/dev/da1 count=2\r
52     # disklabel /dev/da1s0 | disklabel -BrR da1s0 /dev/stdin\r
53     # newfs /dev/da1s0e\r
54     # mkdir -p /1\r
55     # vi /etc/fstab                     # add an entry for /dev/da1s0e\r
56     # mount /1\r
57 \r
58 \r
59 \r
60 \r
61 CategoryHandbook\r
62 CategoryHandbook-storage\r