From owner-svn-doc-head@FreeBSD.ORG Mon Jun 10 16:57:31 2013 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76E59BBB; Mon, 10 Jun 2013 16:57:31 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66EF7145C; Mon, 10 Jun 2013 16:57:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5AGvVP2051873; Mon, 10 Jun 2013 16:57:31 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5AGvViO051872; Mon, 10 Jun 2013 16:57:31 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201306101657.r5AGvViO051872@svn.freebsd.org> From: Warren Block Date: Mon, 10 Jun 2013 16:57:31 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r41895 - head/en_US.ISO8859-1/books/handbook/disks X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2013 16:57:31 -0000 Author: wblock Date: Mon Jun 10 16:57:30 2013 New Revision: 41895 URL: http://svnweb.freebsd.org/changeset/doc/41895 Log: Update the Adding Disks section in the Storage chapter. Use a SATA disk device instead of SCSI, use GPT instead of MBR, use gpart instead of fdisk/bsdlabel, remove sysinstall example, remove dedicated mode example. The PR below was submitted after an RFC regarding this change was posted to the freebsd-doc mailing list, but was entirely relevant. http://lists.freebsd.org/pipermail/freebsd-doc/2013-June/022087.html PR: docs/179378 Submitted by: Paul Hoffman Reviewed by: freebsd-doc RFC (no responses after a week) Modified: head/en_US.ISO8859-1/books/handbook/disks/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/disks/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/disks/chapter.xml Mon Jun 10 12:55:29 2013 (r41894) +++ head/en_US.ISO8859-1/books/handbook/disks/chapter.xml Mon Jun 10 16:57:30 2013 (r41895) @@ -180,206 +180,66 @@ This section describes how to add a new - SCSI disk to a machine that currently only + SATA 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 manufacturers. Reboot the system and become root. Inspect /var/run/dmesg.boot to ensure - the new disk was found. In this example, the newly added SCSI - drive should appear as da1. + the new disk was found. In this example, the newly added + SATA drive will appear as + ada1. partitions - slices - fdisk + gpart - &os; runs on IBM-PC compatible computers, therefore it - must take into account the PC BIOS partitions which 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 &os;, use dedicated - mode. Otherwise, &os; will have to live within one of the PC - BIOS partitions. &os; calls the PC BIOS partitions - slices so as not to confuse them with - traditional BSD partitions. Slices may also be used on a disk - that is dedicated to &os;, but used in a computer that also has - another operating system installed. This is a good way to avoid - confusing the fdisk utility of non-&os; - operating systems. - - 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 as - /dev/da1e. - - Due to the use of 32-bit integers to store the number of - sectors, &man.bsdlabel.8; is limited to 2^32-1 sectors per disk, - or 2TB in most cases. The &man.fdisk.8; format allows a - starting sector of no more than 2^32-1 and a length of no more - than 2^32-1, limiting partitions to 2TB and disks to 4TB, in - most cases. The &man.sunlabel.8; format is limited to 2^32-1 - sectors per partition and 8 partitions for a total of 16TB. For - larger disks, &man.gpart.8; may be used to create - GPT partitions. GPT has - the added benefit of not being limited to 4 slices. + For this example, a single large partition will be created + on the new disk. The + GPT partitioning scheme will be + used in preference to the older and less versatile + MBR scheme. - - Using &man.sysinstall.8; - - - sysinstall - adding disks - - - su - - - - - Navigating - <application>sysinstall</application> - - sysinstall can be used to partition - and label a new disk using its easy-to-use menus. As - root, run - sysinstall and enter the - Configure menu. Within the - &os; Configuration Menu, scroll down - and select the Fdisk option. - - - - <application>fdisk</application> Partition - Editor - - Once inside fdisk, pressing - A will use the entire disk for &os;. - When asked whether to remain cooperative with - any future possible operating systems, answer - YES. Write the changes to the disk - using W. Exit the fdisk editor by - pressing Q which will prompt about - the Master Boot Record. Since the disk is - being added to an already running system, choose - None. - - - - Disk Label Editor - - BSD partitions + + If the disk to be added is not blank, old partition + information can be removed with + gpart delete. See &man.gpart.8; for + details. + - Next, exit sysinstall and - start it again. Follow the directions above, except this - time choose the Label option. This - will enter the Disk Label Editor. This - editor is used to create 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 (/). Only the disk the - system boots from should have an a - partition. The b partition is used for - swap partitions, and there can be many disks with swap - partitions. The c partition addresses - the entire disk in dedicated mode, or the entire &os; - slice in slice mode. The other partitions are for general - use. - - The label editor in - sysinstall favors the - e partition for non-root, non-swap - partitions. Within the label editor, create a single file - system by pressing C. When prompted if - this will be a FS (file system) or swap, choose - FS and type in a mount point such as - /mnt). When adding - a disk in post-install mode, - sysinstall will not create - entries in /etc/fstab, so the mount - point you specify is not important. - - Press W to write the new label to the - disk and create a file system on it. Ignore any errors - from sysinstall indicating that - it could not mount the new partition. Exit the label - editor then sysinstall - completely. - + The partition scheme is created, and then a single partition + is added: - - Finish + &prompt.root; gpart create -s GPT ada1 +&prompt.root; gpart add -t freebsd-ufs ada1 - The last step is to edit - /etc/fstab to add an entry for your - new disk. - - - + Depending on use, several smaller partitions may be desired. + See &man.gpart.8; for options to create partitions smaller than + a whole disk. - - Using Command Line Utilities + A file system is created on the new blank disk: - - Using Slices + &prompt.root; newfs -U /dev/ada1 - The setup in the following example allows the new disk - to work correctly with other operating systems that might be - installed on the computer without confusing other operating - systems' fdisk utilities. This method is - recommended for new disk installs. Only use - dedicated mode if there is a good reason - to do so! - - &prompt.root; dd if=/dev/zero of=/dev/da1 bs=1k count=1 -&prompt.root; fdisk -BI da1 #Initialize your new disk -&prompt.root; bsdlabel -B -w da1s1 auto #Label it. -&prompt.root; bsdlabel -e da1s1 # Edit the bsdlabel just created and add any partitions. -&prompt.root; mkdir -p /1 -&prompt.root; newfs /dev/da1s1e # Repeat this for every partition you created. -&prompt.root; mount /dev/da1s1e /1 # Mount the partition(s) -&prompt.root; vi /etc/fstab # Add the appropriate entry/entries to your /etc/fstab. + An empty directory is created as a + mountpoint, a location for mounting the new + disk in the original disk's file system: - For an IDE disk, substitute - ad for da. - + &prompt.root; mkdir /newdisk - - Dedicated + Finally, an entry is added to + /etc/fstab so the new disk will be mounted + automatically at startup: - OS/2 + /dev/ada1 /newdisk ufs rw 2 2 - If the new drive will not be shared with another - operating system, dedicated mode can be - used. This mode can confuse Microsoft operating systems; - however, no damage will be done by them. To configure a - disk in dedicated mode: - - &prompt.root; dd if=/dev/zero of=/dev/da1 bs=1k count=1 -&prompt.root; bsdlabel -Bw da1 auto -&prompt.root; bsdlabel -e da1 # create the `e' partition -&prompt.root; newfs /dev/da1e -&prompt.root; mkdir -p /1 -&prompt.root; vi /etc/fstab # add an entry for /dev/da1e -&prompt.root; mount /1 - - An alternate method is: - - &prompt.root; dd if=/dev/zero of=/dev/da1 count=2 -&prompt.root; bsdlabel /dev/da1 | bsdlabel -BR da1 /dev/stdin -&prompt.root; newfs /dev/da1e -&prompt.root; mkdir -p /1 -&prompt.root; vi /etc/fstab # add an entry for /dev/da1e -&prompt.root; mount /1 + The new disk can be mounted manually, without restarting the + system: - - + &prompt.root; mount /newdisk