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
- Download the official Ubuntu Server image for Raspberry Pi from ubuntu.com.
- 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.
- 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.
- Connect the drive to a Linux system.
- Run
lsblkto verify the partitions:lsblk - Unmount the partitions if mounted:
sudo umount /dev/sda1 sudo umount /dev/sda2 - Open parted:
sudo parted /dev/sda - Inside
parted, run:rm 2 mkpart primary ext4 512MB 250GB print quit - Format the new root partition:
sudo mkfs.ext4 /dev/sda2 - Run filesystem check and resize:
sudo e2fsck -f /dev/sda2 sudo resize2fs /dev/sda2
Step 3: Boot the Raspberry Pi 5
- Connect the 5TB HDD to your Raspberry Pi 5.
- Boot the Pi — it should use the resized 250GB root partition.
- Use
lsblkordf -hto confirm partitions.
Step 4: Format and Mount the Remaining ~4.2TB Space
- Back on the Pi (or another Linux system), open
partedagain:sudo parted /dev/sda - Create a new partition in remaining space:
mkpart primary ext4 250GB 100% print quit - Format the new partition:
sudo mkfs.ext4 /dev/sda3 - Create a mount point:
sudo mkdir -p /mnt/data - Get the UUID of the new partition:
sudo blkid /dev/sda3Example output:
/dev/sda3: UUID="abcd-1234" TYPE="ext4" - Edit
/etc/fstabto auto-mount on boot:sudo nano /etc/fstabAdd this line (replace UUID with yours):
UUID=abcd-1234 /mnt/data ext4 defaults 0 2 - Mount immediately and verify:
sudo mount -a df -h /mnt/data - (Optional) Set ownership:
sudo chown -R $USER:$USER /mnt/data sudo chmod 755 /mnt/data
✅ Result:
/dev/sda2is a 250GB root partition/dev/sda3is 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.