Score:0

Can we use fdisk to partition a disk bigger than 2 TB without recompiling the kernel?

cg flag

Here is my problem.

Our operating system is Debian 11. The main hard disk is doing fine. I have a 6TB external volume. If I choose to use parted to format this disk it will entail recompiling the Debian 11 kernel with CONFIG_EFI_PARTITION enabled as mentioned here

We are not allowed to recompile the kernel.

My query is : May I use fdisk to parition the 6TB disk into 3 2TB partitions ? Will that still need recompilation of the kernel?

Jaromanda X avatar
ru flag
FYI: `grep CONFIG_EFI_PARTITION /boot/config-$(uname -r)` will let you know if you need to recompile the kernel
user2338823 avatar
cg flag
When I ran the above, it returned : `CONFIG_EFI_PARTITION=y` Does that mean it has already been enabled?
Jaromanda X avatar
ru flag
"y" means "yes" ... so, chances are good
Score:2
in flag

You have misunderstood that article (and it contains some false information).

The limit about the 2TB comes from the partition table, not the Linux kernel.

msdos partition tables allow a maximum of 2 TB. Recompiling the kernel will not change that. To use larger partitions you must use GPT partition tables.

15 years ago, when it was not widely used, you had to recompile the kernel to activate GPT support. Nowadays every Linux distribution supports it out of the box, no recompilation necessary.

$ sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
The size of this disk is 6 TiB (6597069766656 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).

Created a new DOS disklabel with disk identifier 0xfe370791.

Command (m for help): g
Created a new GPT disklabel (GUID: DBB9DB85-EC26-7C40-9A4F-3C3989F7F4D0).

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-12884901854, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-12884901854, default 12884901854):

Created a new partition 1 of type 'Linux filesystem' and of size 6 TiB.
user2338823 avatar
cg flag
The above mentioned link said : `You must include GPT support in the kernel to use GPT. ` That is why I wanted to use MBR. Do I misunderstand?
in flag
Chances that your kernel does not already include it are next to zero. Just try it.
in flag
The article you linked also says: `Please note that almost all new kernel and latest distro supports GPT`
in flag
There is a comment from 2009 (!) on that article: `Since recent versions of Ubuntu and Debian have CONFIG_EFI_PARTITION compiled into their stock kernels, you should remove the part about having to recompile the kernel so that readers don’t needlessly recompile their kernels.`
user2338823 avatar
cg flag
If GPT support does not need recompiling the kernel ***and*** is going to be used with fdisk also, can I not simply use `parted` to make a 6TB partition directly ? Would that work without recompiliing the kernel ?
in flag
Of course. It doesn't matter what tool you use.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.