Changes

Jump to: navigation, search

Orange Pi CM4

208 bytes added, 14:24, 19 September 2023
Test the data deduplication function of ZFS
# The data deduplication function of ZFS is disabled by default, we need to execute the following command to enable it
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo zfs set dedup=on pool1'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Then do a simple test, first enter pool1, and then execute the following command to generate a random file with a size of 1G</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''cd /pool1/'''
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.04367 s, 213 MB/s
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then use the following command to copy 1000 random files of size 1G</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''for ((i=0; i&lt;1000; i++)); do sudo cp test.1g $i.test.1g; done'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then use '''du -lh''' to see that there are currently 1002G of data in the pool, but in fact the size of the ZFS pool is only '''504GB''' (the total capacity of SSD+U disk), which cannot hold such a large amount of data</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''du -lh'''
1002G
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then use the '''zpool list''' command to see that only 1.01G is actually occupied, because these 1001 files are all duplicates, indicating that the data deduplication function is effective.</li></ol>
[[File:cm4-img387.png]]
</ol>
<span id="test-the-data-compression-function-of-zfs"></span>
<span id="test-the-data-compression-function-of-zfs"></span>
=== Test the data compression function of ZFS ===

Navigation menu