ZT:Reiserfs filesystem recovery

简介: http://martian.org/marty/2003/09/05/reiserfs-filesystem-recoveryCleaning up after disk crashing season hasn’t been fun, but I am p...

http://martian.org/marty/2003/09/05/reiserfs-filesystem-recovery

Cleaning up after disk crashing season hasn’t been fun, but I am pleased with what I’ve managed to recover from the worst crash.

I wanted to get the latest data from the dead webserver. It was in MySQL, and stored in /var/lib/mysql. Unfortunately, the /var/lib directory no longer existed.

I didn’t want to try to recover it in place — with so many bad blocks, things can only get worse — so I copied the entire partition to a file on my laptop (the one with the shiny new disk): ssh deadserver dd if=/dev/hda1 conv=noerror > hda1.img (You need the conv=noerror or else dd will stop when it hits the first bad block.)

So, then I had most of a corrupt filesystem image. To make it useful I used the loop driver: losetup /dev/loop0 hda1.img

Now I could try reiserfsck to see what I could recover. I started with reiserfsck –rebuild-sb /dev/loop0 to rebuild the superblock: even it if hadn’t been affected by the physical disk corruption, it would certainly be confused by it new home in a looped image that probably wasn’t the same size as the original partition. Next step was reiserfsck –rebuild-tree /dev/loop0 to try to find the contents of the missing directories. I finished it off with reiserfsck –check /dev/loop0 to make sure it was happy.

Now I can just mount /dev/loop0 /mnt and have a look in /mnt/lost+found. The data is there!


目录
相关文章
|
6月前
disk 4k
disk 4k
28 1
|
Linux
Linux - How to Take ‘Snapshot of Logical Volume and Restore’ in LVM
Linux - How to Take ‘Snapshot of Logical Volume and Restore’ in LVM
99 0
|
数据安全/隐私保护
Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
下面为解决问题中报的错误: Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c. Caller xfs_free_extent
428 0
Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
/******************************************************************************** * FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. * 说明: * 系统更新的时候遇到这个错误,记录一下处理步骤,其原因是我自己把其umount了 * 导致的问题。
6396 0
|
存储 缓存 文件存储
NFS Hard Mount Vs Soft Mount
本章节将详细分析和对比NFS挂载参数的优劣,在使用NFS可根据业务情况做出最佳选择。
6288 0
|
Linux 虚拟化
【Centos】 kernel panic-not syncing:VFS:Unable to mount root fs on unknown block
背景: VMware虚拟机下 原因: 在命令执行(update)途中,强制中断并直接运行poweroff命令关机。再次开机出现如图所示故障指示: 根据提示信息分析,可能因为执行更新命令未完成导致系统内核信息混乱。
3985 0