My way:
List your old partitiontable:[minepeon@Green-Pie ~]$ sudo fdisk -l
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00057540
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 186367 92160 c W95 FAT32 (LBA)
/dev/mmcblk0p2 186368 3667967 1740800 5 Extended
/dev/mmcblk0p5 188416 3667967 1739776 83 Linux
You need to delete first p5 and than p2
if done recreate themsudo fdisk /dev/mmcblk0
- press d for delete p5 and p2
- press n for new partition
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): e
Partition number (2-4, default 2):
First sector (186368-31116287, default 186368):
Last sector, +sectors or +size{K,M,G,T,P} (186368-31116287, default 31116287):
Created a new partition 2 of type 'Extended' and of size 14.8 GiB.
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): e
Partition number (2-4, default 2):
First sector (186368-31116287, default 186368):
Last sector, +sectors or +size{K,M,G,T,P} (186368-31116287, default 31116287):
Created a new partition 2 of type 'Extended' and of size 14.8 GiB.
Command (m for help): n
Partition type:
p primary (1 primary, 1 extended, 2 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (188416-31116287, default 188416):
Last sector, +sectors or +size{K,M,G,T,P} (188416-31116287, default 31116287):
Created a new partition 5 of type 'Linux' and of size 14.8 GiB.
Command (m for help): p
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00057540
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 186367 92160 c W95 FAT32 (LBA)
/dev/mmcblk0p2 186368 31116287 15464960 5 Extended
/dev/mmcblk0p5 188416 31116287 15463936 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
As written you need to rebootresize your fssudo resize2fs /dev/mmcblk0p5
[minepeon@Green-Pie ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 1.1G 13G 8% /
devtmpfs 210M 0 210M 0% /dev
tmpfs 232M 0 232M 0% /dev/shm
tmpfs 232M 1.2M 231M 1% /run
tmpfs 232M 0 232M 0% /sys/fs/cgroup
tmpfs 232M 0 232M 0% /tmp
/dev/mmcblk0p1 90M 24M 66M 27% /boot