EXT3文件系统中误删文件的恢复方法(3)

Writing inode tables: done                           
 Creating journal (4096 blocks): done
 Writing superblocks and filesystem accounting information: done
 

This filesystem will be automatically checked every 27 mounts or
 
180 days, whichever comes first.  Use tune2fs -c or -i to override.
 

-- 创建测试目录并挂载
 
[root@ora10g zlm]# mkdir /oradata/ora10g -p
 [root@ora10g zlm]# mount -o loop /zlm/test1 /oradata/ora10g
 [root@ora10g zlm]# df -Th
 Filesystem    Type    Size  Used Avail Use% Mounted on
 /dev/mapper/VolGroup00-LogVol00
              ext3    7.7G  5.6G  1.7G  77% /
 /dev/sda1    ext3    99M  12M  82M  13% /boot
 tmpfs        tmpfs    506M    0  506M  0% /dev/shm
 
/zlm/test1    ext3    96M  5.6M  86M  7% /oradata/ora10g
 

--在挂载完的目录/oradata/ora10g中创建测试文件并添加内容
 [root@ora10g ora10g]# touch redo01.log redo02.log redo03.log
 [root@ora10g ora10g]# ll
 total 12
 drwx------ 2 root root 12288 Aug 27 13:59 lost+found
 -rw-r--r-- 1 root root    0 Aug 27 14:11 redo01.log
 -rw-r--r-- 1 root root    0 Aug 27 14:11 redo02.log
 -rw-r--r-- 1 root root    0 Aug 27 14:11 redo03.log
 [root@ora10g ora10g]# cat >> redo01.log << EOF
 > AB
 > EOF
 [root@ora10g ora10g]# cat >> redo02.log << EOF
 > CD
 > EOF
 [root@ora10g ora10g]# cat >> redo03.log << EOF
 > EF
 > EOF
 [root@ora10g ora10g]# ll
 total 15
 drwx------ 2 root root 12288 Aug 27 13:59 lost+found
 -rw-r--r-- 1 root root    3 Aug 27 14:12 redo01.log
 -rw-r--r-- 1 root root    3 Aug 27 14:12 redo02.log
 
-rw-r--r-- 1 root root    3 Aug 27 14:12 redo03.log
 

--模拟误操作,删除/oradata/ora10g下所有文件
 [root@ora10g ora10g]# rm -rf *.*
 [root@ora10g ora10g]# ll
 total 12
 drwx------ 2 root root 12288 Aug 27 13:59 lost+found
 [root@ora10g ora10g]# umount /zlm/test1
 umount: /oradata/ora10g: device is busy
 
umount: /oradata/ora10g: device is busy
 

由于当前目录是/oradata/ora10g,所以提示"device is busy",退出该目录后再执行
 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/05aad6cf88ef063d9412909a830a476f.html