Red Hat Training
A Red Hat training course is available for RHEL 8
3.5. 测试 VDO 测试卷
此流程测试 VDO 测试卷的读取和写入是否正常工作。
先决条件
- 挂载新创建的 VDO 测试卷。详情请查看 第 3.4 节 “创建 VDO 测试卷”。
流程
将随机数据的 32 GiB 写入 VDO 卷:
$ dd if=/dev/urandom of=/mnt/vdo-test/testfile bs=4096 count=8388608
从 VDO 卷中读取数据并将其写入另一个卷:
$ dd if=/mnt/vdo-test/testfile of=another-location/testfile bs=4096
- 使用您在 VDO 测试卷上有写权限的任何目录替换 another-location。例如,您可以使用您的主目录。
比较这两个文件:
$ diff --report-identical-files /mnt/vdo-test/testfile another-location/testfile
命令应该报告这些文件是相同的。
将文件复制到 VDO 卷中的新位置:
$ dd if=another-location/testfile of=/mnt/vdo-test/testfile2 bs=4096
将第三个文件与第二个文件进行比较:
$ diff --report-identical-files /mnt/vdo-test/testfile2 another-location/testfile
命令应该报告这些文件是相同的。
清理步骤
- 删除 VDO 测试卷,如 第 3.6 节 “清理 VDO 测试卷” 中所述。