8,367
edits
Changes
→The first startup will automatically expand the capacity of the rootfs partition in the TF card
=== The first startup will automatically expand the capacity of the rootfs partition in the TF card ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that this step does not affect the automatic expansion of the Linux system of the development board. Here I just want to explain how to check the capacity of the TF card after burning the Linux image on the TF card.'''</big>|}
<ol style="list-style-type: lower-alpha;">
<li>First install the gparted software on the Ubuntu computer</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''sudo apt install -y gparted'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then open gparted</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''sudo gparted'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>After opening gparted, you can select the TF card in the upper right corner, and then you can see the usage of the TF card capacity</li></ol>
[[File:media/image91.png|575x210px]]
</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>The figure above shows the situation of the TF card after burning the Linux desktop version system. It can be seen that although the total capacity of the TF card is 16GB (displayed as 14.84GiB in GParted), the rootfs partition (/dev/ sdc1) actually allocated only 4.05GiB, leaving 10.79GiB unallocated</li></ol>
</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>Then you can insert the TF card that has burned the Linux system into the development board to start. When the TF card starts the Linux system for the first time, it will call the '''orangepi-resize-filesystem''' script automatically through the systemd service '''orangepi-resize-filesystem.service''' The expansion of the rootfs partition, '''<span style="color:#FF0000">so there is no need to manually expand the capacity</span>'''</p></li><li><p>After logging in to the system, you can use the '''df -h''' command to check the size of the rootfs. If it is consistent with the actual capacity of the TF card, it means that the automatic expansion is running correctly.</p></li></ol> orangepi@orangepi:~$ '''df -h''' Filesystem Size Used Avail Use% Mounted on udev 430M 0 430M 0% /dev tmpfs 100M 5.6M 95M 6% /run '''/dev/mmcblk0p1 15G 915M 14G 7% /''' tmpfs 500M 0 500M 0% /dev/shm
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''df -h'''</p>
<span style="margin-right: 80px;">Filesystem </span><span style="margin-right: 50px;">Size </span><span style="margin-right: 30px;">Used </span><span style="margin-right: 30px;">Avail</span><span style="margin-right: 50px;">Use% Mounted on</span><br>
<span style="margin-right: 110px;">udev</span><span style="margin-right: 60px;">430M</span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">430M </span><span style="margin-right: 90px;">0% /dev</span><br>
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">100M </span><span style="margin-right: 30px;">5.6M </span><span style="margin-right: 70px;">95M </span><span style="margin-right: 90px;">6% /run</span><br>
<span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''15G'''</span><span style="margin-right: 35px;color:#FF0000">'''915M'''</span><span style="margin-right: 80px;color:#FF0000">'''14G'''</span><span style="margin-right: 90px;color:#FF0000">'''7% /'''</span><br>
<span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 60px;">500M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 50px;">500M </span><span style="margin-right: 90px;">0% /dev/shm</span><br>
|}
</li></ol>
<ol start="4" style="list-style-type: decimal;">
<li>After starting the Linux system for the first time, we can also remove the TF card from the development board and reinsert it into the '''Ubuntu computer''', and then use gparted to check the status of the TF card again, as shown in the figure below, the rootfs partition (/dev/ The capacity of sdc1) has been expanded to 14.69GiB</li></ol>
[[File:media/image92.png|575x211px]]
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''It should be noted that the Linux system has only one partition in ext4 format, and does not use a separate BOOT partition to store files such as the kernel image, so there is no problem of expanding the BOOT partition.'''</big>|}</ol><span id="the-method-of-prohibiting-automatic-expansion-of-the-capacity-of-the-rootfs-partition-in-the-tf-card"></span>
=== The method of prohibiting automatic expansion of the capacity of the rootfs partition in the TF card ===