Using a 5TB Drive for Ubuntu Server on Raspberry Pi 5 (With MBR Partition Limits)

Challenge: When flashing Ubuntu Server onto a drive larger than 2TB using Raspberry Pi Imager, the resulting root partition is limited to only ~3.2GB. Additionally, drives using the MBR (msdos) partition table cannot support partitions larger than ~2TB due to technical limits (maximum of 232 sectors).

This guide shows how to:

  • Flash Ubuntu Server onto a large HDD (5TB)
  • Resize the root partition to 250GB (safe under MBR limits)
  • Use the remaining unallocated space (~4.2TB) for general storage

Step 1: Flash Ubuntu Server Image onto the 5TB Drive

  1. Download the official Ubuntu Server image for Raspberry Pi from ubuntu.com.
  2. Use Raspberry Pi Imager to write the image to your 5TB drive:
    • Select the Ubuntu Server image.
    • Choose your 5TB drive as the target.
    • Click “Write” to flash the image.
  3. After flashing, the drive contains:
    • /dev/sda1 – 512MB FAT32 boot partition
    • /dev/sda2 – ~3.2GB ext4 root partition

Step 2: Resize Root Partition to 250GB

This avoids MBR’s partition size limits and allows for practical use without converting to GPT.

  1. Connect the drive to a Linux system.
  2. Run lsblk to verify the partitions:
    lsblk
  3. Unmount the partitions if mounted:
    sudo umount /dev/sda1
    sudo umount /dev/sda2
  4. Open parted:
    sudo parted /dev/sda
  5. Inside parted, run:
    rm 2
    mkpart primary ext4 512MB 250GB
    print
    quit
  6. Format the new root partition:
    sudo mkfs.ext4 /dev/sda2
  7. Run filesystem check and resize:
    sudo e2fsck -f /dev/sda2
    sudo resize2fs /dev/sda2

Step 3: Boot the Raspberry Pi 5

  1. Connect the 5TB HDD to your Raspberry Pi 5.
  2. Boot the Pi — it should use the resized 250GB root partition.
  3. Use lsblk or df -h to confirm partitions.

Step 4: Format and Mount the Remaining ~4.2TB Space

  1. Back on the Pi (or another Linux system), open parted again:
    sudo parted /dev/sda
  2. Create a new partition in remaining space:
    mkpart primary ext4 250GB 100%
    print
    quit
  3. Format the new partition:
    sudo mkfs.ext4 /dev/sda3
  4. Create a mount point:
    sudo mkdir -p /mnt/data
  5. Get the UUID of the new partition:
    sudo blkid /dev/sda3

    Example output:

    /dev/sda3: UUID="abcd-1234" TYPE="ext4"
  6. Edit /etc/fstab to auto-mount on boot:
    sudo nano /etc/fstab

    Add this line (replace UUID with yours):

    UUID=abcd-1234 /mnt/data ext4 defaults 0 2
  7. Mount immediately and verify:
    sudo mount -a
    df -h /mnt/data
  8. (Optional) Set ownership:
    sudo chown -R $USER:$USER /mnt/data
    sudo chmod 755 /mnt/data

✅ Result:

  • /dev/sda2 is a 250GB root partition
  • /dev/sda3 is a ~4.2TB data partition, mounted at /mnt/data

You now have a fully bootable Ubuntu Server system on your Raspberry Pi 5 with proper partitioning for large drives under MBR.