4

I have a external storage that I would like to partition. enter image description here

It has 1 TB of space.

When I try to partition it using parted I get the following error,

p@p-ubuntu:~$ sudo parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdd                                                  
Using /dev/sdd
(parted) mkpart                                                           
File system type?  [ext2]? ext4                                           
Start? 1                                                                  
End? 10000
Error: Too many primary partitions.

print stmt

(parted) print
Model: Seagate BUP Slim Mac SL (scsi)
Disk /dev/sdd: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

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

Delete partition that is failing:

(parted) select /dev/sdd
Using /dev/sdd
(parted) print                                                            
Model: Seagate BUP Slim Mac SL (scsi)
Disk /dev/sdd: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

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

(parted) rm 1                                                             
(parted) print                                                            
Model: Seagate BUP Slim Mac SL (scsi)
Disk /dev/sdd: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

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

1 Answers1

3

Oldfred's comment contains all the necessary steps. What happened is that a filesystem was put directly on the sdd instead of on a partition, so sdd really doesn't have any partition table -- it gets mounted like a file with the loop option. Backup whatever you want to save on the disk, because putting a partition table on it will make what's there unreadable. Then ensure the device is unmounted, and run your partition tool to first put on a partition table (your choice DOS or GPT -- see oldfred's link to decide). Then you can make your partitions.

If you choose GPT, you can make however many you want (well up to some limit like 128 by default). If you chose DOS, then you can make up to 4 primary partitions. For more than four, you will need to make one primary partition an extended partition, and then you can make logical partitions within the extended partition. For example, you make 4 partitions of type 83 (linux), of 250G each, filling up the disk. Save the partition table. Now, you need to make filesystems on the new, empty partitions with mkfs, for example:

sudo mkfs.ext4 /dev/sdd1  

Now the new partitions may be mounted, and files copied onto them.

ubfan1
  • 19,049