RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Booting Raspbian on large (>2TB) USB devices : Made Easy

Fri Mar 27, 2020 2:02 am

GPT partition tables are necessary on devices whose size is over 2TB.

boot-gpt converts an MBR partition table on a USB device to a GPT partition table, as well as adding or removing a Hybrid MBR (required for direct booting on a Raspberry Pi 3), expanding the ROOT partition, enabling booting via an SD card, and enabling SSH on the next boot. boot-gpt converts any size USB device, including SD cards placed in a USB adapter (an SD card with a GPT partition table also requires a Hybrid MBR for booting).

!!! DO NOT PROCEED UNLESS YOU HAVE A RELIABLE BACKUP OF THE DEVICE BEING CONVERTED !!!
!!! INITIAL TESTING SHOULD BE PERFORMED ON A USB DEVICE CONTAINING EXPENDABLE DATA !!!

Usage syntax is:

boot-gpt /dev/sdX

boot-gpt will prompt for permission to perform the following optional functions:

1. Use Hybrid MBR (required for direct booting on a Raspberry Pi 3)

2. Expand ROOT partition to use all available space

3. Set SD card to boot the USB device

4. Enable SSH on next boot
Attachments
boot-gpt.zip
(2.32 KiB) Downloaded 8 times
Last edited by RonR on Sat Mar 28, 2020 4:44 am, edited 1 time in total.

jameshilliard
Posts: 9
Joined: Thu Aug 01, 2019 12:50 am

Re: Booting Raspbian on large (>2TB) USB devices : Made Easy

Fri Mar 27, 2020 3:38 am

FYI you should probably be using sgdisk(the scriptable gdisk interface essentially) and sfdisk(the scriptable fdisk interface) rather than gdisk and fdisk for scripting.
Buildroot developer

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting Raspbian on large (>2TB) USB devices : Made Easy

Sat Mar 28, 2020 4:51 am

boot-gpt has been updated to make the use of a Hybrid MBR optional.

A Hybrid MBR should be used only when necessary: Hybrid MBRs: The Good, the Bad, and the So Ugly You'll Tear Your Eyes Out

User avatar
Rukbat
Posts: 18
Joined: Fri Nov 11, 2011 3:59 pm

Re: Booting Raspbian on large (>2TB) USB devices : Made Easy

Sun Mar 29, 2020 11:13 pm

RonR wrote:
Sat Mar 28, 2020 4:51 am
and the So Ugly You'll Tear Your Eyes Out
You got that one right. :D But I like learning, so I'm going to read the whole thing (then bandage my eyes to keep the blood from dripping on my shirt).

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting Raspbian on large (>2TB) USB devices : Made Easy

Sun Mar 29, 2020 11:59 pm

Rukbat wrote:
Sun Mar 29, 2020 11:13 pm
RonR wrote:
Sat Mar 28, 2020 4:51 am
and the So Ugly You'll Tear Your Eyes Out
You got that one right. :D But I like learning, so I'm going to read the whole thing (then bandage my eyes to keep the blood from dripping on my shirt).

Fortunately, Hybrid MBR's should only be needed in the case of direct booting 2TB+ drives on a Raspberry Pi 3 (booting via an SD card is a much more reliable method) and 2TB+ SD cards (that don't currently exist and will probably require a second mortgage on your home to buy one).

I hope to release updates soon to usb-boot and image-utils that also create and handle mass storage devices over 2TB using standard (non-Hybrid) GPT partition tables.

Return to “Advanced users”