I have expanded the root partition on my Banana Pi using the following script:
fdisk /dev/mmcblk0 <<EOF
p
d
$PART_NUM
n
p
$PART_NUM
$PART_START
p
w
EOF
After a reboot I got a 32 GB partition according to fdisk
:
root@bananapi /usr/local/bin # fdisk /dev/mmcblk0
Command (m for help): p
Disk /dev/mmcblk0: 31.9 GB, 31914983424 bytes
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 43007 20480 83 Linux
/dev/mmcblk0p2 43008 62333951 31145472 83 Linux
However, df
shows the old 8 GB partition, and I didn't get any extra space:
root@bananapi /usr/local/bin # df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 8254904 5702140 2133448 73% /
/dev/root 8254904 5702140 2133448 73% /
devtmpfs 447624 0 447624 0% /dev
tmpfs 89548 292 89256 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 179080 0 179080 0% /run/shm
What I have tried:
Basically, I tried every approach from this question except the 3-rd one which requires a physical keyboard to be present. However, I don't seem to be able to force fsck on reboot:
root@bananapi /usr/local/bin # dmesg |grep fsck
[ 4.796771] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs,
running e2fsck is recommended
Is there anything else I could try, besides the obvious solution of getting a card reader and fixing the partition on another computer? Is there a reason why fsck
wont start at boot time?
Feel free to migrate my question to http://raspberrypi.stackexchange.com, however, AFAIK they don't like exotic fruit up there.