Skip to content

Arch Linux Install File System Ext4

Instruction Order

Partition The Drive

  1. Find the desired drive to partition

    # 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
    

    1. Press X to enter the advanced menu.
    2. Press Z to zap the drive.
    3. Press Y to confirm.
    4. 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.

  3. Create boot partition using "gdisk"

    # gdisk /dev/sda
    

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

    1. Press W to write changes.
    2. Confirm writing changes.
      Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? Y
      

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