Skip to content

Arch Linux Install File System Ext4

Instruction Order

  1. Partitioning The Drive
  2. Format The Drive Partitions
  3. Mount The Drive Partitions

Partition The Drive

  1. See what drives are available using "fdisk".

    # fdisk -l
    
    Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x7a21f024
    
    Device     Boot  Start       End   Sectors  Size Id Type
    /dev/sda1  *      2048    206847    204800  100M 83 Linux
    /dev/sda2       206848 943925247 943718400  450G 83 Linux
    

  2. Set up the new partition structure using "gdisk".

    # gdisk /dev/sda
    

  3. Press X to enter the advanced menu.

  4. Press Z to zap the drive.
  5. Press Y to confirm.
  6. Press Y to delete MBR.

    Note: If "found invalid MBR and/or corrupt GPT", create a blank GPT.

    Note: If "gdisk" complains about existing partition tables, zap (wipe the partition tables) the drive.

  7. Press N for new "boot" partition.

    1. Partition number, press Enter (default 1).
    2. Press Enter to use the default first sector.
    3. Type "500M" and press Enter to specify the last sector.
    4. Enter "ef00" to specify that this is an EFI partition.
  8. Press N for new "root" partition
    1. Partition number, press Enter (default 2).
    2. Press Enter to use the default first sector.
    3. Press Enter to use the default last sector.
    4. Press Enter to accept the default partition type (should be "8300" or Linux).
  9. Write the changes to the disk by hitting W and then confirming.

Format The Drive Partitions

Note: You will require the package, "dosfstools".

  1. Format the EFI partition.

    # mkfs.fat -F32 /dev/sda1
    
  2. Format the Linux root partition. The label "archlinux" can be replaced with any desired string.

    # mkfs.ext4 -L archlinux /dev/sda2
    

Mount The Drive Partitions

Mount the partitions, create the boot directory and mount the EFI partition.

  1. Create the root directory.

    # mkdir /mnt/root
    
  2. Mount the root partition.

    # mount /dev/sda2 /mnt/root
    
  3. Create the boot directory.

    # mkdir /mnt/root/boot
    
  4. Mount the boot partition.

    # mount /dev/sda1 /mnt/root/boot
    

Last update: August 9, 2020