Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

スパースファイルをコピーする方法

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Issue

  • cp コマンドを使用してスパースファイルをコピーすると、宛先ファイルが完全配分ファイルに変更します。宛先ファイルのコピーをスパースファイルとして残したままコピーするにはどうしたら良いですか?
  • XEN または KVM の仮想マシンイメージをスパースファイルとして作成した場合にコピーするにはどうしたら良いですか?

Resolution

# cp --sparse=always source_file new_file
# rsync --sparse source_file new_file

注意: cp コマンドを --sparse オプションと一緒に使用してブロックデバイスにコピーするのは利用できません。

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments