手机版
你好,游客 登录 注册
背景:
阅读新闻

SUSE 11 下文件系统修复案例

[日期:2012-11-14] 来源:Linux社区  作者:BugLu [字体:大 中 小]

修复方案

工程师初步判定为Superblock损坏,开始进行制定修复方案:

1.通过dd将原/dev/sda1分区的文件备份到其他文件分区,原分区大小2T,IP存储重新划分了略大于2T的空间,挂到应用服务器上,进行数据备份

2.数据备份后通过fsck.ext3进行修复

 

一、数据备份

创建新的分区/dev/sdb1

linux11:/var/log #fdisk /dev/sdb

The number of cylinders for this disk is set to 267075.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-267075, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-267075, default 267075):
Using default value 267075

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
linux11:/var/log #
linux11:/var/log #
linux11:/var/log #
linux11:/var/log # fdisk -l

Disk /dev/cciss/c0d0: 300.0 GB, 299966445568 bytes
255 heads, 63 sectors/track, 36468 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000bf615

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 38 305203+ 83 Linux
/dev/cciss/c0d0p2 39 4215 33551752+ 82 Linux swap / Solaris
/dev/cciss/c0d0p3 4216 36468 259072222+ 83 Linux

Disk /dev/sda: 2097.2 GB, 2097152000000 bytes
255 heads, 63 sectors/track, 254964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000a13a0

Device Boot Start End Blocks Id System
/dev/sda1 1 254964 2047998298+ 83 Linux

Disk /dev/sdb: 2196.8 GB, 2196766720000 bytes
255 heads, 63 sectors/track, 267075 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x24828d3f

Device Boot Start End Blocks Id System
/dev/sdb1 1 267075 2145279906 83 Linux

注意,这里尝试使用了mkfs格式化文件分区,由于文件系统2T,格式化时间相当长,最终取消了这一操作,注意kill操作也不能很快的结束,只有等待,随即重新划分了存储空间,进行分区,但不进行格式化

开始数据备份

dd if=/dev/sda1 of=/dev/sdb1 bs=8M

最开始的时候未指定bs的大小,默认只有512字节,经过约30小时的等待后,测速发现只有1M/s,后中断该过程,改为bs=8M

应用服务器未安装stat包,补充测速的方法:

>strace.log
time strace -o strace.log -p 11929

运行一段时间后ctrl+c终止

 

统计write出现的次数

grep -c write starace.log

echo "次数*8/time得到的时间" |bc

即为估算的每秒复制的速度。

 

30个小时后备份结束

249999+1 records in
249999+1 records out
2097150257664 bytes (2.1 TB) copied, 130468 s, 16.1 MB/s

linux
相关资讯       SuSE Linux  Linux文件系统修复 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款