Open main menu

Wiki-Orange Pi β

Changes

Orange Pi Zero 3

1,689 bytes added, 20:00, 10 July 2023
The method of manually expanding the capacity of the rootfs partition in the TF card
=== The method of manually expanding the capacity of the rootfs partition in the TF card ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''If the total capacity of the TF card is large, such as 128GB, you do not want the rootfs partition of the Linux system to use all the capacity of the TF card, but only want to allocate a part of the capacity, such as 16GB, to the Linux system, and then the remaining capacity of the TF card can be used for other use. Then you can use the content introduced in this section to manually expand the capacity of the rootfs partition in TF.'''</big>|}
# First burn the linux image of the development board to the TF card on the '''<span style="color:#FF0000">Ubuntu computer</span>''' (Windows not available), '''<span style="color:#FF0000">and then re-plug and insert the TF card</span>'''
# Then the Ubuntu computer will automatically mount the partition of the TF card. If the automatic mounting is normal, use the ls command to see the following output
::{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''ls /media/test/opi_root/'''</p> <p>bin &nbsp;&nbsp; boot &nbsp;&nbsp; dev &nbsp;&nbsp; etc &nbsp;&nbsp; home &nbsp;&nbsp; lib &nbsp;&nbsp; lost+found &nbsp;&nbsp; media &nbsp;&nbsp; mnt &nbsp;&nbsp; opt &nbsp;&nbsp; proc &nbsp;&nbsp; root &nbsp;&nbsp; run <br> sbin &nbsp;&nbsp; selinux &nbsp;&nbsp; srv &nbsp;&nbsp; sys &nbsp;&nbsp; tmp &nbsp;&nbsp; usr &nbsp;&nbsp; var</p>|}
<ol start="3" style="list-style-type: decimal;">
<li>Then switch the current user to the root user on the Ubuntu computer</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''sudo -i'''
[sudo] test 的密码:
root@test:~'''<span style="color:#FF0000">#</span>'''|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then enter the root directory of the linux system in the TF card and create a new file named '''.no_rootfs_resize'''</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
root@test:~# '''cd /media/test/opi_root/'''
'''.no_rootfs_resize'''
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then 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="6" style="list-style-type: decimal;">
<li>Then open gparted</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''sudo gparted'''
|}</ol>
<ol start="7" style="list-style-type: decimal;">
<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. The figure below 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) Only 4.05GiB were actually allocated, leaving 10.79GiB unallocated</li></ol>
[[File:media/image91.png|575x210px]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the rootfs partition (/dev/sdc1)</li></ol>
[[File:media/image93.png|575x211px]]
</ol>
<ol start="9" style="list-style-type: decimal;">
<li>Click the right mouse button again to see the operation options shown in the figure below. If the TF card has been mounted, first you need to Umount the rootfs partition of the TF card</li></ol>
[[File:media/image94.png|436x298px]]
</ol>
<ol start="10" style="list-style-type: decimal;">
<li>Then select the rootfs partition again, click the right mouse button, and select '''Resize/Move''' to start expanding the size of the rootfs partition</li></ol>
[[File:media/image95.png|444x302px]]
</ol>
<ol start="11" style="list-style-type: decimal;">
<li>After the '''Resize/Move''' option is turned on, the following setting interface will pop up</li></ol>
[[File:media/image96.png|315x193px]]
</ol>
<ol start="12" style="list-style-type: decimal;">
<li>Then you can directly drag the location shown in the figure below to set the size of the capacity, or you can set the size of the rootfs partition by setting the number in '''New sieze(MiB)'''</li></ol>
[[File:media/image97.png|320x191px]]
</ol>
<ol start="13" style="list-style-type: decimal;">
<li>After setting the capacity, click '''Resize/Move''' in the lower right corner</li></ol>
[[File:media/image98.png|327x196px]]
</ol>
<ol start="14" style="list-style-type: decimal;">
<li>14) After confirming that it is correct, click the green button shown in the figure below'''√'''</li></ol>
[[File:media/image99.png|392x270px]]
</ol>
<ol start="15" style="list-style-type: decimal;">
<li>15) Then select'''Apply''', It will officially start to expand the capacity of the rootfs partition</li></ol>
[[File:media/image100.png|399x116px]]
</ol>
<ol start="16" style="list-style-type: decimal;">
<li>After the expansion is completed, click '''Close''' to close</li></ol>
[[File:media/image101.png|399x172px]]
</ol>
<ol start="17" style="list-style-type: decimal;">
<li>Then you can pull out the TF card, insert it into the development board and start it up. After entering the Linux system of the development board, if you can see that the size of the rootfs partition is the same as the size set before, it means manual Expansion succeeded</li></ol>
{| class="wikitable" style="width:800px;"|-|<p>root@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;">925M </span><span style="margin-right: 50px;">0</span><span style="margin-right: 70px;">925M </span><span style="margin-right: 90px;">0% /dev</span><br><span style="margin-right: 100px;">tmpfs </span><span style="margin-right: 50px;">199M </span><span style="margin-right: 30px;">3.2M </span><span style="margin-right: 70px;">196M </span><span style="margin-right: 90px;">2% /run</span><br><span style="margin-right: 25px;color:#FF0000">'''/dev/mmcblk0p1'''</span><span style="margin-right: 50px;color:#FF0000">'''7.7G '''</span><span style="margin-right: 35px;color:#FF0000">'''3.2G '''</span><span style="margin-right: 80px;color:#FF0000">'''4.4G '''</span><span style="margin-right: 90px;color:#FF0000">'''42% /'''</span><br>|}</ol><span id="how-to-reduce-the-capacity-of-the-rootfs-partition-in-the-tf-card"></span>
udev 925M 0 925M 0% /dev
 
tmpfs 199M 3.2M 196M 2% /run
 
'''/dev/mmcblk0p1 7.7G 3.2G 4.4G 42% /'''
 
<span id="how-to-reduce-the-capacity-of-the-rootfs-partition-in-the-tf-card"></span>
=== How to reduce the capacity of the rootfs partition in the TF card ===