diff --git a/handbook/disks.sgml b/handbook/disks.sgml index 4a3673589e..417f21f374 100644 --- a/handbook/disks.sgml +++ b/handbook/disks.sgml @@ -1,30 +1,134 @@ Disks

Contributed by &a.obrien;26 April 1998 - * Using systinstall - * Using command line utilities - * Creating Slices - * Dedicated +

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. + + Login as user root. After you've 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 sd1 + and we want to mount it on /1. + (if you are adding an IDE drive substitute wd for sd) + + 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 + dedicated mode. Otherwise, FreeBSD will have to live with in + one of the PC BIOS partitions. FreeBSD 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 + FreeBSD, but used in a computer that also has another operating system + installed. This is not confuse the fdisk utility of the other + operating system. + + In the slice case the drive will be added as /dev/sd1s1e. + 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/sd1e. + + Using systinstall +

You may use /stand/sysinstall to partition and label a new + disk using its easy to use menus. Either login as user root + or use the su command. Run /stand/sysinstall and enter + the Configure menu. With in the FreeBSD Configuration + Menu, scroll down and select the Partition item. Next you + should be presented with a list of hard drives installed in your system. + If you do not see sd1 listed, you need to recheck your physical + installation and dmesg output in the file + /var/run/dmesg.boot. + + Select sd1 to enter the FDISK Partition Editor. + Choose A to use the entire disk for FreeBSD. When asked if you + want to ``remain cooperative with any future possible operating systems'', + answer YES. Write the changes to the disk using W. + Now exit the FDISK editor using q. + Next you will be asked about the Master Boot Record. Since you are + adding a disk to an already running system, choose None. + + Next enter the Disk Label Editor. 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 a partition is used for the root partition (/). + A system should only use the a partition on the system disk. + The b is used for swap partitions, and you may have many + disks with swap partitions. The c partition addresses the + entire disk in dedicated mode, or the entire FreeBSD slice in slice + mode. The other partitions are for general use. + + Sysinstall's Label editor favors the e partition for non-root, + non-swap partitions. With in the Label editor, create a single file + system using C. When prompted if this will be a FS (file + system) or swap, choose ``FS'' and give a mount point. Use + /mnt. When adding a disk in post-install mode, Sysinstall + will not create entries in /etc/fstab for you. So the + mount point you specify isn't important. + + You are now ready to write the new label to the disk and create a + file system on it. Do this by hitting W. Ignore any errors + from Sysinstall that it could not mount the new partition. Exit + the Label Editor and Sysinstall completely. + + The last step is to edit /etc/fstab to add an entry for your + new disk. + + Using command line utilities + + * Using Slices + + Dedicated +

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. + + dd if=/dev/zero of=/dev/rsd1 bs=1k count=1 + disklabel -Brw sd1 auto + disklabel -e sd1 # create the `e' partition + newfs -d0 /dev/rsd1e + mkdir -p /1 + vi /etc/fstab # add an entry for /dev/sd1e + mount /1 + + + An alternate method is: + + + dd if=/dev/zero of=/dev/rsd1 count=2 + disklabel /dev/rsd1 | disklabel -BrR sd1 /dev/stdin + newfs /dev/rsd1c + mkdir -p /1 + vi /etc/fstab # add an entry for /dev/sd1e + mount /1 + + + + * Non-traditional Drives + * Zip Drives + * Jazz Drives + * Sequest Drives