DietPi C2 | fdisk utility cannot create a partition table > 2 TB.

Created on 1 Sep 2016  路  10Comments  路  Source: MichaIng/DietPi

I have a 4 TB external hard drive hooked up to Odroid - C2. When formatted only 2 terabytes are available. Some research illuminates that technically the fdisk utility cannot create a partition table larger than 2 TB.

Technical details

The size of this disk is 3.7 TiB (4000787025920 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).

The solution is to use GNU parted command with GPT. It supports Intel EFI/GPT partition tables. You
must include GPT support in kernel in order to use GPT. If you don鈥檛 include GPT support in Linux kernelt, after rebooting the server, the file system will no longer be mountable or the GPT table will get corrupted.

In short you need to recompile the kernel. Set CONFIG_EFI_PARTITION to y to compile this feature. Then use a different utility besides fdisk.

Resources
http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html
GPT fdisk
http://www.rodsbooks.com/gdisk/

Enhancement Feature Request

Most helpful comment

I'll test as soon as my power supply comes in 2 to 4 days.

All 10 comments

I also have this problem with 5TB drive..any chance this enhancement getting into v.131?

@maximm07 @Zone22

I'll take a look in v131, but cant promise anything. Code should be easy, but, we may hit issues with kernels not having GPT enabled by default on various devices. Could be a nightmare.

RPi kernel GPT support = :u6307:

root@DietPi:~# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: SanDisk Cruzer Fit (scsi)
Disk /dev/sda: 8003MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name        Flags
 1      1049kB  8002MB  8001MB  ext4         DietPi_USB

:u6307: Odroid C2:

image

image

Reboot:

root@DietPi:~# df -h | grep usb
/dev/sda1       7.3G   17M  6.9G   1% /mnt/usb_1
root@DietPi:~# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: SanDisk Cruzer Fit (scsi)
Disk /dev/sda: 8003MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  8002MB  8001MB  ext4         primary

@Fourdee do you need this tested on the pine 64 and Odroid xu4?

@Zone22

do you need this tested on the pine 64 and Odroid xu4?

Would be great if you could. :+1: Needs lots of user testing and 500GB is the biggest drive I have lol :laughing:
Use blank USB drives with no personal data, might be a few bugs we need to iron out.

Its on testing branch at the moment, so you'll need this: https://github.com/Fourdee/DietPi/blob/master/TESTING-BRANCH.md

I'll test as soon as my power supply comes in 2 to 4 days.

I can test with C2 and 5TB WD drive. What kind of tests are required?

@maximm07

I can test with C2 and 5TB WD drive. What kind of tests are required?

Excellent :+1:

Please do the following to test your drive:

This test will format your drive, so don't continue if you have data on the drive you want to keep.

  • Unplug the USB drive from the system before hand.
  • Follow these steps to install a DietPi image using the testing branch: https://github.com/Fourdee/DietPi/blob/master/TESTING-BRANCH.md
  • Once the system is finished installing, run dietpi-drive_manager

    • Plug the drive in

    • Select refresh until the drive is listed at the top slot.

    • Select the Drive

    • Go to format

    • Select GPT and confirm format

  • Once the format is finished, check it shows 5TB~ free space.

I'll mark this as closed, successful in my testing.

@Zone22 @maximm07
Pending results from your tests, please reopen if you experience any issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fourdee picture Fourdee  路  3Comments

bhaveshgohel picture bhaveshgohel  路  3Comments

mok-liee picture mok-liee  路  3Comments

oshank picture oshank  路  3Comments

aesirteam picture aesirteam  路  3Comments