LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: duanwenhui

更换硬盘

[复制链接]
发表于 2010-6-12 12:51:56 | 显示全部楼层
Post by peter_l;2096238
别拷/sys和/proc,在目的盘上手动建个目录就行了,上次直接cp -a /,启动后N多莫名其妙的问题,弄了好久才搞清原因

cp -a这种我一般都不在线用,都是用个livecd启动后把旧盘和新盘分别mount上再拷,这样出问题的可能少

有lvm的,也可以用snapshot,这个可以在线用,很爽
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-6-12 15:30:39 | 显示全部楼层
Post by meteo;2096227
下面是man cp的内容,任何时候你想要完整的拷贝,都应该用cp -a的

       -a, --archive
              same as -dR --preserve=all

       -d     same as --no-dereference --preserve=links

       --preserve[=ATTR_LIST]
              preserve the specified attributes (default: mode,ownership,time‐
              stamps),  if  possible  additional  attributes:  context, links,
              xattr, all

       -R, -r, --recursive
              copy directories recursively
嗯,学习了。以后要是要多看manual。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表