From nobody Sun Jan 22 14:31:30 2023 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P0FzQ6LS9z2v5y6 for ; Sun, 22 Jan 2023 14:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P0FzQ5NqGz46HS; Sun, 22 Jan 2023 14:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674397890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jJ+FKuQmHoogbB/059/I9WMhwQgPu8boNTNwuv6I9Xw=; b=ny617lSgAKj+easV2YS0yUcshBvscghhuYSvX+SGWcOcqePHlo4zxgwHONbXhMalhUg2Fb XeVg1FGzuxjfCTfVnExuPxCKBkNLZvBUPPHwRUASGeddWRBfZ0CZsukhtvi0nDYVunQH0W aB/tXjBs4h1aHGsO3DwqP9aWckAtb5GRZMwPIQt1emM7n4RsO73IQKhBf4riexu4/Xn6sL 90MljJhiXoQLYJHY5XlPbu0Y/fm9o2iKiTUQaapOspIG2dtTV+asnvlk1DZ+SW+CNL5XJ0 srFApwwHjYasbjfJnmAg3lqtAAKtRY/fyrMe0WbrI4AtyHPjpCZjNJztRqi4PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674397890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jJ+FKuQmHoogbB/059/I9WMhwQgPu8boNTNwuv6I9Xw=; b=rFtDYXURP/GjNp9oy9YDZbrhNCV5fCtE1ojSRXXv2uPjZBxasfb7zshMAcOERU+XzUOzGh xW68ivnZXCcMuI2fVe5yLsIdyLYznQx/j+y+478d6Tv3eE7yvGkvqx3lxYvRfJFVOGzaHu xf+TjfPOujKAVcc9q79ADH5XOw25iVpShYA1xxNHxhGoNchs61vLkYNFmZfV+FNsotc2xI /VJH04//0/9axDmUS7mF8uXu0w+lM+1u8FI8Yj/F6XxXIF1dm6F8MozUDCHLmTproHC0k2 uEsQN0WC4XZWS+PJsJqYAPA53248TxL4Cs3G+kDXq7ohcTUuE/ecQCMqVw8XJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674397890; a=rsa-sha256; cv=none; b=D3Ar8QUMnd5qk4yq7KBrhchq6tmo+t3TqAYJ25Rt9srNTSbQlOKyzpoB6frm1iU0xLYMW0 yHHmlR7R5LAiVwVbMW1cKX5H3Ip5QhB7qhR8Vib1JPqyANM3e8ok8KpdiDKfRSTtgWpo2T kFnCdgcEbsRG65IT1uFyiW3eOOikjv7OsiF17hz+ttOtZ2rBV5wG6Qj9viEXX/ZrGatLi3 8eJUAhXdlYltrAO2dS2TGaReRpdtbjfUiWmJEfsturOQVu8N0B1eELtEDHnHtqq0cwRQYF 00e6Db+Mgo30IEr5qJzI6jJtfbPiZfM4CYzrgz7TdfuTjmq9D52/QOb1iJZXOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P0FzQ4RzFzscM; Sun, 22 Jan 2023 14:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30MEVUVe093533; Sun, 22 Jan 2023 14:31:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30MEVUNH093532; Sun, 22 Jan 2023 14:31:30 GMT (envelope-from git) Date: Sun, 22 Jan 2023 14:31:30 GMT Message-Id: <202301221431.30MEVUNH093532@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Mike Karels Subject: git: d3edb5256c - main - handbook basics: add information about GPT partitions List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3edb5256cea7daffbd0e95e989030c2bce5a04c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels (src committer): URL: https://cgit.FreeBSD.org/doc/commit/?id=d3edb5256cea7daffbd0e95e989030c2bce5a04c commit d3edb5256cea7daffbd0e95e989030c2bce5a04c Author: Mike Karels AuthorDate: 2023-01-20 13:52:47 +0000 Commit: Mike Karels CommitDate: 2023-01-22 14:30:22 +0000 handbook basics: add information about GPT partitions Generalize section on disk partitions by adding information on using GPT partitions as well as MBR, rearranging some of the material to try to make it flow better. Use "BSD partition" to describe the bsdlabel-based partitions inside a slice. Add section headings for file systems and partitions. Other touch-ups while here. Reviewed by: carlavilla Approved by: carlavilla Differential Revision: https://reviews.freebsd.org/D38137 --- .../content/en/books/handbook/basics/_index.adoc | 62 ++++++++++++++-------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/documentation/content/en/books/handbook/basics/_index.adoc b/documentation/content/en/books/handbook/basics/_index.adoc index 6174c0ade0..74a452c61c 100644 --- a/documentation/content/en/books/handbook/basics/_index.adoc +++ b/documentation/content/en/books/handbook/basics/_index.adoc @@ -1142,6 +1142,9 @@ Note that this is different from Windows(R) which uses `\` to separate file and FreeBSD does not use drive letters, or other drive names in the path. For example, one would not type `c:\foo\bar\readme.txt` on FreeBSD. +[[disks-file-systems]] +=== File systems + Directories and files are stored in a file system. Each file system contains exactly one directory at the very top level, called the _root directory_ for that file system. This root directory can contain other directories. @@ -1201,16 +1204,35 @@ If there is space after the partition, the partition can be expanded with man:gp If the partition is the last one on a virtual disk, and the disk is expanded, the partition can then be expanded. ==== -File systems are contained in partitions. -This does not have the same meaning as the common usage of the term partition (for example, MS-DOS(R) partition), because of FreeBSD's UNIX(R) heritage. -Each partition is identified by a letter from `a` through to `h`. -Each partition can contain only one file system, which means that file systems are often described by either their typical mount point in the file system hierarchy, or the letter of the partition they are contained in. +[[disks-partitions]] +=== Disk partitions + +File systems are contained in _partitions_. +Disks are divided into partitions using one of several partitioning schemes; +see <>. +The newer scheme is GPT; older BIOS-based computers use MBR. +GPT supports division of a disk into partitions with a size, offset, and type. +It supports a large number of partitions and partition types, and is recommended whenever its use is possible. +GPT partitions use the disk name with a suffix, where the suffix is `p1` for the first partition, `p2` for the second, and so on. +MBR, however, supports only a small number of partitions. +The MBR partitions are known in FreeBSD as `slices`. +Slices may be used for different operating systems. +FreeBSD slices are subdivided into partitions using BSD labels (see man:bsdlabel[8]). + +Slice numbers follow the device name, prefixed with an `s`, starting at 1. +So "da0__s1__" is the first slice on the first SCSI drive. +There can only be four physical slices on a disk, but there can be logical slices inside physical slices of the appropriate type. +These extended slices are numbered starting at 5, so "ada0__s5__" is the first extended slice on the first SATA disk. +These devices are used by file systems that expect to occupy a slice. + +Each GPT or BSD partition can contain only one file system, which means that file systems are often described by either their typical mount point in the file system hierarchy, or the name of the partition they are contained in. FreeBSD also uses disk space for _swap space_ to provide _virtual memory_. This allows your computer to behave as though it has much more memory than it actually does. When FreeBSD runs out of memory, it moves some of the data that is not currently being used to the swap space, and moves it back in (moving something else out) when it needs it. +This is called _paging_. -Some partitions have certain conventions associated with them. +Some BSD partitions have certain conventions associated with them. [cols="25h,~"] |=== @@ -1230,30 +1252,25 @@ Some partitions have certain conventions associated with them. |Partition `d` used to have a special meaning associated with it, although that is now gone and `d` may work as any normal partition. |=== -Disks in FreeBSD are divided into slices, referred to in Windows(R) as partitions, which are numbered from 1 to 4. -These are then divided into partitions, which contain file systems, and are labeled using letters. - -Slice numbers follow the device name, prefixed with an `s`, starting at 1. -So "da0__s1__" is the first slice on the first SCSI drive. -There can only be four physical slices on a disk, but there can be logical slices inside physical slices of the appropriate type. -These extended slices are numbered starting at 5, so "ada0__s5__" is the first extended slice on the first SATA disk. -These devices are used by file systems that expect to occupy a slice. - -Slices, "dangerously dedicated" physical drives, and other drives contain _partitions_, which are represented as letters from `a` to `h`. +Slices and "dangerously dedicated" physical drives contain BSD partitions, which are represented as letters from `a` to `h`. This letter is appended to the device name, so "da0__a__" is the `a` partition on the first `da` drive, which is "dangerously dedicated". "ada1s3__e__" is the fifth partition in the third slice of the second SATA disk drive. Finally, each disk on the system is identified. A disk name starts with a code that indicates the type of disk, and then a number, indicating which disk it is. -Unlike slices, disk numbering starts at 0. +Unlike partitions and slices, disk numbering starts at 0. Common codes are listed in <>. -When referring to a partition, include the disk name, `s`, the slice number, and then the partition letter. +When referring to a partition in a slice, include the disk name, `s`, the slice number, and then the partition letter. Examples are shown in <>. +GPT partitions include the disk name, `p`, and then the partition number. -<> shows a conceptual model of a disk layout. +<> shows a conceptual model of a disk layout using MBR slices. -When installing FreeBSD, configure the disk slices, create partitions within the slice to be used for FreeBSD, create a file system or swap space in each partition, and decide where each file system will be mounted. +When installing FreeBSD, configure the disk slices if using MBR, and create partitions within the slice to be used for FreeBSD. +If using GPT, configure partitions for each file system. +In either case, create a file system or swap space in each partition, and decide where each file system will be mounted. +See man:gpart[8] for information on manipulating partitions. [[disks-naming]] .Disk Device Names @@ -1274,7 +1291,7 @@ When installing FreeBSD, configure the disk slices, create partitions within the |SATA and IDE CD-ROM drives |`cd` -|SCSICD-ROM drives +|SCSI CD-ROM drives |`cd` |Floppy drives @@ -1385,7 +1402,10 @@ The most basic syntax is as follows: .... ==== -This command provides many options which are described in man:mount[8], The most commonly used options include: +A file system listed in `/etc/fstab` can also be mounted by providing just the mountpoint. + +This command provides many options which are described in man:mount[8]. +The most commonly used options include: .Mount Options `-a`::