afio 2.4.7 から 2.5 へのアップグレード

2004.12.27

前書き

これまで 、サーバのファイルをバックアップする時には、afio 2.4.7 を使用してきました。
指定したファイル、ディレクトリを tar のようにひとつのアーカイブファイルにして
保存することができるプログラムなのですが、afio 2.4.7 が作成できるアーカイブファイルは
容量2ギガバイト ( 2G byte )までという上限がありました。

そのため、バックアップは不本意ながら、上限2ギガバイトを超えないよう、
いくつかのアーカイブファイルに分散させて取得していました。

この制限、何とかならないかなぁ・・・。

と思い、調べてみました。

そうしたら、afio 2.5 ではこの上限がなくなっていることが判明。
* WHAT IS NEW IN VERSION 2.5?

- Added support for archiving files larger than 2 GB.
  The resulting archives are not fully compatible with cpio, but
  preserve cpio compatibility as much as possible.


早速導入を決意。

afio 2.4.7 をコンパイルして使い始めたのは 2002年09月09日。
afio 2.5 は 2003年12月21日にリリース。

約1年もそのことに気づかなかったのは、ちょっと悲しい。

インストール方法の吟味

Fedora Core 3 用の afio 2.5 は、標準では用意されていないようです。
[root@lark afio-2.4.7]# yum install afio
Setting up Install Process
Setting up Repo:  base
repomd.xml                100% |=========================| 1.1 kB    00:00
Setting up Repo:  updates-released
repomd.xml                100% |=========================|  951 B    00:00
Reading repository metadata in from local files
base      : ################################################## 2622/2622
updates-re: ################################################## 408/408
No Match for argument afio
Nothing to do


自分でソースからコンパイルすることにする。

用意するもの

展開

適当な場所にダウンロードして展開。
# cd /tmp
# wget http://www.ibiblio.org/pub/linux/system/backup/afio-2.5.tgz
--23:37:47--  http://www.ibiblio.org/pub/linux/system/backup/afio-2.5.tgz
           => `afio-2.5.tgz'
www.ibiblio.org をDNSに問いあわせています... 152.2.210.80
www.ibiblio.org[152.2.210.80]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 179,184 [application/x-tar]

100%[==========================================================================>] 179,184      133.27K/s

23:37:49 (132.99 KB/s) - `afio-2.5.tgz' saved [179,184/179,184]

# cd /usr/local/src
# tar zxvf /tmp/afio-2.5.tgz

Makefile 編集

デフォルトはオンラインマニュアルのインストール先が「/usr/share/man/man1」です。
これを、「/usr/local/man」に変更します。
(別にそのままでもいいのですが)

「/usr/local/src/afio-2.5/Makefile」の 92行目を編集。

「/usr/local/src/afio-2.5/Makefile」の 92行目
          cp afio.1 /usr/local/man/man1

コンパイル

コンパイル実行
# cd /usr/local/src/afio-2.5
# make

2ギガバイト を超えるアーカイブファイルを取得できるかテスト

自分が使用しているシステムでコンパイルした afio が
2ギガバイト を超えるアーカイブファイルを取得できるかどうかテストお行う。

Makefile に、ターゲット「regtest2gb」が用意されているので、それを使ってテストしてみる

l# make regtest2gb
cd regtest; make 2gb
make[1]: Entering directory `/usr/local/src/afio-2.5/regtest'
gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE makesparse.c   -o makesparse
bash  ./regtest2gb
Doing >2GB file support regression test
 * Testing on: Linux lark.rfm.jp 2.6.9-1.681_FC3 #1 Thu Nov 18 15:10:10 EST 2004 i686 i686 i386 GNU/Linux
 * OS version: Fedora Core release 3 (Heidelberg)
Kernel \r on an \m
 * gcc version: /usr/lib/gcc/i386-redhat-linux/3.4.2/specs から spec を読み込み中
コンフィグオプション: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --e
nable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enabl
e-java-awt=gtk --host=i386-redhat-linux
スレッドモデル: posix
gcc バージョン 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
 * Afio shared libraries:       libc.so.6 => /lib/tls/libc.so.6 (0x00a27000)
        /lib/ld-linux.so.2 (0x00f93000)
 * Test is done by making a 4.000001GB sparse file and trying to pack+verify it.
sizeof st_size = 8
-rw-rw-r--  1 ryo ryo 4294967308 12月 27 16:32 t/4.1gb
-rw-rw-r--  1 ryo ryo         12 12月 27 16:32 t/bla
-rw-rw-r--  1 ryo ryo         12 12月 27 16:32 t/wox
-rw-rw-r--  1 ryo ryo         18 12月 27 16:32 t/wuxta
running afio -o | afio -r
drwxrwxr-x  1 ryo      ryo               Dec 27 16:32:18 2004 t
-rw-rw-r--  1 ryo      ryo            12 Dec 27 16:32:18 2004 t/bla
-rw-rw-r--  1 ryo      ryo      4294967308 Dec 27 16:32:18 2004 t/4.1gbafio: 4096m+1k+0 bytes written in 2070 seconds.
 The operation was successful.
>2GB regression test OK!
make[1]: Leaving directory `/usr/local/src/afio-2.5/regtest'

「OK!」と出れば大丈夫らしい。

/usr/local/src/afio-2.5/INSTALLATION より抜粋
lTest 2: regtest2gb: large file handling test
--------------------------------------------

This test tries out the large file handling capabilities of afio, and
is only applicable to systems with large (>2GB) file support.  If you
don't know if your system supports large files, you can find that out
by running the test.

This test requires a) sparse file support in the filesystem (which is
present in most Unixes, including Linux, or b) 2.2 GB free space on
the filesystem.  You can compile and run this test with

make regtest2gb

This test prints a line with 'OK!' at the end it succeeds.

    --> this regression test will of course fail on platforms
        that do not support >2GB files.
        Note that, if the test fails, this is often not due to a bug
        in afio, but more likely to a missing feature or configuration
        problem in the kernel, the filesystem, the compiler, or the
        libraries.
        As of Dec 2003, the test is known to report success on
          - Red Hat Linux 7.3
          - Debian Linux 3.0/testing (not 3.0/stable) on most platforms,
            including i386
          - At least some versions of Solaris
          - FreeBSD 3.5-STABLE

いざ、インストール


# make install
cp afio /usr/local/bin
cp afio.1 /usr/local/man/man1

結論

情報収集は大切です。
 
導入手順書へ戻る