お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2013-07-17 22:10:04

makopi
メンバ
登録日: 2009-11-01

rsync を使って ubuntu をコピーしてみてコピー元とコピー先の差異(I フラグ)を無くしたい。

お世話になります。

以前関連したトピックを作ったのですがあらためて質問させていただきます。
https://forums.ubuntulinux.jp/viewtopic.php?id=15196
----------------------------------------------------------------------

以下の様に rsync を使ってシステムを丸ごとコピーしてみました。
コピー元は、ubuntu13.04 、コピーする時に使っているシステムは ubuntu12.04 です。


コード:

# info rsync から一部抜粋
#
#OPTIONS SUMMARY
#       Here is a short summary of the options available in rsync. Please refer
#       to the detailed description below for a complete description.
#
#        -v, --verbose               increase verbosity
#        -q, --quiet                 suppress non-error messages
#            --no-motd               suppress daemon-mode MOTD (see caveat)
#        -c, --checksum              skip based on checksum, not mod-time & size
#        -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
#            --no-OPTION             turn off an implied OPTION (e.g. --no-D)
#        -r, --recursive             recurse into directories
#        -R, --relative              use relative path names
#            --no-implied-dirs       don't send implied dirs with --relative
#        -b, --backup                make backups (see --suffix & --backup-dir)
#            --backup-dir=DIR        make backups into hierarchy based in DIR
#            --suffix=SUFFIX         backup suffix (default ~ w/o --backup-dir)
#        -u, --update                skip files that are newer on the receiver
#            --inplace               update destination files in-place
#            --append                append data onto shorter files
#            --append-verify         --append w/old data in file checksum
#        -d, --dirs                  transfer directories without recursing
#        -l, --links                 copy symlinks as symlinks
#        -L, --copy-links            transform symlink into referent file/dir
#            --copy-unsafe-links     only "unsafe" symlinks are transformed
#            --safe-links            ignore symlinks that point outside the tree
#        -k, --copy-dirlinks         transform symlink to dir into referent dir
#        -K, --keep-dirlinks         treat symlinked dir on receiver as dir
#        -H, --hard-links            preserve hard links
#        -p, --perms                 preserve permissions
#        -E, --executability         preserve executability
#            --chmod=CHMOD           affect file and/or directory permissions
#         -A, --acls                  preserve ACLs (implies -p)
#        -X, --xattrs                preserve extended attributes
#        -o, --owner                 preserve owner (super-user only)
#        -g, --group                 preserve group
#            --devices               preserve device files (super-user only)
#            --specials              preserve special files
#        -D                          same as --devices --specials
#

# sudo rsync -aXAHv /media/ubuntu1304/ ${BASE_DIR}/new/ubuntu1304/
sudo rsync -rlptgoDHAXv /media/ubuntu1304/ ${BASE_DIR}/new/ubuntu1304/

自分なりにチェックプログラムを作ってコピー先とコピー元両者の比較してみたところ、一部に差異が出ました。
(一例ですが)以下は、
ls-l した結果 : lsattr した結果
です。

コード:

[コピー元]
drwxr-xr-x 2 root root 12288  5月 11 13:26 /media/ubuntu1304/usr/share/icons/gnome/256x256/status : ----------I--e-
[コピー先]
drwxr-xr-x 2 root root 4096  5月 11 13:26 /media/backup/ubuntu1304/new/ubuntu1304/usr/share/icons/gnome/256x256/status : -------------e-

ご覧の通り、 lsattr した結果で I フラグの有無があります。

I フラグの意味は
LANG=C man chattr
で見れました。

「質問」:I フラグが立つディレクトリーを作るにはどうすれば良いのでしょうか?

検索してみると mke2fs の dir_index にあたるのですが、 ubuntu12.04 の /etc/mke2fs.conf を見る限りでは default になっているようです。

よろしくおねがいします。

オフライン

 

#2 2013-07-22 22:04:09

makopi
メンバ
登録日: 2009-11-01

Re: rsync を使って ubuntu をコピーしてみてコピー元とコピー先の差異(I フラグ)を無くしたい。

ubuntu13.04 の /sbin にも I フラグが付いているのですが、
ubuntn12.04.2LTS の /sbin には付いてないですね。

/sbin に I フラグを付けて効果があるのか判らないです。

オフライン

 

#3 2013-07-22 22:08:23

makopi
メンバ
登録日: 2009-11-01

Re: rsync を使って ubuntu をコピーしてみてコピー元とコピー先の差異(I フラグ)を無くしたい。

/sbin に I フラグを付けて効果があるのか判らないです。

/sbin を hash tree にして効果があるか判らないです。

オフライン

 

Board footer

Powered by FluxBB