range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 42 www.xunlong.tv
Ubuntu PC will usually automatically mount the TF card partition. If the
automatic mounting is normal, use the ls command to see the following output,
the TF card partition name and the following command The names shown are
not necessarily the same, please modify according to the actual situation
test@test:~$ ls /media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975/
bin dev home lost+found mnt proc run selinux sys usr
boot etc lib media opt root sbin srv tmp var
c. Then switch the current user to root user in Ubuntu PC
test@test:~$ sudo -i
[sudo] test 的密码:
root@test:~#
d. Then enter the root directory of the Linux system in the TF card and create a
new file named .no_rootfs_resize
root@test:~# cd /media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975
root@test:/media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975# cd root
root@test:/media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975/root# touch .no_rootfs_resize
root@test:/media/test/49cc0cc0-8cb2-435d-bd35-4bbc6b7cd975/root# ls .no_rootfs*
.no_rootfs_resize
e. Then you can unmount the TF card, then unplug the TF and plug it into the
development board to start. When the linux system starts, when it detects that
there is a file .no_rootfs_resize in the /root directory, the rootfs will no longer be
automatically expanded
f. After disabling rootfs automatic expansion, after the first startup, you will no
longer see the warning that you need to restart to complete expansion after
logging in to the system through ssh or serial port. Even after restarting, you can
see that the available capacity of the TF card is only about 300M
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 370M 0 370M 0% /dev
tmpfs 101M 2.0M 99M 2% /run
/dev/mmcblk0p1 2.0G 1.6G 335M 84% /
tmpfs 501M 140K 501M 1% /dev/shm