# Resize RPi Root Partition ``` sudo fdisk /dev/sda Command (m for help): d Partition number (1-4): 2 Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (1-4, default 2): 2 First sector (2048-16371711, default 2048): 122880 Last sector, +sectors or +size{K,M,G} (122880-16371711, default 16371711): Using default value 16371711 Command (m for help): p Disk /dev/sda: 8382 MB, 8382316544 bytes 64 heads, 32 sectors/track, 7994 cylinders, total 16371712 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 Disk identifier: 0x00017b69 Device Boot Start End Blocks Id System /dev/sda1 8192 122879 57344 c W95 FAT32 (LBA) /dev/sda2 122880 16371711 8124416 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: 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) Syncing disks. ``` _Reboot??? (I needed to do so, even after running `partprobe`)._ ``` sudo resize2fs /dev/sda2 resize2fs 1.42.5 (29-Jul-2012) Filesystem at /dev/sda2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/sda2 is now 2031104 blocks long. pi@raspberrypi ~ $ df -h Filesystem Size Used Avail Use% Mounted on rootfs 7.7G 1.6G 5.8G 22% / /dev/root 7.7G 1.6G 5.8G 22% / devtmpfs 124M 0 124M 0% /dev tmpfs 25M 180K 25M 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 50M 0 50M 0% /run/shm ```