range Pi 用户手册 深圳市迅龙软件有限公司版权所有
www.orangepi.cn 39 www.xunlong.tv
following method to prohibit
a. First burn the linux image to the TF card
b. Then insert the TF card into the Ubuntu PC (Windows does not work), the
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/27e62f92-8250-4ef1-83db-3d8f0c2e23db/
bin boot dev etc home lib lost+found media mnt opt proc root run
sbin selinux srv sys tmp usr 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/27e62f92-8250-4ef1-83db-3d8f0c2e23db
root@test:/media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db# cd root
root@test:/media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db/root# touch .no_rootfs_resize
root@test:/media/test/27e62f92-8250-4ef1-83db-3d8f0c2e23db/root# ls .no_rootfs*
.no_rootfs_resize
e. Then you can delete 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 automatic expansion of rootfs, you can see that the available
capacity of the TF card is only about 200M
root@orangepi:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 927M 0 927M 0% /dev
tmpfs 200M 5.6M 194M 3% /run
/dev/mmcblk0p1 1.5G 1.3G 196M 87% /
tmpfs 997M 0 997M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 997M 0 997M 0% /sys/fs/cgroup