ONEDUST – 浮塵草堂

Sulow的開放空間 – 浮塵草堂

Linux 下磁盘备份

http://www.debian.org/doc/manuals/reference/ch-tips.zh-cn.html

8.3.1 拷贝整个子目录的基本命令

如果想重新整理文件组织结构,可使用下面的方法移动文件及文件链接

标准方法:
# cp -a /source/directory /dest/directory # 要求 GNU cp
# (cd /source/directory && tar cf – . ) |
(cd /dest/directory && tar xvfp – )

如果包含硬链接,则需要更严谨的方法:
# cd /path/to/old/directory
# find . -depth -print0 | afio -p -xv -0a /mount/point/of/new directory

如果是远程操作:
# (cd /source/directory && tar cf – . ) |
ssh [email protected] (cd /dest/directory && tar xvfp – )

如果没有链接文件:
# scp -pr [email protected]:/source/directory
[email protected]:/dest/directory

这次将整个系统由/dev/sda1 移到 /dev/sdb1

第一次用的是 cp -r
cp完成后,可以开机,但是无法su,也无法显示Gnome桌面

第二次用了以下方式:
cd /path/to/old/directory
find . -depth -print0 | afio -p -xv -0a /mount/point/of/new/directory

重启后至今使用快一个月了,
没有遇到任何问题





Your email address will not be published.