Linuxのfallocateに似たAIXコマンドはありますか?

Linuxのfallocateに似たAIXコマンドはありますか?

私は多くのIOを実行せずにAIXファイルシステムでスペースを占有する方法を探しています。

私はそれを試しddましたlmktempddスパースファイルを生成しますが、スペースをロックしません。lmktempうまくいきますが、少しIOがあり、少し時間がかかります。私はfallocateそれが速く、IOがないと信じています。

ベストアンサー1

あなたの質問に対する文字通りの答えは次のとおりです。いいえ、AIXはfallocateコマンドを提供しません。 AIX は、ライブラリー呼び出し posix_fallocate() を提供します。

詳細は:

root@x066:[/data/prj/python/python3-3.6.8]find /usr/include -name \*.h | xargs egrep "(fallocate|truncate)64\("
/usr/include/unistd.h:  extern int              ftruncate64(int, off64_t);
/usr/include/unistd.h:  extern int              truncate64(const char *, off64_t);

root@x066:[/data/prj/python/python3-3.6.8]find /usr/include -name \*.h | xargs egrep "(fallocate|truncate)\("
/usr/include/fcntl.h:extern int posix_fallocate(int,off_t,off_t);
/usr/include/sys/fp_io.h:fp_ftruncate(  struct file     *fp,
/usr/include/sys/fp_io.h:extern int     fp_ftruncate();
/usr/include/unistd.h:  extern int              ftruncate();
/usr/include/unistd.h:  extern int              truncate();
/usr/include/unistd.h:  extern int              ftruncate(int, off_t);
/usr/include/unistd.h:  extern int              truncate(const char *, off_t);

ddはスペースをロックするのではなく、「レア」ファイルを提供します。私が理解したのは、これが物理空間ではなく論理空間を占める「希少」ファイルの定義であるということです。また、re:dd、 "seek"引数が指定されていない場合、ファイルは希薄ではありませんが、IOサブシステムに時間と労力がかかります。

はい - 答えははるかに後で出てきました。しかし、それは私がAIXでFallocateに取り組んでいたからでした。そして、AIXでFallocate()(呼び出し!)、実際にはposix_fallocate()を使用するアプリケーションでバグを見つけた可能性があります。

役に立ったことを願っています!

おすすめ記事