Score:0

Partitioning a USB drive with Gparted - Too many Primary partitions

kp flag

I have an external USB drive (not bootable) with an ext4 filesystem on it. parted -l says "Partition Table: loop" (full output at end of post).

I want to shrink that partition and add an NTFS partition that Windows can recognize to store a backup.

I boot Ubuntu 22.04 Live from a DVD, and run Gparted. I tell it to shrink the ext4 filesystem and then create a new NTFS partition.

The fs shrink operation succeeds, but then creating a new partition fails with "Too many Primary partitions". I'm not sure how to proceed.

As best I can tell, there is no partition table. Is there a way to create one without loss of data?

Any suggestions?

% sudo file -s /dev/sda
file -s /dev/sda
/dev/sda: Linux rev 1.0 ext4 filesystem data, UUID=2311d0f0-6849-4175-81a3-ff9d24f0e183 (extents) (large files) (huge files)
% sudo gparted -l
Model: TOSHIBA External USB 3.0 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  Flags
 1      0.00B  1000GB  1000GB  ext4


Model: Generic Flash Disk (scsi)
Disk /dev/sdb: 62.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                 Flags
 1      1049kB  62.9GB  62.9GB  fat32        Main Data Partition  msftdata
mook765 avatar
cn flag
You need to create a partition table first and then create the partitions you need. Note that creating a partition table will destroy the existing filesystem, so backup your data first. Currently you use a filesystem spanning over the whole device, no partition table exist, thus you cannot add partitions.
BobDoolittle avatar
kp flag
@mook765 Thanks. Unfortunately that ship has sailed for this disk. Isn't this exactly the sort of thing gparted is designed to do? Move data around so that we can do things like add partition tables and the like?
mook765 avatar
cn flag
gparted is the tool to handle that, but you cannot create a partition table without destroying the existent filesystem, that's why you have to backup first if there is any data you intend to keep. Usually you should have a backup anyway (working without backups is a stupid thing). Especially if you are going to edit partitions. You cannot move this partition, it is not a partition what you have!!!
BobDoolittle avatar
kp flag
Understood. Unfortunately, this *is* a backup disk (for another disk I no longer have), and half the disk is empty but I want to use it for more backups. I guess I will have to find another disk to backup my backup lol. Then I can put a proper partition onto the disk. Thanks.
I sit in a Tesla and translated this thread with Ai:

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.