使用uboot当中的fdisk命令将硬盘份扩大后,如下所示:
root@iTOP4412-ubuntu-desktop:/media/U_eMMC# fdisk -l
Disk /dev/mmcblk0: 15.6 GB, 15634268160 bytes
255 heads, 63 sectors/track, 1900 cylinders, total 30535680 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Device Boot Start End Blocks Id System
/dev/mmcblk0p1 25837568 30515199 2338816 c W95 FAT32 (LBA)/dev/mmcblk0p2 32768 24608767 12288000 83 Linux/dev/mmcblk0p3 24608768 25223167 307200 83 Linux/dev/mmcblk0p4 25223168 25837567 307200 83 Linux
可以看到/dev/mmcblk0p2 有12G多的空间。但是Ubunutu系统运行起来后只有2.6G。
使用SD卡启动Ubuntu系统,将板卡上的eMMC挂载后,查看了一下:
root@iTOP4412-ubuntu-desktop:/media/U_eMMC/var/log/cups# df -hFilesystem Size Used Avail Use% Mounted on/dev/root 2.6G 1.5G 1.1G 59% /none 804M 4.0K 804M 1% /devnone 161M 680K 161M 1% /runnone 5.0M 0 5.0M 0% /run/locknone 804M 24K 804M 1% /run/shm/dev/mmcblk0p2 2.6G 1.5G 1.1G 59% /media/U_eMMC/dev/mmcblk0p2确实只有2.6G,不是磁盘空间上的12.3G。
怎么把2.6G的空间扩大呢? 用一个命令 resize2fs
root@iTOP4412-ubuntu-desktop:/media/U_eMMC/var/log/cups# resize2fs /dev/mmcblk0p2 10G
resize2fs 1.42 (29-Nov-2011)Filesystem at /dev/mmcblk0p2 is mounted on /media/U_eMMC; on-line resizing requiredold_desc_blocks = 1, new_desc_blocks = 1Performing an on-line resize of /dev/mmcblk0p2 to 2621440 (4k) blocks.The filesystem on /dev/mmcblk0p2 is now 2621440 blocks long.root@iTOP4412-ubuntu-desktop:/media/U_eMMC/var/log/cups#
root@iTOP4412-ubuntu-desktop:/media/U_eMMC/var/log/cups# df -hFilesystem Size Used Avail Use% Mounted on/dev/root 2.6G 1.5G 1.1G 59% /none 804M 4.0K 804M 1% /devnone 161M 680K 161M 1% /runnone 5.0M 0 5.0M 0% /run/locknone 804M 24K 804M 1% /run/shm/dev/mmcblk0p2 9.9G 1.5G 8.0G 16% /media/U_eMMCroot@iTOP4412-ubuntu-desktop:/media/U_eMMC/var/log/cups#扩大/dev/mmcblk0p2空间成功。
最后,重新从板卡上的/dev/mmcblk0p2启动Ubuntu系统,启动成功,查看剩余的空间,还有8G多。。完美。。