linux – 如何对根文件系统进行tar备份?
发布时间:2020-12-14 01:14:26 所属栏目:Linux 来源:网络整理
导读:我在SD卡上安装了 linux,我用这个命令来安装rootfs tar xpjf rootfs.tar.bz -C / mnt / rootfs / 现在,我对rootfs进行了一些更改,我想创建一个备份,我可以使用上面的相同命令,我尝试使用: tar cpjf rootfs.tar.bz2 /mnt/rootfsandtar cpjf rootfs.tar.bz2 -
我在SD卡上安装了
linux,我用这个命令来安装rootfs
tar xpjf rootfs.tar.bz -C / mnt / rootfs / 现在,我对rootfs进行了一些更改,我想创建一个备份,我可以使用上面的相同命令,我尝试使用: tar cpjf rootfs.tar.bz2 /mnt/rootfs and tar cpjf rootfs.tar.bz2 -C / mnt/rootfs I also tried tar cpjf rootfs.tar.bz2 /mnt/rootfs/* 并试过: cd /mnt/rootfs tar -cvpjf rootfs.tar.bz2 --exclude=/rootfs.tar.bz2 . tar: ./rootfs.tar.bz2: file changed as we read it 但我最终得到的档案在文件系统之前有两个级别,即mnt / rootfs / files我做错了什么? 解决方法
那是因为它从当前的工作目录开始,你可以这样做:
cd /mnt/rootfs tar cpjf /rootfs.tar.bz2 . 这应该在/rootfs.tar.bz2创建一个存档,其根目录为/ mnt / rootfs / (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – 在Ubuntu 14.04.2问题上安装python-pip
- 在Linux中使用cp时如何避免“同一个文件”警告消息?
- centos7虚拟机安装出现license information
- linux – MySQL 5.0,CentOS 5未使用的Hugepages
- linux – apache suexec“命令不在docroot中”
- Linux云计算开学随笔
- linux – Bash排序忽略前5行
- linux – MS Access * .MDB转换为MySQL或SQLite,数据编码
- Linux环境下构建32位和64位应用程序(C)
- linux – OpenLDAP是Windows LDAP的可行替代方案吗?