Foreword:
In the previous article " Modifying rootfs root file system image content ", a problem was overlooked, that is, after the root file system was mounted, the installation command reported insufficient space, and it was found to have occupied 100% after checking the occupancy.
However /dev/loop0
, the disk usage is only 857M, udev
but it takes up 7.8G, which is obviously unreasonable.
At first I thought that this problem could apt-get
be solved by modifying the download directory, but the actual measurement did not improve.
After research, it is found that the small disk space is related to the size of the root file system image, so simply expand the root file system image to completely solve this problem.
Root file system image expansion
command: e2fsck
,resize2fs
- Check if the system is working properly
e2fsck -p -f ubuntu.img
output
linuxroot: 24212/65536 files (0.6% non-contiguous), 219507/242275 blocks
- expansion
resize2fs ubuntu.img 2G
Expand the root file system to 2G, and output the following command after the expansion is successful
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on rk3568_ubuntu.img to 524288 (4k) blocks.
The filesystem on rk3568_ubuntu.img is now 524288 (4k) blocks long.
Summarize
At this point, the capacity expansion is completed, and then install the steps in " Modifying rootfs root file system image content
" and you can see it after mounting. The capacity expansion is completed, and the problem of 100% disk usage is solved.