需要一个好的文件创建工具

发布于 2024-08-09 14:00:43 字数 120 浏览 4 评论 0原文

我想创建一个测试设置,该设置应该有 4tb 的高密度文件系统。 我尝试过一些工具(wst),但它们在一段时间后崩溃了。经过两天的努力,我什至无法填满 20% 的磁盘空间。我需要在 Windows 上使用这个工具。有什么建议吗?

I want to create a test setup which should have a 4tb of High density filesystem.
I've tried some tools(wst) but they are crashing after sometime. After struggling for two days im able to fill not even 20% of disk space. I need this tool on windows. Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

假扮的天使 2024-08-16 14:00:43

您可以使用磁盘工具。我曾经用它对可能有坏扇区的硬盘进行压力测试。

You can use Disk Tools. I used it once for stress testing a hard disk which presumably had bad sectors.

友欢 2024-08-16 14:00:43

您可以:

  1. 在目录中创建一个小文件,
  2. 复制粘贴目录本身,
  3. 将重复的目录放入原始目录中,

然后重复步骤 2 和 3,直到达到您的需要(大约 30 次,具体取决于初始目录的大小)文件)。

You can:

  1. create a small file in a directory,
  2. copy-paste the directory itself,
  3. put the duplicate directory into the original one,

and repeat steps 2 and 3 until you reach your need (about thirty times, depending on the size of the initial file).

飘落散花 2024-08-16 14:00:43

如果您只想创建许多文件,则可以使用此批处理脚本来尽可能多次地复制给定文件。没有停止条件,但我想计数器变量将在大约 2^31 后溢出。

使用 extreme_copy my_test_file.txt 等脚本,其中测试文件可以具有您想要的任何大小。

这是脚本:

@ECHO OFF

IF "%1"=="" GOTO END
IF NOT EXIST "%1" GOTO END

REM copy loop
SET FILE_NUMBER=1

:COPY

copy "%1" "%~dpn1_%FILE_NUMBER%%~x1" > nul

REM show some progress
SET /A SHOW_ITERATIONS="%FILE_NUMBER% %% 1000"
IF /I %SHOW_ITERATIONS%==0 ECHO %FILE_NUMBER% files created...

SET /A FILE_NUMBER=%FILE_NUMBER% + 1

GOTO COPY

:END

If all you want is simply to create many many files, you can use this batch script that copies a given file for as many times as possible. There is no stop condition, but I suppose the counter variable will overflow after about 2^31.

Use the script like extreme_copy my_test_file.txt where the test file can have any size you want.

This is the script:

@ECHO OFF

IF "%1"=="" GOTO END
IF NOT EXIST "%1" GOTO END

REM copy loop
SET FILE_NUMBER=1

:COPY

copy "%1" "%~dpn1_%FILE_NUMBER%%~x1" > nul

REM show some progress
SET /A SHOW_ITERATIONS="%FILE_NUMBER% %% 1000"
IF /I %SHOW_ITERATIONS%==0 ECHO %FILE_NUMBER% files created...

SET /A FILE_NUMBER=%FILE_NUMBER% + 1

GOTO COPY

:END
陌伤浅笑 2024-08-16 14:00:43

我制作了一个 C# 控制台应用程序来创建随机文件,随机内容从 2kb 到 10kb。
编译它(这是 .net 2,但我确信它可以与任何 .NET 版本一起编译)
像这样运行:
您的Exe d:
YourExe d:\temp2

半免责声明,如果您运行应用程序足够长的时间,它可能会出现 stackoverflow,只需重新启动即可如果发生这种情况。文件名是随机的,因此不会产生任何问题

class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 1 || !Directory.Exists(args[0]))
            {
                Console.WriteLine("Arg should be: C:\\ (or your drive letter)");
                return;
            }

            const int RandomFilesToCreate = int.MaxValue;
            for (int i = 0; i < RandomFilesToCreate; i++)
            {
                string FileName = CreateRandomFile(args[0]);
                Console.WriteLine(i + ") Wrote file " + FileName);
            }
        }

        static Random gRan = new Random();
        static string CreateRandomFile(string Path)
        {
            byte[] FileContent = new byte[gRan.Next(2,10) * 1024] ;

            // generate a random filename
            string FileName = Path + "\\TempF_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + ".tmp";
            while(File.Exists(FileName))
                FileName = Path + "\\TempF_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + ".tmp";

            // fill with random bytes.
            gRan.NextBytes(FileContent);

            // Write to disk
            File.WriteAllBytes(FileName, FileContent);
            return FileName;
        }
    }

I made a C# console app do create random files, with random content from 2kb to 10kb.
Compile it ( this is .net 2, but im sure it will compile with any .NET version )
Run like this:
YourExe d:
YourExe d:\temp2

Semi disclaimer, if you run the app long enough it might get a stackoverflow, just start it again if that happens. File names are random, so it will not create any issues

class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 1 || !Directory.Exists(args[0]))
            {
                Console.WriteLine("Arg should be: C:\\ (or your drive letter)");
                return;
            }

            const int RandomFilesToCreate = int.MaxValue;
            for (int i = 0; i < RandomFilesToCreate; i++)
            {
                string FileName = CreateRandomFile(args[0]);
                Console.WriteLine(i + ") Wrote file " + FileName);
            }
        }

        static Random gRan = new Random();
        static string CreateRandomFile(string Path)
        {
            byte[] FileContent = new byte[gRan.Next(2,10) * 1024] ;

            // generate a random filename
            string FileName = Path + "\\TempF_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + ".tmp";
            while(File.Exists(FileName))
                FileName = Path + "\\TempF_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + "_" + gRan.Next(0, int.MaxValue) + ".tmp";

            // fill with random bytes.
            gRan.NextBytes(FileContent);

            // Write to disk
            File.WriteAllBytes(FileName, FileContent);
            return FileName;
        }
    }
渔村楼浪 2024-08-16 14:00:43

我无法真正将“Windows”和“4TB 数据”这两个术语在我的脑海中匹配起来。 Windows 是为会使用一点 Word 并使用 IE 浏览的普通用户编写的桌面操作系统。如果您有特殊需求,请使用 Linux 等服务器操作系统。它配备了处理大量数据所需的所有工具。您还可以获得 FS 基准测试工具,例如 bonnie

您还可以从大量文件系统中进行选择,其中一些文件系统(例如 ZFS)专为巨大尺寸(EB)而设计。 NTFS 理论上可以处理这么多数据,但我不知道有人实际尝试过这一点。请参阅这篇维基百科文章获取一些指导。

[编辑] 由于您使用 Windows 的“服务器”版本(翻译为“带有几个漂亮的向导来设置网络的桌面操作系统”),因此您必须与 Microsoft 签订专业支持合同。这意味着您可以打电话给他们,解释您的问题,然后让他们告诉您如何解决。

抱歉,我在这里不必要地讽刺,但我发现这一切真的很有趣;)仅仅因为营销部门在某些东西上贴上“服务器”标签并不意味着专业管理员会购买它。如果有人发布一个答案,大意是“我们做了同样的事情,我们可以让它可靠地工作并让我们满意”,我会感到惊讶。

I can't really make the two terms "Windows" and "4TB of data" match in my head. Windows is a desktop OS written for the average user who does a bit of Word and browsing with IE. If you have special needs, use a server OS like Linux. It comes with all the tools you need to handle large amounts of data. You also get FS benchmark tools like bonnie.

You can also choose from a large set of filesystems where some (like ZFS) are designed for huge sizes (Exabytes). NTFS can theoretically handle this amount of data but I'm not aware that anyone has actually tried this. See this Wikipedia article for some pointers.

[EDIT] Since you use a "server" edition of Windows (which translates to "Desktop OS with a couple of nice wizards to set up the network"), you must have a professional support contract with Microsoft. This means you can just call them, explain your problem and let them tell you how to solve it.

Sorry, I'm being unnecessarily sarcastic here but I find all this really amusing ;) Just because the marketing department slaps a "Server" label on something doesn't mean that a professional administrator would buy it. I'd be surprised if someone would post an answer to the effect "we did the same thing and we could get it working reliably and to our satisfaction".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文