linux fix the superblock by dumpe2fs fsck
It seems that you have a bad superblock. To fix this:
Firstly, boot into a live CD or USB
Find out your partition number by using
sudo fdisk -l|grep Linux|grep -Ev 'swap'
Then, list all superblocks by using the command:
sudo dumpe2fs /dev/sda2 | grep superblock
Replace sda2 to your drive number
You should get a similar output like this
Primary superblock at 0, Group descriptors at 1-6
Backup superblock at 32768, Group descriptors at 32769-32774
Backup superblock at 98304, Group descriptors at 98305-98310
Backup superblock at 163840, Group descriptors at 163841-163846
Backup superblock at 229376, Group descriptors at 229377-229382
Backup superblock at 294912, Group descriptors at 294913-294918
Backup superblock at 819200, Group descriptors at 819201-819206
Backup superblock at 884736, Group descriptors at 884737-884742
Backup superblock at 1605632, Group descriptors at 1605633-1605638
Backup superblock at 2654208, Group descriptors at 2654209-2654214
Backup superblock at 4096000, Group descriptors at 4096001-4096006
Backup superblock at 7962624, Group descriptors at 7962625-7962630
Backup superblock at 11239424, Group descriptors at 11239425-11239430
Backup superblock at 20480000, Group descriptors at 20480001-20480006
Backup superblock at 23887872, Group descriptors at 23887873-23887878
Choose an alternate superblock from this list, for this case alternate superblock # 32768
Now, to check and repair a Linux file system using alternate superblock # 32768:
sudo fsck -b 32768 /dev/sda2 -y
The -y flag is used to skip all the Fix? questions and to answer them all with a yes automatically
You should get similar output like this:
fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
/dev/sda2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #241 (32254, counted=32253).
Fix? yes
Free blocks count wrong for group #362 (32254, counted=32248).
Fix? yes
Free blocks count wrong for group #368 (32254, counted=27774).
Fix? yes
..........
/dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda2: 59586/30539776 files (0.6% non-contiguous), 3604682/61059048 blocks
Now try mounting the partition
sudo mount /dev/sda2 /mnt
Now, try to browse the filesystem with the following commands
cd /mnt
mkdir test
ls -l
cp file /path/to/safe/location
If you are able to perform the above commands, you have most probably fixed your error.
Now, restart you computer and you should be able to boot normally.
linux fix the superblock by dumpe2fs fsck的更多相关文章
- linux文件系统相关命令(df/du/fsck/dumpe2fs)
一.文件系统查看命令df 格式 df [选项] [挂载点] 选项 名称 作用 -a 显示所有的文件系统信息,包括特殊文件系统,如/proc,/sysfs -h 使用习惯单位显示容量,如KB,MB或GB ...
- Linux磁盘 - fdisk,partprobe, mkfs, mke2fs, fsck, badblocks, mount, mknod
磁盘分区: fdisk [root@www ~]# fdisk [-l] 装置名称 选项与参数: -l :输出后面接的装置所有的 partition 内容.若仅有 fdisk -l 时, 则系统将会把 ...
- linux 文件系统之superblock
为了实际测试这个pagecache和对裸盘操作的区别,我一不小心敲错命令,将一个磁盘的super_block给抹掉了,全是0, dd if =/dev/zero of=/dev/sda2 bs=409 ...
- Linux下对superblock的理解
对superblock的理解首先从partition structure的结构开始: 开始的,总的来说,block这个概念好理解..下面就是对super block的理解了Super block即为超 ...
- Linux启动提示“unexpected inconsistency;RUN fsck MANUALLY”
问题:在开机启动时,提示“unexpected inconsistency;RUN fsck MANUALLY”进不了系统 解决方法: fsck不仅可以对文件系统进行扫描,还能修正文件系统的一些问题, ...
- Linux学习之fsck命令
在windows下,磁盘的文件系统出错,需要运行chkdsk命令进行修复.而在linux下,则需要运行fsck命令.由于linux对于文件系统的错误非常敏感,由于意外断电或者其它原因导致linux系统 ...
- linux 磁盘与文件系统管理 (鸟哥私房菜)
各种接口磁盘在Linux中的文件名分别为 /dev/sd[a-p][1-15]:为SCSI,SATA,USB,Flash随身碟等接口的磁盘文件名 /dev/hd[a-d][1-63]:为IDE接口的磁 ...
- 【文件系统】dumpe2fs命令
dumpe2fs - dump ext2/ext3/ext4 filesystem information dumpe2fs prints the super block and blocks gro ...
- 恢复ext4文件系统superblock
恢复ext4文件系统superblock 1. Create ext4 文件系统. [root@localhost ~]# mkfs.ext4 /dev/vdb1 [root@localhost ~] ...
随机推荐
- Shell函数的7种用法介绍
1. 在shell文件内部定义函数并引用: 复制代码代码如下: [~/shell/function]# cat factorial.sh #!/bin/bashfunction factorial{f ...
- class path and classloader
https://www.artima.com/insidejvm/ed2/linkmod5.html https://www.artima.com/insidejvm/ed2/securityP.ht ...
- 【iCore4 双核心板_FPGA】例程七:状态机实验——状态机使用
实验现象:按键每按下一次,三色LED改变一次状态. 核心代码: //--------------------module_rst_n---------------------------// modu ...
- 转载:安装Ubuntu 15.10后要做的事
转载:安装Ubuntu 15.10后要做的事 原文转载于:http://blog.csdn.net/skykingf/article/details/45267517 Ubuntu 15.10发布了, ...
- java+Quartz实现定时任务
1.首先:导入quartz相关的jar包,这里我用的是maven构建的项目,pom.xml文件导入如下: <dependency> <groupId>org.quartz-sc ...
- [原]OpenGL基础教程(一)多边形绘制
1.opengl开发环境搭建 参考http://brothergrup.iteye.com/blog/1602471 2.为三角形填充颜色: 填充颜色函数为glColor(3/4)*(r,g,b) ...
- iPhone 上你可能还不知道的小技巧
用了这么久的 iPhone,这些技巧你可能都还不知道哦. 1.怎么用耳机切歌? 将耳机的话筒部位的中间(平时暂停用的,按一下)连按两下 即可. 连按两下,下一首. 连按三下,上一首. 2.摇一摇,相当 ...
- ASP.NET应用使用Nginx做负载均衡遇到的一个问题
客户在使用我们的某个应用遇到了性能瓶颈,于是决定增加多个节点减轻单节点的压力.部署方案: 1台Nginx服务器 2台应用服务器,每台两个站点(一个应用创建两个IIS站点.不同端口号) Nginx的配置 ...
- DOM元素查找
一.DOM是document的缩写,他是操作html文档的方法 二.常用查找元素的方法 直接 1.document.getElementById('标签的id') 在html中标签的id是不允许重 ...
- webpack构建工具快速上手指南
最近在研究react项目,接触到webpack打包工具.刚接触的时候一脸茫然,经过最近的学习,下面我来带大家开启webpack入门之旅. webpack是什么 webpack是近期最火的一款模块加载器 ...