科普:BananaPi内mmcblk0是SD卡,mmcblk1是板载EMMC(板载有EMMC的板子)
  • 操作方式:

板子的命令终端或者远程SSH等方式

cat /sys/block/mmcblk0/mmcblk0p2/start
#查看SD卡的第二分区起始位置,记录下这个指令的返回值
sudo fdisk /dev/mmcblk0
#使用fdisk工具开始对分区进行修改

d 回车
2 回车
n 回车
p 回车
2 回车
刚才记录下来的数字 回车
再按一次回车
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).

如有如上结果则代表修改配置文件成功,但是提示我们还在使用老分区表,此时需要reboot一下系统

sudo reboot

重启后,使用resize2fs使用新分区表

sudo resize2fs /dev/mmcblk0p2

返回结果:

resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/mmcblk0p2 is now 7700608 (4k) blocks long.

有如上返回结果,则代表修改成功,然后使用df -h查看分区大小即可。

至此,大功告成~~

最后修改:2018 年 07 月 28 日
如果觉得我的文章对你有用,请随意赞赏