Linux下恢复EXT3 Superblock的正确方法
浏览:67日期:2022-07-29
;Linux Ext3文件系统超级块(Superblock)错误问题. .... bad superblock on /dev/hda4 一个同事做的恢复, 结果把数据都抹掉了. 后来想想, 当时的直接 fsck 的恢复方法不对. 正确的方法应该是这样的: 1 获取错误的出错磁盘(或者设备)块的大小. 有很多种方法可以得到. 比如, # tune2fs -l /dev/hda4其实大多数情况下是 1 K. 2 对当前的出错磁盘备份. 恢复超级块(Superblock)的过程其实也是一个有风险的过程.能做备份就做好备份. 如果有其他空闲设备, 用 dd 命令把该设备上的内容备份起来. 3 一般来说, 超级块错基本上也就是主超级块错, 在 Ext2/Ext3 文件系统创建的时候, 会同时在屏幕上提示我们在已经在几个地方备份了超级块.那么怎么发现这些超级块在什么地方呢? 我们看看帮助信息: -b superblockInstead of using the normal superblock, use an alternativesuperblock specified by superblock. This option is normallyused when the primary superblock has been corrupted. The loca-tion of the backup superblock is dependent on the filesystem'sblocksize. For filesystems with 1k blocksizes, a backupsuperblock can be found at block 8193; for filesystems with 2kblocksizes, at block 16384; and for 4k blocksizes, at block32768.Additional backup superblocks can be determined by using themke2fs program using the -n option to print out where thesuperblocks were created. The -b option to mke2fs, which spec-ifies blocksize of the filesystem must be specified in order forthe superblock locations that are printed out to be accurate.If an alternative superblock is specified and the filesystem isnot opened read-only, e2fsck will make sure that the primarysuperblock is updated appropriately upon completion of thefilesystem 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 的我不知道.那位知道告诉我一下,谢谢。
标签:
Linux系统
相关文章:1. 东芝将发布20TB MG10系列机械硬盘 容量增加了11.1%2. 华硕Zenbook Pro 16X OLED参数亮点介绍 可选RTX30603. 三星推出512GB CXL内存扩展器2.0 可为CPU增加16TB内存4. 曝AMD 锐龙7000系列CPU和X670主板将于9月15日上市5. 360数科宣布正式加入FinOps阵营 finops是什么6. 神舟笔记本怎么进入bios设置u盘启动7. 锐龙版华硕无畏16 2022笔记本上架 首发价3999元8. AMD发布锐龙7000系列台式机处理器:基于“Zen 4”架构9. Mac注意事项模板210. 小米Redmi Book Pro 14/15 2022锐龙版笔记本开售
热门推荐

- 海尔电脑怎么进入bios?进入bios的方法介绍
- 1.Microsoft Print to PDF打印机丢失怎么办 PDF虚拟打印机修复方法
- 2.EasyRecovery数据恢复功能有哪几个?
- 3.傲游浏览器flash插件提示没有安装怎么解决?解决flash插件提示没有安装的方法分享
- 4.todesk远程设置屏幕分辨率教程
- 5.三星PCIe4.0 SSD 980 PRO 2TB固态硬盘发布 速度7GB/s
- 6.Vista Fiji媒体中心已完成 新特性+多图赏
- 7.0xc0000005蓝屏代码是什么意思?0xc0000005蓝屏代码解决办法
- 8.如何使用USB盘安装Vista?
- 9.重启远程终端服务的三个方法!
- 10.在PE系统中找不到电脑的硬盘怎么办?在PE系统中找不到电脑硬盘的解决办法
