7
2
2014
1

debugfs总结

1.debugfs由block编号推导存放的具体文件(包括目录的数据)

  icheck block编号

  ncheck inode编号  

  在我的另一篇博客上:http://sundayhut.is-programmer.com/posts/49173.html

  有详细过程

 

2.debugfs查看文件(包括目录的数据)所存放的block号

该功能即1的逆向查找

查看文件stat filename

查看目录stat dirname

这里有一点要注意,使用stat查找文件时,一定要使用挂载文件目录的相对路径,否则会出现一下问题

File not found by ext2_lookup

怎么解决呢?看如下例子:

我将/dev/sdd1挂载到/mnt/sdd1上。输入debugfs /dev/sdd1后,若要查看/mnt/sdd1目录下的ext2_256M文件,你应该输入

stat ext2_256M或者stat ./ext2_256M

而不应该输入:

stat /mnt/sdd1/ext2_256M

截图入下:

正确的输入stat ext2_256M后,屏幕上显示如下:

其中BLOCKS:后面为stat查看数据所占的块号!!注意是块号,而不是扇区号。。人家都写了BLOCKS了,怎么会以为是扇区号呢。

其中倒数第二行的(0-3)表示其第0到第3个数据块所对应的块号

3.恢复刚刚误删的文件

确定要删除的文件在哪个分区上,比如我删除的文件在/mnt/sde1目录下文件,根据我的挂载目录的习惯,我知道这个分区是/dev/sde1,接下来就用stat的lsdel显示最近删除的东西,以及dump指令来恢复

lsdel

dump <inode号> path  其中inode号在lsdel时会显示。path是你想恢复的路径

 

4.关于ls,在debugfs中,输入ls和ls -l,分别有如下显示:

输入ls:

上图中每个文件或者目录项对应着3个项,如 737281 (3696) m_ext2

其中737281为inode号,括号中数字含义不明。

 

ls -l显示如下

以m_ext2来分析

其中第一列737281为inode编号,4096为size,第2、3、4、5列含义不明。有知道的读者忘指教~

 

Category: debugfs | Tags: debugfs | Read Count: 18367
Avatar_small
MAC Task Manager 说:
2023年2月03日 15:29

If this is your first time using Task Manager for Mac, you may find it difficult to become acquainted with what is going on with the device shortcuts and the apps as well. To be honest, this is a common occurrence, and the main problem is that app navigation is very different from Windows and has its own way of finding shortcuts and opening apps as well. MAC Task Manager But don't worry if this is your first time using a MAC device; we'll show you how to utilise Task Manager for MAC in no time.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com