8,367
edits
Changes
→Test the data compression function of ZFS
# Because the stored data is different, the disk space saved by compression will also be different, so we choose to compress relatively large plain text files for compression testing, and execute the following commands to pack the '''/var/log/''' and '''/etc/''' directories into a tarball
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''cd /pool1/'''
root@orangepi:/pool1$ '''sudo tar -cf text.tar /var/log/ /etc/'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Then the file size that can be seen through the '''ls -lh''' command and the space occupied in the ZFS pool are both '''27M'''</li></ol>
[[File:cm4-img388.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then we enable compression in the ZFS pool pool1</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''sudo zfs set compression=lz4 pool1'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then execute the following command again to package the '''/var/log/''' and '''/etc/''' directories into a tar package</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''sudo tar -cf text.tar /var/log/ /etc/'''
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>At this time, you can see that the size of the '''text.tar''' file is still 27M, but it only occupies 9.47M in the ZFS pool, indicating that the file is compressed</li></ol>
[[File:cm4-img389.png]]
</ol>
<span id="how-to-shut-down-and-restart-the-development-board"></span>
== How to shut down and restart the development board ==