#333 Technical review of creating a disk partition in Linux
Merged 3 years ago by nb. Opened 3 years ago by connorl.
fedora-docs/ connorl/quick-docs technical-review-disk-partitioning  into  master

@@ -14,13 +14,12 @@ 

  

  This procedure describes how to partition a storage disk in Linux using the `parted` command.

  

- .Procedure

+ == Procedure

  

  . List the partitions using the `parted -l` command to identify the storage device you want to partition. Typically, the first hard disk (`/dev/sda` or `/dev/vda`) will contain the operating system, so look for another disk to find the one you want. For example:

  +

  ----

- $ sudo parted -l

- [sudo] password for user:

+ sudo parted -l

  Model: ATA RevuAhn_850X1TU5 (scsi)

  Disk /dev/vdc: 512GB

  Sector size (logical/physical): 512B/512B
@@ -35,8 +34,8 @@ 

  . Open the storage device. Use the `parted` command to begin working with the selected storage device. For example:

  +

  ----

- $ sudo parted /dev/vdc

- GNU Parted 3.2

+ sudo parted /dev/vdc

+ GNU Parted 3.3

  Using /dev/vdc

  Welcome to GNU Parted! Type 'help' to view a list of commands.

  (parted)
@@ -58,7 +57,7 @@ 

  +

  [NOTE]

  ====

- The `mklabel` and `mktable` commands are both used for making a partition table on a storage device. At time of writing, the supported partition tables are: `aix`, `amiga`, `bsd`, `dvh`, `gpt`, `mac`, `ms-dos`, `pc98`, `sun`, and `loop`. Remember `mklabel` will not make a partition, rather it will make a partition table.

+ The `mklabel` and `mktable` commands are both used for making a partition table on a storage device. At the time of writing, the supported partition tables are: `aix`, `amiga`, `bsd`, `dvh`, `gpt`, `mac`, `ms-dos`, `pc98`, `sun`, `atari`, and `loop`. Use `help mklabel` to get a list of supported partition tables. Remember `mklabel` will not make a partition, rather it will make a partition table.

  ====

  . Review the partition table of the storage device.

  +
@@ -86,8 +85,8 @@ 

  Sector size (logical/physical): 512B/512B

  Partition Table: gpt

  Disk Flags:

- Number Start   End     Size    File system Name Flags

- 1      17.4kB  1396MB  1396MB  primary

+ Number  Start   End     Size    File system  Name     Flags

+  1      17.4kB  1396MB  1396MB               primary

  ----

  +

  [NOTE]
@@ -100,6 +99,5 @@ 

  ----

  (parted) quit

  Information: You may need to update /etc/fstab. 

- $

  ----

  +

@@ -18,7 +18,7 @@ 

    mkpart PART-TYPE [FS-TYPE] START END     make a partition

  

          PART-TYPE is one of: primary, logical, extended

-         FS-TYPE is one of: btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp,

+         FS-TYPE is one of: udf, btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp,

          linux-swap(v1), linux-swap(v0), ntfs, reiserfs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs, amufs5,

          amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5, affs4, affs3, affs2, affs1,

          affs0, linux-swap, linux-swap(new), linux-swap(old)
@@ -31,7 +31,7 @@ 

  

  [NOTE]

  ====

- * Filesystem type (fstype) will not create an ext4 filesystem on /dev/vdc1. 

+ * Setting filesystem type (`FS-TYPE`) will not create an ext4 filesystem on /dev/vdc1. You still have to create the ext4 filesystem with `mkfs.ext4`.

  * A DOS partition table's partition types are primary, logical, and extended. 

  * Providing a partition name under GPT is a must. In a GPT partition table, the partition type is used as the partition name.

  ====

@@ -4,8 +4,6 @@ 

  [id='disk-partition-in-linux-{context}']

  = Creating a disk partition in Linux

  

- include::{partialsdir}/unreviewed-message.adoc[]

- 

  include::{partialsdir}/con_disk-partition-linux.adoc[leveloffset=+1]

  include::{partialsdir}/proc_creating-a-disk-partition-in-linux.adoc[leveloffset=+1]

  include::{partialsdir}/ref_help-mkpart.adoc[leveloffset=+1]

Fixes #202.

The docs are already up-to-date for the most part. Only minor changes were required:
- Minor formatting fixes
- Updated supported partition tables and fs-types
- Added recommendation to use help mklabel to get updated list of partition tables
- Elaborated on fs-type not creating a filesystem

rebased onto 926ebbc

3 years ago

Pull-Request has been merged by nb

3 years ago