博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux fix superblock not found
阅读量:4031 次
发布时间:2019-05-24

本文共 2240 字,大约阅读时间需要 7 分钟。

* Mistakes by Linux/UNIX Sys admin
* Buggy device driver or utilities (especially third party utilities)
* Power outage (very rarer on production system) due to UPS failure
* Kernel bugs (that is why you don’t run latest kernel on production Linux/UNIX system, most of time you need to use stable kernel release)

    Due to filesystem failure:

    • File system will refuse to mount
    • Entire system get hangs
    • Even if filesystem mount operation result into success, users may notice strange behavior when mounted such as system reboot, gibberish characters in directory listings etc

    So how the hell you are gonna Surviving a Filesystem Failures? Most of time fsck (front end to ext2/ext3 utility) can fix the problem, first simply run e2fsck – to check a Linux ext2/ext3 file system (assuming /home [/dev/sda3 partition] filesystem for demo purpose), first unmount /dev/sda3 then type following command :
    # e2fsck -f /dev/sda3
    Where,

    • -f : Force checking even if the file system seems clean.

    Please note that If the , e2fsck will terminate with a fatal error. However Linux maintains multiple redundant copies of the superblock in every file system, so you can use -b {alternative-superblock} option to get rid of this problem. The location of the backup superblock is dependent on the filesystem’s blocksize:

    • For filesystems with 1k blocksizes, a backup superblock can be found at block 8193
    • For filesystems with 2k blocksizes, at block 16384
    • For 4k blocksizes, at block 32768.

    Tip you can also try any one of the following command(s) to determine alternative-superblock locations:
    # mke2fs -n /dev/sda3
    OR
    # dumpe2fs /dev/sda3|grep -i superblock
    To repair file system by alternative-superblock use command as follows:
    # e2fsck -f -b 8193 /dev/sda3

    However it is highly recommended that you make backup before you run fsck command on system, use dd command to create a backup (provided that you have spare space under /disk2)
    # dd if=/dev/sda2 of=/disk2/backup-sda2.img

    If you are using Sun Solaris UNIX, see howto: .

    Please note that things started to get complicated if hard disk participates in software RAID array. Take a look at . This article/tip is part of , Continue reading rest of the Understanding Linux file system series (this is part III):

    转载地址:http://wrhbi.baihongyu.com/

    你可能感兴趣的文章
    POJ 2664 Prerequisites?(我的水题之路——选课)
    查看>>
    POJ 2665 Trees(我的水题之路——移树,POJ100题啦!)
    查看>>
    POJ 2840 Big Clock(我的水题之路——水,钟)
    查看>>
    POJ 2864 Pascal Library(我的水题之路——都来了么)
    查看>>
    POJ 2871 A Simple Question of Chemistry(我的水题之路——数列两数之差 )
    查看>>
    POJ 2909 Goldbach's Conjecture(我的水题之路——任一数为素数对之和)
    查看>>
    POJ 2924 Gauß in Elementary School(我的水题之路——n到m的连和)
    查看>>
    POJ 3006 Dirichlet's Theorem on Arithmetic Progressions(我的水题之路——加i个d后的第几个素数)
    查看>>
    POJ 3030 Nasty Hacks(我的水题之路——比较大小)
    查看>>
    POJ 3062 Celebrity jeopardy(我的水题之路——原样输出)
    查看>>
    POJ 3077 Rounders(我的水题之路——高精度四舍五入)
    查看>>
    POJ 3086 Triangular Sums(我的水题之路——三角数累加)
    查看>>
    POJ 3096 Surprising Strings(我的水题之路——重点,D-pairs)
    查看>>
    POJ 3100 Root of the Problem(我的水题之路——取A^N最接近B的A)
    查看>>
    POJ 3117 World Cup(我的水题之路——世界杯平局数目)
    查看>>
    POJ 3158 Kickdown(我的水题之路——齿轮盒子,读题失败)
    查看>>
    POJ 3183 Stump Removal(我的水题之路——高峰烧火,在线判断)
    查看>>
    POJ 3224 Go for Lab Cup!(我的水题之路——赢的场数最多)
    查看>>
    POJ 3300 Tour de France(我的水题之路——车轮角速度最大)
    查看>>
    POJ 3302 Subsequence(我的水题之路——子串判断)
    查看>>