git: d3edb5256c - main - handbook basics: add information about GPT partitions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Jan 2023 14:31:30 UTC
The branch main has been updated by karels (src committer): URL: https://cgit.FreeBSD.org/doc/commit/?id=d3edb5256cea7daffbd0e95e989030c2bce5a04c commit d3edb5256cea7daffbd0e95e989030c2bce5a04c Author: Mike Karels <karels@FreeBSD.org> AuthorDate: 2023-01-20 13:52:47 +0000 Commit: Mike Karels <karels@FreeBSD.org> 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 <<bsdinstall-part-manual>>. +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 <<disks-naming>>. -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 <<basics-disk-slice-part>>. +GPT partitions include the disk name, `p`, and then the partition number. -<<basics-concept-disk-model>> shows a conceptual model of a disk layout. +<<basics-concept-disk-model>> 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`::