Isilon:如何使用 dd 命令创建测试文件
Summary: 本文档介绍如何使用“dd”Direct Disk 实用程序创建测试文件。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
简介
如何使用 UNIX“direct disk”实用程序的“dd”命令快速创建特定大小的测试文件。有关 dd 命令及其选项的详细信息,请从命令行运行以下命令以查看其手册:
man dd
流程
- 在群集中的任意节点上打开 SSH 连接,并使用“root”帐户登录。
- 通过运行以下命令创建一个 100MB 零补充文件。这对于创建内容不重要的大文件非常有用。
dd if=/dev/zero of=zero-padded.bin bs=1024 count=102400
- 通过运行以下命令,创建一个 100MB 的随机数据文件。这对于创建数据不同的多个文件很有用(例如,在测试检查文件差异的实用程序时):
dd if=/dev/urandom of=random-data.bin bs=104857600 count=1
- 通过运行以下命令,创建一个不占用磁盘空间的 100MB 稀疏文件。这对于调整二进制图像文件的大小而不覆盖它们非常有用。
dd if=/dev/zero of=sparse-file.bin bs=1 count=0 seek=104857600
然后验证稀疏文件的实际大小和表观大小。
- 通过运行以下命令验证稀疏文件的实际大小:
du -A sparse-file.bin
将显示类似于以下内容的输出,指示该文件使用磁盘上的 0MB 空间:
0 sparse-file.bin - 通过运行以下命令验证稀疏文件的表观大小:
ls -lh sparse-file.bin
将显示类似如下的输出,表明文件似乎占用了磁盘上的 100MB 空间:-rw------- 1 root wheel 100M Jul 1 20:35 sparse-file.bin
- 通过运行以下命令验证稀疏文件的实际大小:
Additional Information
必要的工具或技能
执行本文中的过程要求您熟悉 OneFS作系统和 UNIX 命令,并能从命令行界面轻松运行命令。
Affected Products
IsilonArticle Properties
Article Number: 000022920
Article Type: How To
Last Modified: 02 July 2025
Version: 4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.