BEFORE resize.sh openshift@openshift:~/Documents/dev/64$ df Filesystem 1K-blocks Used Available Use% Mounted on udev 1942984 0 1942984 0% /dev tmpfs 392476 6572 385904 2% /run /dev/sda2 235701904 65388304 158317236 30% / tmpfs 1962372 395900 1566472 21% /dev/shm tmpfs 5120 4 5116 1% /run/lock tmpfs 1962372 0 1962372 0% /sys/fs/cgroup /dev/sda1 523248 3668 519580 1% /boot/efi cgmfs 100 0 100 0% /run/cgmanager/fs tmpfs 392476 72 392404 1% /run/user/1000 /dev/mmcblk0p2 3593172 713696 2677236 22% /media/openshift/rootfs /dev/mmcblk0p1 51082 12102 38980 24% /media/openshift/BOOT openshift@openshift:~/Documents/dev/64$ cd media/openshift/rootfs AFTER Resize.sh openshift@openshift:/media/openshift/rootfs/usr/local/sbin$ df Filesystem 1K-blocks Used Available Use% Mounted on udev 1942984 0 1942984 0% /dev tmpfs 392476 6572 385904 2% /run /dev/sda2 235701904 65388304 158317236 30% / tmpfs 1962372 395900 1566472 21% /dev/shm tmpfs 5120 4 5116 1% /run/lock tmpfs 1962372 0 1962372 0% /sys/fs/cgroup /dev/sda1 523248 3668 519580 1% /boot/efi cgmfs 100 0 100 0% /run/cgmanager/fs tmpfs 392476 72 392404 1% /run/user/1000 /dev/mmcblk0p2 30550772 716364 28540428 3% /media/openshift/rootfs /dev/mmcblk0p1 51082 12102 38980 24% /media/openshift/BOOT _______________________________________________________________________________ RAN-RESIZE-SCRIPT as follows openshift@openshift:/media/openshift/rootfs/usr/local/sbin$ sudo ./resize_rootfs.sh [sudo] password for openshift: + DEVICE=/dev/mmcblk0 + PART=2 + resize + fdisk -l /dev/mmcblk0 + grep /dev/mmcblk0p2 + awk {print $2} + start=143360 + echo 143360 143360 + set +e + fdisk /dev/mmcblk0 Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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: 0x808ac36f Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 40960 143359 102400 50M c W95 FAT32 (LBA) /dev/mmcblk0p2 143360 7577599 7434240 3.6G 83 Linux Command (m for help): Partition number (1,2, default 2): Partition 2 has been deleted. Command (m for help): Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): Partition number (2-4, default 2): First sector (2048-62333951, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (143360-62333951, default 62333951): Created a new partition 2 of type 'Linux' and of size 29.7 GiB. Command (m for help): 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). + set -e + partx -u /dev/mmcblk0 + resize2fs /dev/mmcblk0p2 resize2fs 1.42.13 (17-May-2015) Filesystem at /dev/mmcblk0p2 is mounted on /media/openshift/rootfs; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on /dev/mmcblk0p2 is now 7773824 (4k) blocks long. + echo Done! Done!