Using unallocated space on a PiDrive?

OK - I’ve got my PiDrive set up and it’s working fine, but there is a lot of unused space on it. I just installed a couple of 16G Raspian Lite work spaces and fdisk is showing the following :

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 2121093 2119046 1G e W95 FAT16 (LBA)
/dev/sda2 2121094 125067263 122946170 58.6G 5 Extended
/dev/sda5 2121728 2187261 65534 32M 83 Linux
/dev/sda6 2187264 43147261 40959998 19.5G 83 Linux
/dev/sda7 43147264 59531261 16383998 7.8G 83 Linux
/dev/sda8 59531264 92299261 32767998 15.6G 83 Linux
/dev/sda9 92299264 125067263 32768000 15.6G 83 Linux

sda7 to 9 are the partitions that I created.

Can I manually carve up that sda2? I would like a proper swap partition and another to take a postgres database that I will be using in my project.

TIA

Martin

sda2 is already carved up.

As the partition scheme was first designed, a hard drive can have only four partitions, numbered 1 to 4. When that proved to be inadequate, a scheme was devised to allow one of the four primary partitions to become an “extended” partition which can then be subdivided into "logical"partitions.

Your drive has a primary partition, sda1; and an extended partition, sda2. sda2 is subdivided into five logical partitions, sda5, sda6, sda7, sda8, and sda9. Note that partition numbers 3 and 4 are skipped in your partition table.

If you add up the sizes of all the logical partitions, you’ll find they add up to the size of the extended partition.

The extra space on the drive isn’t allocated to any partitions yet.

Ah, ok - thanks. I did look inside SDA2 and it seemed to contain two sub-partitions - sda2p1 and sda2p2 - but those sub-partitions do not appear in /dev and hence cannot be mounted. I will research in more detail - are you saying that I’m free to carve this up as I please?

I really don’t know how berryboot manages the disk space, so I can’t give you anything approaching a definitive answer. I am assuming you’re using berryboot. In any case, IF you’re comfortable with working with fdisk/parted/etc, try setting up a swap partition and see how it goes.

I’m not using berryboot - just the standard software that came with the PiDrive Foundation Edition. I did wonder about berryboot after I had set it all up, but could not see any obvious advantage and didn’t want to rebuild the installation.

I’m not familiar with Foundation Edition (yet, heh) and how it handles the drives. How big is your drive? Adding up the partitions, I come up with ~60GB. If it’s the 64GB USB stick, there may not really be any usable extra space.

Solved now - thanks to your help! The drive is a 250GB HDD and the setup procedures had just used about 60GB. I resized the extended partition up to about 4GB under the disk size, confirmed that it still booted correctly, then created a swap partition that fills the remaining space. Then reconfigured the Raspian images to use that swap partition rather than creating a swap file on boot and it’s all working fine and I have plenty of free space in the extended partition to create one or more dedicated partitions for my database.