<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; bad superblock</title>
	<atom:link href="https://www.xifenfei.com/tag/bad-superblock/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sat, 07 Nov 2026 15:45:44 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>mount: wrong fs type, bad option, bad superblock恢复Oracle</title>
		<link>https://www.xifenfei.com/2017/08/bad-superblock-recovery.html</link>
		<comments>https://www.xifenfei.com/2017/08/bad-superblock-recovery.html#comments</comments>
		<pubDate>Fri, 18 Aug 2017 03:18:49 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[非常规恢复]]></category>
		<category><![CDATA[bad superblock]]></category>
		<category><![CDATA[superblock]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=7194</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2017/08/bad-superblock-recovery.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2017/08/bad-superblock-recovery.html" target="_blank">mount: wrong fs type, bad option, bad superblock恢复Oracle</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>有朋友找到我们,说对lv进行收缩操作之后,导致文件系统无法mount,提示超级块损坏.<br />
<strong>尝试mount失败</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@GZGSDB data]# mount /dev/vg_gzgsdb/lv_home /home
mount: wrong fs type, bad option, bad superblock on /dev/mapper/vg_gzgsdb-lv_home,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
</pre>
<p><strong>系统日志报错</strong></p>
<pre class="brush: bash; title: ; notranslate">
Aug 16 21:23:24 GZGSDB kernel: EXT4-fs (dm-5): ext4_check_descriptors: Block bitmap for group 1 not in group (block 0)!
Aug 16 21:23:24 GZGSDB kernel: EXT4-fs (dm-5): group descriptors corrupted!
</pre>
<p><strong>主要操作</strong><br />
<a href="//www.xifenfei.com"><img src="//www.xifenfei.com/wp-content/uploads/2017/08/cz.png" alt="cz" width="763" height="703" class="alignleft size-full wp-image-7195" /></a></p>
<hr />
这里可以看出来，明显操作错误，在没有收缩文件系统之前，直接收缩的lv.<br />
<a href="//www.xifenfei.com"><img src="//www.xifenfei.com/wp-content/uploads/2017/08/list_history.jpg" alt="list_history" width="597" height="741" class="alignleft size-full wp-image-7196" /></a></p>
<hr />
这里可以看出来，在发生故障之后，又做了很多操作，包括fsck和testdisk等,最终无法恢复,请求我们协助处理。<br />
<br />
<strong>找出来备份超级块</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@GZGSDB dul]# dumpe2fs /dev/vg_gzgsdb/lv_home |grep superblock
dumpe2fs 1.41.12 (17-May-2010)
ext2fs_read_bb_inode: A block group is missing an inode table 
  Primary superblock at 0, Group descriptors at 1-52
  Backup superblock at 32768, Group descriptors at 32769-32820
  Backup superblock at 98304, Group descriptors at 98305-98356
  Backup superblock at 163840, Group descriptors at 163841-163892
  Backup superblock at 229376, Group descriptors at 229377-229428
  Backup superblock at 294912, Group descriptors at 294913-294964
  Backup superblock at 819200, Group descriptors at 819201-819252
  Backup superblock at 884736, Group descriptors at 884737-884788
  Backup superblock at 1605632, Group descriptors at 1605633-1605684
  Backup superblock at 2654208, Group descriptors at 2654209-2654260
  Backup superblock at 4096000, Group descriptors at 4096001-4096052
  Backup superblock at 7962624, Group descriptors at 7962625-7962676
  Backup superblock at 11239424, Group descriptors at 11239425-11239476
  Backup superblock at 20480000, Group descriptors at 20480001-20480052
  Backup superblock at 23887872, Group descriptors at 23887873-23887924
  Backup superblock at 71663616, Group descriptors at 71663617-71663668
  Backup superblock at 78675968, Group descriptors at 78675969-78676020
  Backup superblock at 102400000, Group descriptors at 102400001-102400052
  Backup superblock at 214990848, Group descriptors at 214990849-214990900
</pre>
<p><strong>使用fsck修复</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@GZGSDB data]# fsck -y /dev/vg_gzgsdb/lv_home 
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
fsck.ext4: Group descriptors look bad... trying backup blocks...
fsck.ext4: The ext2 superblock is corrupt when using the backup blocks
fsck.ext4: going back to original superblock
fsck.ext4: Device or resource busy while trying to open /dev/mapper/vg_gzgsdb-lv_home
Filesystem mounted or opened exclusively by another program?
--指定超级块恢复
[root@GZGSDB data]# fsck -y -b 102400000 /dev/vg_gzgsdb/lv_home 
…………
Illegal block #0 (1296647770) in inode 354315.  CLEARED.
Illegal block #1 (1398362886) in inode 354315.  CLEARED.
Illegal block #3 (453538936) in inode 354315.  CLEARED.
Illegal block #5 (808333361) in inode 354315.  CLEARED.
Illegal block #6 (775434798) in inode 354315.  CLEARED.
Illegal block #8 (1180306180) in inode 354315.  CLEARED.
Illegal block #9 (1413893971) in inode 354315.  CLEARED.
Illegal block #10 (1229347423) in inode 354315.  CLEARED.
Illegal block #11 (1498613325) in inode 354315.  CLEARED.
Illegal indirect block (1296389203) in inode 354315.  CLEARED.
Inode 354315 is too big.  Truncate? yes

Block #1074301965 (69632) causes directory to be too big.  CLEARED.
Warning... fsck.ext4 for device /dev/mapper/vg_gzgsdb-lv_home exited with signal 11.

[root@GZGSDB data]# mount /dev/vg_gzgsdb/lv_home /home
mount: wrong fs type, bad option, bad superblock on /dev/mapper/vg_gzgsdb-lv_home,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
</pre>
<p>至此基本上可以判断,直接修复该文件系统,让其正常mount的概率很小.直接通过lun层面来恢复.<br />
<br />
<strong>通过工具解析lun</strong><br />
<a href="//www.xifenfei.com"><img src="//www.xifenfei.com/wp-content/uploads/2017/08/disk_size.jpg" alt="disk_size" width="494" height="365" class="alignleft size-full wp-image-7197" /></a><br />
<hr />
比较明显,客户经过一系列操作现在的现象是lv 1.03T,文件系统只有821G,明显和客户给我反馈的操作不符(应该是lv 821G),证明客户做了大量操作,已经导致文件系统损坏<br />
<a href="//www.xifenfei.com"><img src="//www.xifenfei.com/wp-content/uploads/2017/08/inode_recovery.jpg" alt="inode_recovery" width="693" height="691" class="alignleft size-full wp-image-7198" /></a></p>
<hr />
由于文件系统严重异常,工具获取到的文件都是没有名称,直接从inode里面读取的数据.获取到这些数据之后,然后结合oracle的特性,判断出来对应的文件号关系(这里有大量文件重复);另外有个别文件通过inode恢复丢失,通过底层碎片重组进行恢复出来文件,然后恢复出来其中数据(<a href="//www.xifenfei.com/?p=5249" title="asm disk header 彻底损坏恢复" target="_blank">asm disk header 彻底损坏恢复</a>).这个客户比较幸运,system文件在另外一个分区中,不然工作量会大很多.<br />
<strong>再次提醒:对lv操作一定要谨慎,特别是lvreduce操作,另外出现发生误操作之后,应该第一时间保护现场,而不是百度着去乱操作,可能导致故障更加悲剧</strong></p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/11/ext3-ext4-superblock-recovery.html" rel="bookmark" class="crp_title">ext3/ext4 超级块修复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/extundelete%e6%81%a2%e5%a4%8dlinux%e8%a2%ab%e5%88%a0%e9%99%a4%e6%96%87%e4%bb%b6.html" rel="bookmark" class="crp_title">extundelete恢复Linux被删除文件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/linux%e4%b8%ad%e6%96%87%e4%bb%b6%e5%a4%a7%e5%b0%8f%e9%99%90%e5%88%b6.html" rel="bookmark" class="crp_title">Linux中文件大小限制</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2021/05/ext4-lvm-resize.html" rel="bookmark" class="crp_title">ext4 lvm在线扩容</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/11/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1rm-rf-oradata%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">记录一次rm -rf 删除数据文件异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/03/%e5%88%b6%e4%bd%9cu%e7%9b%98%e5%88%b7exadata.html" rel="bookmark" class="crp_title">制作U盘刷EXADATA</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/linux%e9%80%bb%e8%be%91%e5%8d%b7%e7%ae%a1%e7%90%86lvm.html" rel="bookmark" class="crp_title">Linux逻辑卷管理(LVM)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/drbd%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e8%af%b4%e6%98%8e.html" rel="bookmark" class="crp_title">DRBD安装配置说明</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html" rel="bookmark" class="crp_title">multipath实现设备用户组设置</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/12/sql-bak-0-lost-data.html" rel="bookmark" class="crp_title">模拟sql server故障备份完成恢复实现数据0丢失</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/02/%e5%88%9b%e5%bb%ba%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6%e9%81%ad%e9%81%87ora-600-kccscf_1.html" rel="bookmark" class="crp_title">创建控制文件遭遇ORA-600 kccscf_1</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/05/ora-600-ksvworkmsgalloc-bad-reaper.html" rel="bookmark" class="crp_title">ORA-600 ksvworkmsgalloc: bad reaper</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2017/08/bad-superblock-recovery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
