反馈意见 咨询电话 021-3126-5210

  • 首页
  • 关于我们
  • 服务项目
  • 服务费用
  • 技术资料
  • 案例专题
  • RAID恢复
  • 联系我们

信息中心

技术资料
数据恢复技术文章、技巧、以及各类工具的使用教程等等资料
行业动态
发布数据恢复行业的资讯以及行内的新闻动态
病毒报告
最新病毒预警、症状、处理办法以及有效的预防措施
存储信息
发布数据存储技术、产品、存储技术介绍等等资讯
在线留言
咨询相关硬盘、服务器等等故障导致数据丢失情况
当前位置 首页 >> 信息中心 >> 技术资料 >> 正文
恢复 EXT3 Superblock 的正确方法
前几天遇到一个 Linux Ext3 文件系统超级块(Superblock)错误问题.


.... bad superblock on /dev/hda4一个同事做的恢复, 结果把数据都抹掉了. 后来想想, 当时的直接 fsck 的恢复方法不对. 正确的方法应该是这样的:

1 获取错误的出错磁盘(或者设备)块的大小.
有很多种方法可以得到. 比如,


# tune2fs -l /dev/hda4其实大多数情况下是 1 K.

2 对当前的出错磁盘备份.
恢复超级块(Superblock)的过程其实也是一个有风险的过程.能做备份就做好备份. 如果有其他空闲设备, 用 dd 命令把该设备上的内容备份起来.

3 一般来说, 超级块错基本上也就是主超级块错, 在 Ext2/Ext3 文件系统创建的时候, 会同时在屏幕上提示我们在已经在几个地方备份了超级块.那么怎么发现这些超级块在什么地方呢? 我们看看帮助信息:


-b superblock
Instead of using the normal superblock, use an alternative
superblock specified by superblock. This option is normally
used when the primary superblock has been corrupted. The loca-
tion of the backup superblock is dependent on the filesystem's
blocksize. For filesystems with 1k blocksizes, a backup
superblock can be found at block 8193; for filesystems with 2k
blocksizes, at block 16384; and for 4k blocksizes, at block
32768.

Additional backup superblocks can be determined by using the
mke2fs program using the -n option to print out where the
superblocks were created. The -b option to mke2fs, which spec-
ifies blocksize of the filesystem must be specified in order for
the superblock locations that are printed out to be accurate.

If an alternative superblock is specified and the filesystem is
not opened read-only, e2fsck will make sure that the primary
superblock is updated appropriately upon completion of the
filesystem check.

4 开始恢复.如果文件系统块大小为1K, 则我们可以用如下命令恢复:

# /sbin/fsck.ext3 -b 8193 /dev/hda4
如果这个备用块(8193)也有问题,那么 可以尝试 24577(8192*3+1) ,或者是 40961 (8192*5+1).
可能您也会看出来,超级块的保存位置是按照 1,3,5,7 这样的规律的. 具体的位置在 BlockSize(8192)*N+1. 在超过 500M 的空间上是这样的规律.小于 500M 的我不知道.

  • 4月14号反病毒企业病毒预警信息
  • 笔记本硬盘发展史——固态硬盘强势袭来
  • 10Gb以太网会增长迅猛 SCSI和NAS领导地位堪忧
  • 2TB日立XL台式机硬盘主打中国市场
  • 硬盘数据恢复硬盘
  • 笔记本数据恢复笔记本
  • 服务器数据恢复服务器
  • 数据库修复数据库
  • 开盘恢复数据开盘恢复
  • 关于我们
  • 修复流程
  • 信息中心
  • 联系我们
  • 友情链接
  • 站内地图
版权所有 捷定数据恢复中心