I've got an 16GB SD card with Raspbian on it.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
There are (as usual) two partitions on the device. The boot partition and the root partition. The root partition uses almost all the space.
$ sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14.6 GiB, 15640559616 bytes, 30547968 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: 0x4ae87cfb
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 204800 729087 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 729088 30547967 29818880 14.2G 83 Linux
But the filesystem only uses something around 7GB of this partition:
$ df -T /
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/root ext4 7155064 5881840 893372 87% /
$ df -Th /
Filesystem Type Size Used Avail Use% Mounted on
/dev/root ext4 6.9G 5.7G 873M 87% /
The Problem
For some reason resize2fs denies to resize the filesystem on-line to the partitions size:
$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.43.3 (04-Sep-2016)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
resize2fs: Permission denied to resize filesystem
Any ideas, what the reason could be?