文库网
ImageVerifierCode 换一换
首页 文库网 > 资源分类 > PDF文档下载
分享到微信 分享到微博 分享到QQ空间

文件系统的管理方法和xfs文件系统备份恢复-v16.pdf

  • 资源ID:4013850       资源大小:1.03MB        全文页数:17页
  • 资源格式: PDF        下载积分:2文币
微信登录下载
快捷下载 游客一键下载
账号登录下载
三方登录下载: QQ登录 微博登录
二维码
扫码关注公众号登录
下载资源需要2文币
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 
账号:
密码:
验证码:   换一换
  忘记密码?
    
友情提示
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

文件系统的管理方法和xfs文件系统备份恢复-v16.pdf

1、otxuegod63 # echo set nu /root/.vimrc rootxuegod63 # vim /etc/passwd #发现默认已经有行号了 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 3、vim 打开多个文件方法 1:以上 下形势,打开两个文档 rootxuegod63 # vim -o /etc/passwd /etc/hosts 注:输入 :qa 一次退出所有打开的文件 方法

2、 2:以左右方式打开两个文档 rootxuegod63 # vim -O /etc/passwd /etc/hosts 注:ctrl+ww 在两文档之间进行切换编辑。大写 O 左右分屏,小写的 o 上下分屏 比较两个文件内容 rootxuegod63 # cp /etc/passwd mima.txt rootxuegod63 # echo aaa mima.txt 方法 1: rootxuegod63 # diff /etc/passwd mima.txt 40a41 aaa 方法 2: rootxuegod63 # vimdiff /etc/passwd mima.txt 学神IT 学神I

3、T 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 4.1.6 其它编辑器 nano 编辑器 emacs 编辑器 GHOME 编辑器 gedit 例: rootxuegod63 # gedit /etc/passwd 4.2 实战:在 Centos6/RHEL6 上恢复 ext4 文件系统下误删除的文件 rootxuegod63 # rm -rf / #这个可以执行成功吗? 执行不成功的, rm: 在/ 进行递归操作十分危险

4、 rm: 使用 -no-preserve-root 选项跳过安全模式 rootxuegod63 # rm -rf /* #这个可以执行成功。 ext4 文件系统上删除文件,可以恢复: extundelete ,ext3 恢复使用:ext3grep windows 恢复误删除的文件: final data v2.0 汉化版 和 easyrecovery xfs 文件系统上删除文件,暂时没有太好的办法进行完全恢复,需要找专业数据恢复公司 扩展: Linux 文件系统由三部分组成:文件名,inode,block windows 也由这三部分组成。 a.txt -inode - block 文件名 存

5、放文件元数据信息 真正存放数据查看文件文件名: rootxuegod63 # cp /etc/passwd a.txt rootxuegod63 # ls a.txt a.txt 查看 inode 号:常识: 每个文件,有 一个 inode 号。 rootxuegod63 # ls -i a.txt 440266 a.txt 查看 inode 中的文件属性; 通过 stat 命令查看 inode 中包含的内容 rootxuegod63 # stat a.txt #查看 inode 信息: rootxuegod63 # ls -l a.txt -rw-r-r- 1 root root 1720

6、Oct 25 10:21 a.txt 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT block 块:真正存储数据的地方逻 辑删除: 为什么删除比复制快? 误删除文件后,第一件事要做什么? 你不心删除把存了几十年的大片删除了。 避免误删除的文件内容被覆盖。 如何避免?卸载需要恢复文件的分区或以只读的方式挂载 4.2.2 实战:在 ext4 文件系统上恢复被误删除的文件 下载 extundelete htt

7、p:/ 开源软件发布中心 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 准备测试分区:先添加一块硬盘 rootxuegod63 /# fdisk /dev/sdb #创建一个 sdb1 分区 WARNING: DOS-compatible mode is deprecated. Its strongly recommended to switch off the mode (command c) and

8、 change display units to sectors (command u). Command (m for help): p #查看现有分区表 Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512

9、bytes / 512 bytes Disk identifier: 0 x000b8b35 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 26 1301 10240000 83 Linux /dev/sda3 1301 1428 1024000 82 Linux swap / Solaris Command (m for help): n #创建一个新分区 Command actio

10、n e extended p primary partition (1-4) p #创建一个主分区 Selected partition 4 First cylinder (1428-2610, default 1428): Using default value 1428 Last cylinder, +cylinders or +sizeK,M,G (1428-2610, default 2610): +1G #指定分区大小 Command (m for help): w #保存 The partition table has been altered! Calling ioctl() t

11、o re-read partition table. 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at

12、 the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. rootxuegod63 #reboot 或 rootxuegod63 # partx -a /dev/sdb #获得新分区表 扩展:如果在根下删除文件了,想恢复,怎么办? 方法 1: 立即断电,然后把磁盘以只读方式,挂 载到另一个电脑中进行恢复方法 2:把 extundelete 在虚拟机上(虚拟机系统要和服务器版本一样) , 提前安装好后再复制到 U 盘中,把 U 盘插入服务器,恢复时,恢复的文件要保存到 U 盘中, (不要 让恢复的数据写到

13、/下,那样会覆盖之前删除的文件) 使用新的分区表: rootxuegod63 /# mkdir /tmp/sdb1 #创建挂载点 rootxuegod63 # mkfs.ext4 /dev/sdb1 #格式化 rootxuegod63 # mount /dev/sdb1 /tmp/sdb1 #挂载 4.2.3 准备测试环境 复制一些测试文件,然后把这些文件再删除,然后演示恢复: rootxuegod63 # cp /etc/passwd /tmp/sdb1 rootxuegod63 # cp /etc/hosts /tmp/sdb1 rootxuegod63 # echo aaa a.txt

14、rootxuegod63 # mkdir -p /tmp/sdb1/a/b/c rootxuegod63 # cp a.txt /tmp/sdb1/a rootxuegod63 # cp a.txt /tmp/sdb1/a/b rootxuegod63 # touch /tmp/sdb1/a/b/kong.txt 安装 tree 命令: rootxuegod63 # rpm -ivh /mnt/Packages/tree-1.5.3-2.el6.x86_64.rpm rootxuegod63 # tree /tmp/sdb1 /tmp/sdb1/ a a.txt b a.txt c #空目录

15、kong.txt #空文件 hosts lost+found passwd lost+found 使用标准的 ext3/ext4 档案系统格式才会产生的一个目录,目的在于当档案系统发生错误时, 将一 些遗失的片段放置到这个目录下。 可以删除 rm -rf lost+found 可以创建 mklost+found 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 删除文件: rootxuegod63 # cd

16、 /tmp/sdb1/ rootxuegod63 sdb1# ls a hosts lost+found passwd rootxuegod63 sdb1# rm -rf a hosts passwd 误删除文件后,第一件事要做什么?如何避免 误删除的文件内容被覆盖?卸载需要恢复文件 的分区:或以只读的方式挂载 rootlocalhost #cd /root rootlocalhost # umount /tmp/sdb1 4.2.4 安装 extundelet 上传 extundelete 到 linux 中:从 windows 上传 extundelete 文件到 linux,安装 xma

17、nager v5 或者 rootxuegod63 # rpm -ivh /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm 安装后,就有了命令和命令 rz : 上传 windows 中的文件到 linux sz 文件名 : 下载,将 linux 中的文件传到 windows 解压并安装 extundelet rootcentos63#mount /dev/sr0 /mnt rootcentos63# vim /etc/yum.repos.d/Centos-6.repo CentOS6 name=CentOS-server baseurl=file:/

18、mnt enabled=1 gpgcheck=0 rootxuegod63# yum -y install e2fsprogs-devel gcc gcc-c+ gcc-g77 rootxuegod63 extundelete-0.2.4# tar xf extundelete-0.2.4.tar.bz2 rootxuegod63 # cd extundelete-0.2.4 rootxuegod63 extundelete-0.2.4# ./configure #检查系统安装环境 rootxuegod63 extundelete-0.2.4# make -j 4 #编译,把源代码编译成可执行

19、的二进制文 件。 -j 4 使用 4 进程同时编译,提升编译速度 或 使用 4 核 CPU 同时编译。 rootxuegod63 extundelete-0.2.4# make install #安装 install 和 cp 有什么区别? install 复制 时可以指定权限 cp 不可以例: rootxuegod63 # install -m 777 /bin/find /opt/find rootxuegod63 # ll /opt/ 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神

20、IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 4.2.5 恢复数据:方法 1:通过 inode 结点恢复方法 二:通过文件名恢复方法三:恢复某个目录,如目 录 a 下的所有文件:方法四:恢复所有的文件 rootxuegod63 # umount /tmp/sdb1/ rootxuegod63 # mkdir test #创建一个目录使用于存放恢复的数据 rootxuegod63 # cd test/ 方法 1:通过 inode 结点查看被删除的文 件名字: rootxuegod63 test# extundelete /dev/sdb1 -inode 2

21、 . 2 lost+found 11 passwd 12 Deleted hosts 13 Deleted a 7313 Deleted 扩展:ext4 文件系统的分区根目录的 inode 值为 2,xfs 分区根目录的 inode 值为 64 rootxuegod63 test# ls -id / #xfs 文件系统 64 / rootxuegod63 test# mount /dev/sdb1 /tmp/sdb1/ rootxuegod63 test# ls -id /tmp/sdb1/ 2 /tmp/sdb1/ rootxuegod63 test# umount /tmp/sdb1/ 方

22、法 1:通过 inode 结点恢复 rootxuegod63 test# extundelete /dev/sdb1 -restore-inode 12 NOTICE: Extended attributes are not restored. Loading filesystem metadata . 9 groups loaded. Loading journal descriptors . 63 descriptors loaded. rootxuegod63 test# ls RECOVERED_FILES rootxuegod63 test# diff /etc/passwd REC

23、OVERED_FILES/file.12 #没有任何输出,说明一样方法二,通过文件名恢复 rootxuegod63 test# extundelete /dev/sdb1 -restore-file hosts rootxuegod63 test# diff /etc/passwd RECOVERED_FILES/hosts #没有任何输出,说明一样方法三:恢复某个目录,如目录 a 下的所有文件: rootxuegod63 test# extundelete /dev/sdb1 -restore-directory a rootxuegod63 test# tree RECOVERED_FIL

24、ES/a/ RECOVERED_FILES/a/ a.txt 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT b a.txt 下面是 原来的目录 结构: rootxuegod63 # tree /root/sdb1-back/a/ /root/sdb1-back/a/ a.txt b a.txt c kong.txt 方法四:恢复所有的文件 rootcentos6 test# rm -rf RECOVER

25、ED_FILES/ rootxuegod63 test# extundelete /dev/sdb1 -restore-all rootcentos6 test# tree RECOVERED_FILES/ 删除前后的数据: extundelete 在恢复文件的时候能不能自动创建空文件和目录?答:不能。 4.3 实战:使用 xmanager 等远程连接工具管理 Linux 4.3.1 Linux 下常用远程连接工具介绍 4.3.2 xmanager 使用方法 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神I

26、T 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 1、xshell 使用方法 例 1:连接一台新的服务器 安装以后打开 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 例 2:调整 xshell 字体大小 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT

27、 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 学神IT 例 3:调整 rz 和 sz 命令的默认路径 2、xftp 使用方法例 1:上传一个文件夹 到 Linux 服务器上 3、xstart 使用方法方法 1:使用 xshell 直接 运行图形界面的程序 例 1:rootxuegod63 # gnome-terminal 例 2:rootxuegod63 # firefox & 学神IT 学神IT 学神IT 学神IT 学神IT 学神吀)e蠀)e諑蠀)e搀)e扵氀)e琉)e)e怀)e砀)e搀)e亮退)e頀)e)e)e楥)e瀀)e餹鰀)e 鰀)e)e)e趭)e)

28、e)e)e )e)e )e )e )e 砀)e 砀)e )e)e )e坦)e 耀)e)e)e)e)e)e)e蠀)e)e)e)e)e琀)e琀)e堀)e)e 尀)e蠀)e蠀)e)e )e )e )e )e )e)e )e)e 搀)e 搀)e退)e 退)e )e)e )e)e 頀)e )e)e)e忔)e萀)e谀)e)e)e掝)e舦)e)e琀)e)e萀)e瀀)e)e)e頀)e 琀)e )e)e)e)e )e )e)e )e 倀)e 倀)e倀)e 倀)e簀)e扙簀)e)e)e )e)e )e 堀)e 堀)e )e )e)e)e)e)e)e拞)e)e)e)e)e)e)e鳡砀)e)e愦)e)e)e豵)e必)

29、e)e嵖)e)e)e )e)e駊)e )e )e)e碰)e芖)e栀)e 栀)e栀)e钁栀)e鐀)e鐀)e)e馘)e )e麹)e 瀀)e鰀)e )e )e蠀)e)e)e瀀)e瀀)e砀)e)e捨)e氀)e)e)e)e)e蠀)e琀)e疽)e)e)e)e)e )e)e鴴)e麵)e吀)e 吀)e 吀)e陸耀)e耀)e 耀)e賛)e麶)e)e呮)e )e巈)e)e )e蠀)e麳)e )e眰)e)e)e嚎)e萀)e)e)e)e)e謤退)e)e簀)e鰀)e)e)e)e鄽)e)e倀)e簀)e)e旬)e)e)e吀)e)e)e )e )e)e 氀)e 氀)e 頀)e頀)e)e )e)e )e)e )e蘣琀)e黶)e)e)e茳)e)e)e)e)e鎋)e溱倀)e苶)e)e)e栀)e尳瀀)e瀀)e脿)e)e頀)e)e)e)e壳)e)e)e綬怀)e 鐀)e)e堀)e枒堀)e 萀)e瞨萀)e萀)e )e)e)e)e)e )e )e)e)e )e報怀)e )e)e )e)e )e 栀)e)e嘴)e)e)e堀)e旓栀)e琏)e)e相鰀)e)e蠀)e)e)e)e栀)e攞)e鑺)e)e


注意事项

本文(文件系统的管理方法和xfs文件系统备份恢复-v16.pdf)为本站会员(shine)主动上传,文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文库网(点击联系客服),我们立即给予删除!




关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

文库网用户QQ群:731843829  微博官方号:文库网官方   知乎号:文库网

Copyright© 2025 文库网 wenkunet.com 网站版权所有世界地图

经营许可证编号:粤ICP备2021046453号   营业执照商标

1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10.png