1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Tips: AIX tar コマンド :ファイル・サイズ 8GB 以上の操作が可能

Last updated at Posted at 2020-10-05

いつの間にか AIX のtarコマンドのファイル容量制限がAIX 7.1 TL3 以降で無制限となっていました。

・tar コマンド
https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_71/t_commands/tar.html

AIX® 7.1 (テクノロジー・レベル 2) 以前のリリースでは、ustar ヘッダー書式で最大 8 GB のファイル・サイズを指定できます。 AIX 7.1 (テクノロジー・レベル 3) 以降のリリースでは、このサイズは無制限 (2^64 -1) です。


AIX 7.1 TL2 (制限があるAIX7.1TL3未満)の環境で 8GB 以上の tar 操作ができないことを確認します。

AIX 7.1 TL2 環境

# oslevel -s
7100-02-00-0000

10GBファイルのtar操作失敗を確認

dd コマンドで 10GBのファイル(10GBfile) を作成

# dd if=/dev/zero of=10GBfile bs=1M count=10000
10000+0 records in
10000+0 records out
# ls -l
total 20480000
-rw-r--r--    1 root     system   10485760000 Feb 26 13:42 10GBfile

作成した 10GBfile でtar ファイルを作成

# tar -cvf 10GBfile.tar 10GBfile
tar: 10GBfile: file too large.
# echo $?
2

file too large で失敗しました。


では、AIX 7.2 TL3 (無制限となった AIX 7.1 TL3 以上) の環境で 8GB 以上の tar 操作が可能であることを確認します。

AIX 7.2 TL3 環境

# oslevel -s
7200-03-02-1846

10GBファイルのtar操作成功を確認

dd コマンドで 10GBのファイル(10GBfile) を作成

# dd if=/dev/zero of=10GBfile bs=1M count=10000
10000+0 records in
10000+0 records out
# ls -l
total 20480000
-rw-r--r--    1 root     system   10485760000 Oct  4 15:56 10GBfile


10GBfileの tar ファイルを作成

# tar -cvf 10GBfile.tar 10GBfile
a 10GBfile 20480000 blocks
# ls -l
total 40960032
-rw-r--r--    1 root     system   10485760000 Oct  4 15:56 10GBfile
-rw-r--r--    1 root     system   10485770240 Oct  4 16:05 10GBfile.tar

10GB サイズのファイルでエラーなく tarファイルが作成されました。


(Option) tar コマンドでは圧縮されないので、gzip コマンドで圧縮をかけます。

# gzip 10GBfile.tar
# ls -l
total 19880
-rw-r--r--    1 root     system     10176308 Oct  4 16:07 10GBfile.tar.gz

元サイズの 0.097 % くらいになりました。

以上です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?