LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神,可以点击顶部导航 Contact 按钮进行投稿。

Related entries

  • No related posts

使用 dd 和 gzip 代替 Ghost 做磁盘镜像

在 Linux 下,其实可以使用 dd 和 gzip 命令来代替 Ghost 做磁盘镜像。但缺点是速度不够理想,据实际测试表明,16 GB(实际占用 4GB)可能需要耗费 1 个小时。

要使用 dd 和 gzip 备份,可以执行命令:
# dd if=/dev/hda1 | gzip > bw.office.sled.10.hda1.dd.gz

在还原时,可以执行下列命令:
# gzip -dc bw.office.sled.10.hda1.dd.gz | dd of=/dev/hda1

值得注意的是,还原时需要使用如 Live CD 之类的 Linux 引导系统。

(感谢 pig345 分享此技巧)

署名 • 注明出处 • 非商业性使用

7 Comments

  1. 1 Skywind Commented @ 2006-12-29 1:56 pmReply to this comment

    用squashfs来做会快很多,在我的使用中,一般速度是用dd+gzip的一倍。

  2. 2 SpongeBob Commented @ 2006-12-29 2:32 pmReply to this comment

    You can try partimage.
    It’s a good tools too.

  3. 3 pig345 Commented @ 2006-12-29 5:53 pmReply to this comment

    似乎dd/gzip的唯一好处是linux内置。

  4. 4 benben Commented @ 2006-12-29 10:48 pmReply to this comment

    tar 不可以吗?

  5. 5 pig345 Commented @ 2006-12-30 1:47 pmReply to this comment

    to benben :
    能否给个命令例子?
    dd是对磁盘设备的完全镜像吧。不知道tar是否也可以?

  6. 6 benben Commented @ 2006-12-30 6:26 pmReply to this comment

    http://hi.baidu.com/benben/blog/item/6be5277f4026500828388a5a.html
    偶用来备份Ubuntu的!

  7. 7 bklcomsun Commented @ 2007-12-18 5:02 pmReply to this comment

    楼主是乎可以在使用dd命令时使用“bs=xxx”选项,我在使用dd命令进行硬盘间复制时146G大概用时为1小时10分钟左右。xxx为512的整数倍