「UnionFS情報」の編集履歴(バックアップ)一覧はこちら

UnionFS情報」(2007/05/15 (火) 00:34:27) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

*UnionFS情報 **ソースからのコンパイル&インストール -/home/hoge/tmp/以下にunionfsのソース(使ってるカーネルのバージョンに合わせてunionfs 1.2)をダウンロードし、展開 wget ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/unionfs-1.x/unionfs-1.2.tar.gz tar xfvz unionfs-1.2.tar.gz -これをコンパイルするが、unionfs-1.2/直下にfistdev.mkというファイルを生成。内容は以下の通り。共有してる資源上で行ったので、実行可能プログラム等は自分のホーム以下に置いた PREFIX = /home/hoge/software --PREFIXは実行可能ファイルを展開する先へのパスを表す。/lib/modules/`uname -r`/buildがちゃんとカーネルソースへのシンボリックリンクになってない、もしくはない場合は、このファイル内でパスを指定する -これでmakeするも、以下のようなエラーが出る # make ... In file included from unionimap.c:22: unionimap.h:29:23: uuid/uuid.h: No such file or directory unionimap.c: In function `create_forwardmap': unionimap.c:57: error: `uuid_t' undeclared (first use in this function) unionimap.c:57: error: (Each undeclared identifier is reported only once unionimap.c:57: error: for each function it appears in.) unionimap.c:57: error: syntax error before "uuid" unionimap.c:68: warning: implicit declaration of function `uuid_generate' unionimap.c:68: error: `uuid' undeclared (first use in this function) unionimap.c: In function `create_reversemap': unionimap.c:182: error: `uuid_t' undeclared (first use in this function) unionimap.c:182: error: syntax error before "uuid" unionimap.c:212: error: `uuid' undeclared (first use in this function) unionimap.c: In function `print_forwardmap': unionimap.c:305: warning: implicit declaration of function `uuid_unparse' make[1]: *** [unionimap] Error 1 make[1]: Leaving directory `/home/hoge/tmp/unionfs-1.2/utils' make: *** [utils] Error 2 --ググったところ、"uuid-dev" debianパッケージをインストールする必要があるらしい。。。のでapt get # apt-get install uuid-dev --するとなんとかコンパイルが通った!! -でも今できたのをインストールすることができない。。。Makefileの勉強をしてみよっと -unionfs-1.2/直下のMakefileにバグ発見っ!!以下のように変更 install-utils: utils # make -C utils install PREFIX=${PREFIX} make -C utils install-utils PREFIX=${PREFIX} mkdir -p ${MANDIR}/man4 mkdir -p ${MANDIR}/man8 cp man/unionfs.4 ${MANDIR}/man4 cp man/unionctl.8 ${MANDIR}/man8 cp man/uniondbg.8 ${MANDIR}/man8 cp man/unionimap.8 ${MANDIR}/man8 --makeのオプション"-C"は、ディレクトリ移動を表し、サブディレクトリのutilsに移動してmake installを行うのだが、utils/のMakefileではinstallターゲットが無いっ!だから、それっぽいinstall-utilsに変えてあげた。 -fistdev.mkで指定したディレクトリにunionfs-1.2というディレクトリを作成した後、union-fs-1.2/直下でmake installを実行 $ mkdir /home/hoge/software/unionfs-1.2 $ cd /home/hoge/tmp/unionfs-1.2 # make install --これで無事にutilsとmodulesがインストールされた **実際に使ってみた ***ディレクトリの重ね合わせ -以下の実験を行った。まずは、2つのディレクトリを重ねていろいろいじってみる。mountに関してはオプションがちょっと独特なことに注意 # cd /tmp # mkdir change_dir static_dir # cd change_dir # touch file1 file2 # cd ../static_dir # touch static_file1 static_file2 # mkdir static_subdir # cd /tmp # mount -t unionfs -o dirs=/tmp/change_dir/=rw:/tmp/static_dir/=ro unionfs /tmp/mnt # cd mnt/ # ls file1 file2 static_file1 static_file2 static_subdir <- 全部のファイルとディレクトリが見えてる # touch static_subdir/new_file1 # vi static_file1 <--何かしらを書き込む # cd .. # umount /tmp/mnt --UnionFSのマウントのコマンドだけど、unionっちゃうディレクトリの順番は''rw→ro''の順番じゃないと上手くマウントできない(parse error発生)。実装の問題っぽいけど、とりあえずこの順番に従うように # mount -t unionfs -o dirs=/tmp/change_dir/=ro:/tmp/static_dir/=rw unionfs /tmp/mnt/ mount: wrong fs type, bad option, bad superblock on unionfs, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so -umountでばらしたあとに、それぞれのディレクトリの中身をのぞく # ls static_dir/static_subdir/newfiles 何もない... # cat static_dir/static_file1 何も表示されない... # ls change_dir file1 file2 static_file1 static_subdir <- ファイルやらディレクトリやら増えてる # cat static_file1 **** # ls static_dir/static_subdir new_file1 --といった具合に、ro上に加えた変更点は全部rw上にコピーされて編集されている。これって差分だけ書いてるのか、それとも全部とりあえずコピーしちゃって、rwのファイルを編集してるのか気になった。 -誤解していたので書いておくと、unionfsはあくまでディレクトリの重ね合わせ。ファイル単体どうしの重ね合わせではない &counter() * コメント #comment
*UnionFS情報 **ソースからのコンパイル&インストール -/home/hoge/tmp/以下にunionfsのソース(使ってるカーネルのバージョンに合わせてunionfs 1.2)をダウンロードし、展開 wget ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/unionfs-1.x/unionfs-1.2.tar.gz tar xfvz unionfs-1.2.tar.gz -これをコンパイルするが、unionfs-1.2/直下にfistdev.mkというファイルを生成。内容は以下の通り。共有してる資源上で行ったので、実行可能プログラム等は自分のホーム以下に置いた PREFIX = /home/hoge/software --PREFIXは実行可能ファイルを展開する先へのパスを表す。/lib/modules/`uname -r`/buildがちゃんとカーネルソースへのシンボリックリンクになってない、もしくはない場合は、このファイル内でパスを指定する -これでmakeするも、以下のようなエラーが出る # make ... In file included from unionimap.c:22: unionimap.h:29:23: uuid/uuid.h: No such file or directory unionimap.c: In function `create_forwardmap': unionimap.c:57: error: `uuid_t' undeclared (first use in this function) unionimap.c:57: error: (Each undeclared identifier is reported only once unionimap.c:57: error: for each function it appears in.) unionimap.c:57: error: syntax error before "uuid" unionimap.c:68: warning: implicit declaration of function `uuid_generate' unionimap.c:68: error: `uuid' undeclared (first use in this function) unionimap.c: In function `create_reversemap': unionimap.c:182: error: `uuid_t' undeclared (first use in this function) unionimap.c:182: error: syntax error before "uuid" unionimap.c:212: error: `uuid' undeclared (first use in this function) unionimap.c: In function `print_forwardmap': unionimap.c:305: warning: implicit declaration of function `uuid_unparse' make[1]: *** [unionimap] Error 1 make[1]: Leaving directory `/home/hoge/tmp/unionfs-1.2/utils' make: *** [utils] Error 2 --ググったところ、"uuid-dev" debianパッケージをインストールする必要があるらしい。。。のでapt get # apt-get install uuid-dev --するとなんとかコンパイルが通った!! -でも今できたのをインストールすることができない。。。Makefileの勉強をしてみよっと -unionfs-1.2/直下のMakefileにバグ発見っ!!以下のように変更 install-utils: utils # make -C utils install PREFIX=${PREFIX} make -C utils install-utils PREFIX=${PREFIX} mkdir -p ${MANDIR}/man4 mkdir -p ${MANDIR}/man8 cp man/unionfs.4 ${MANDIR}/man4 cp man/unionctl.8 ${MANDIR}/man8 cp man/uniondbg.8 ${MANDIR}/man8 cp man/unionimap.8 ${MANDIR}/man8 --makeのオプション"-C"は、ディレクトリ移動を表し、サブディレクトリのutilsに移動してmake installを行うのだが、utils/のMakefileではinstallターゲットが無いっ!だから、それっぽいinstall-utilsに変えてあげた。 -fistdev.mkで指定したディレクトリにunionfs-1.2というディレクトリを作成した後、union-fs-1.2/直下でmake installを実行 $ mkdir /home/hoge/software/unionfs-1.2 $ cd /home/hoge/tmp/unionfs-1.2 # make install --これで無事にutilsとmodulesがインストールされた **実際に使ってみた ***ディレクトリの重ね合わせ -以下の実験を行った。まずは、2つのディレクトリを重ねていろいろいじってみる。mountに関してはオプションがちょっと独特なことに注意 # cd /tmp # mkdir change_dir static_dir # cd change_dir # touch file1 file2 # cd ../static_dir # touch static_file1 static_file2 # mkdir static_subdir # cd /tmp # mount -t unionfs -o dirs=/tmp/change_dir/=rw:/tmp/static_dir/=ro unionfs /tmp/mnt # cd mnt/ # ls file1 file2 static_file1 static_file2 static_subdir <- 全部のファイルとディレクトリが見えてる # touch static_subdir/new_file1 # vi static_file1 <--何かしらを書き込む # cd .. # umount /tmp/mnt --UnionFSのマウントのコマンドだけど、unionっちゃうディレクトリの順番は''rw→ro''の順番じゃないと上手くマウントできない(parse error発生)。実装の問題っぽいけど、とりあえずこの順番に従うように # mount -t unionfs -o dirs=/tmp/change_dir/=ro:/tmp/static_dir/=rw unionfs /tmp/mnt/ mount: wrong fs type, bad option, bad superblock on unionfs, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so -umountでばらしたあとに、それぞれのディレクトリの中身をのぞく # ls static_dir/static_subdir/newfiles 何もない... # cat static_dir/static_file1 何も表示されない... # ls change_dir file1 file2 static_file1 static_subdir <- ファイルやらディレクトリやら増えてる # cat static_file1 **** # ls static_dir/static_subdir new_file1 --といった具合に、ro上に加えた変更点は全部rw上にコピーされて編集されている。これって差分だけ書いてるのか、それとも全部とりあえずコピーしちゃって、rwのファイルを編集してるのか気になった。 -誤解していたので書いておくと、unionfsはあくまでディレクトリの重ね合わせ。ファイル単体どうしの重ね合わせではない &counter()

表示オプション

横に並べて表示:
変化行の前後のみ表示: