Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created November 27, 2024 11:31
Show Gist options
  • Save miguelmota/fa44d631cc09357411c016a70313f18e to your computer and use it in GitHub Desktop.
Save miguelmota/fa44d631cc09357411c016a70313f18e to your computer and use it in GitHub Desktop.
Arch linux partition using fdisk
# wipefs removes all filesystem signatures from the disk, including partition tables.
# This does not overwrite the actual data but removes metadata so the disk appears unformatted.
# If you want to securely wipe the disk, use a method like dd or blkdiscard.
sudo wipefs --all /dev/nvme0n1
Using fdisk to prepare your disk for Arch Linux installation involves partitioning the disk as per your notes. Here’s a step-by-step guide:
Step 1: Start fdisk
Run fdisk on the target disk (e.g., /dev/sda):
bash
Copy code
sudo fdisk /dev/sda
Step 2: Create Partitions
Step 2.1: Create EFI System Partition (500MB)
Enter n to create a new partition.
Choose p for primary.
Enter partition number: 1.
Set First Sector (press Enter to accept the default).
Set Last Sector: +500M (for 500MB).
Mark it as EFI:
Press t to change the partition type.
Enter 1 (partition number).
Enter ef for EFI System.
Step 2.2: Create Swap Partition (8GB)
Enter n to create a new partition.
Choose p for primary.
Enter partition number: 2.
Set First Sector (press Enter to accept the default).
Set Last Sector: +8G (for 8GB).
Mark it as Linux Swap:
Press t to change the partition type.
Enter 2 (partition number).
Enter 82 for Linux Swap.
Step 2.3: Create Root Partition (Remaining Space)
Enter n to create a new partition.
Choose p for primary.
Enter partition number: 3.
Set First Sector (press Enter to accept the default).
Set Last Sector: Press Enter to use the remaining disk space.
Mark it as bootable:
Press a to toggle the bootable flag.
Enter 3 (partition number).
Step 3: Verify Partition Table
Press p to print the partition table.
It should look similar to this:
bash
Copy code
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1050623 1048576 500M ef EFI (FAT-12/16/32)
/dev/sda2 1050624 17825791 16777216 8G 82 Linux swap
/dev/sda3 17825792 <end> <remaining size> 83 Linux
Step 4: Write Changes
Press w to write changes to the disk and exit fdisk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment