tar 无法创建硬链接

tar 无法创建硬链接

我有一个旧的 redhat linux (7.2),我要把它从旧服务器上移到另一个 (vmware) 服务器。所以我从 DSL Linux liveCD (2003 年 - 因为新 linux 没有 Bus Logic 驱动程序) 启动了新服务器,将新磁盘安装到 /mnt/sysimage

然后在旧服务器上我发出了一条命令:

tar  -zpcf  - /  | ssh [email protected] "cat >/mnt/sysimage/fs.tar.gz"

或者

 tar  -zpcf  - / | ssh [email protected] " tar -C /mnt/sysimage/ -xpzf - "

..没关系

收到了很多这样的信息

tar: usr/lib/locale/vi_VN/LC_NUMERIC: Cannot hard link to `/usr/lib/locale/sq_AL.utf8/LC_NUMERIC': No such file or directory
tar: usr/lib/locale/vi_VN/LC_NAME: Cannot hard link to `/usr/lib/locale/ar_IN/LC_NAME': No such file or directory
tar: usr/lib/locale/vi_VN/LC_CTYPE: Cannot hard link to `/usr/lib/locale/ar_AE.utf8/LC_CTYPE': No such file or directory
tar: usr/lib/locale/vi_VN/LC_ADDRESS: Cannot hard link to `/usr/lib/locale/ar_AE.utf8/LC_ADDRESS': No such file or directory
tar: usr/lib/locale/vi_VN/LC_MEASUREMENT: Cannot hard link to `/usr/lib/locale/ar_AE.utf8/LC_MEASUREMENT': No such file or directory
tar: usr/lib/locale/vi_VN/LC_PAPER: Cannot hard link to `/usr/lib/locale/ar_AE.utf8/LC_PAPER': No such file or directory

tar 尝试在绝对路径上创建文件的硬链接,但确定该文件不存在

答案1

tar 手册提供了一些有关硬链接的指导:http://www.gnu.org/software/automake/manual/tar/hard-links.html

简而言之,您可能需要在创建 tarball 时使用 --hard-dereference 标志。

相关内容