Skip to content

Instantly share code, notes, and snippets.

@cassc
Created September 24, 2024 09:01
Show Gist options
  • Save cassc/5d341f3a9fbb661610222cc277de9e7e to your computer and use it in GitHub Desktop.
Save cassc/5d341f3a9fbb661610222cc277de9e7e to your computer and use it in GitHub Desktop.
create partition from raw disk

The issue you’re seeing is related to the limitations of the fdisk tool with the MBR (Master Boot Record) partition scheme, which can only handle partitions up to 2 TiB in size. However, your disk is 7.3 TiB, and to fully utilize it, you need to use the GPT (GUID Partition Table) scheme instead of MBR.

Here’s how to correctly create a GPT partition that supports your entire 7.3 TiB disk using gdisk, which is suitable for larger disks.

Steps to Partition and Format the Disk Using gdisk:

  1. Install gdisk (if not already installed):

    sudo apt-get update
    sudo apt-get install gdisk
  2. Run gdisk to Create a GPT Partition:

    sudo gdisk /dev/sdc

    You will see a prompt similar to this:

    GPT fdisk (gdisk) version 1.0.3
    Partition table scan:
      MBR: not present
      BSD: not present
      APM: not present
      GPT: not present
    
    Creating new GPT entries.
    Command (? for help):
    
  3. Create the New Partition:

    • Press n to create a new partition.
    • Accept the default partition number (1).
    • Accept the default first sector (2048).
    • For the last sector, press Enter to use the default, which selects the entire disk.
    • Press w to write the changes and confirm with y.
  4. Format the New Partition as ext4:

    sudo mkfs.ext4 /dev/sdc1
  5. Create a Mount Point:

    sudo mkdir -p /mnt/ethereum-node
  6. Mount the Partition:

    sudo mount /dev/sdc1 /mnt/ethereum-node
  7. Make the Mount Permanent (by editing /etc/fstab):

    • Get the UUID of the partition:
      sudo blkid /dev/sdc1
    • Edit the /etc/fstab file:
      sudo nano /etc/fstab
    • Add this line (replace <your-uuid> with the actual UUID from the blkid output):
      UUID=<your-uuid> /mnt/ethereum-node ext4 defaults 0 2
      

Summary

By using gdisk, you ensure that your partition table is created using the GPT scheme, which allows you to use the full 7.3 TiB capacity of your disk. The ext4 formatting step remains the same, and your disk will be ready for running your Ethereum archive node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment