Superblock problem.


Recommended Posts

To make a long story short.

I have one ext2 drive with a corrupt superblock (trusted partition magic too much :angry:).

I have another ext2 drive with linux on, as well as a ntfs drive with Windows.

But I have some really important data on the corrupt drive.

fdisk -l

Disk /dev/hda: 120.0 GB, 120000000000 bytes
255 heads, 63 sectors/track, 14589 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1           4       32098+  de  Dell Utility
/dev/hda2   *           5       12497   100350022+   7  HPFS/NTFS
/dev/hda3           12498       14589    16803990    f  W95 Ext'd (LBA)
/dev/hda5           12498       13060     4522266   83  Linux
/dev/hda6           13061       14334    10233373+  83  Linux
/dev/hda7           14335       14398      514048+  82  Linux swap
/dev/hda8           14399       14589     1534176    b  W95 FAT32

mount /dev/hda6 /media/hda6 -t ext2
mount: wrong fs type, bad option, bad superblock on /dev/hda6,
       or too many mounted file systems

e2fsck -b 8193 /dev/hda6
e2fsck 1.35 (28-Feb-2004)
e2fsck: Bad magic number in super-block while trying to open /dev/hda6

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

Please help! And...don't leave any sarcastic comments :whistle:.

Link to comment
https://www.neowin.net/forum/topic/285232-superblock-problem/
Share on other sites

You could try a mke2fs -S on that partition which will rebuild the superblock. This may be a bit dangerous. Or, you could do a mke2fs -n on the drive which will display what the program would do if it created a new filesystem, but it doesn't write anything to disk. This would tell you the most likely place that the superblock backups are stored (yes, there are multiple copies of the superblock on an ext2/3 partition). You can use this info to then do a e2fsck -b <location of superblock backup>

mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1281696 inodes, 2558343 blocks
127917 blocks (5.00%) reserved for the super user
First data block=0
79 block groups
32768 blocks per group, 32768 fragments per group
16224 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

So...what do I do to restore a backup superblock now?

e2fsck -b 32768 /dev/hda6

e2fsck 1.35 (28-Feb-2004)

e2fsck: Bad magic number in super-block while trying to open /dev/hda6

The superblock could not be read or does not describe a correct ext2

filesystem. If the device is valid and it really contains an ext2

filesystem (and not swap or ufs or something else), then the superblock

is corrupt, and you might try running e2fsck with an alternate superblock:

e2fsck -b 8193 <device>

When I run e2fsck -n /dev/hda6 gives me lots of errors, for example.

Inode 545 was part of the orphaned inode list. IGNORED.

Deleted inode 546 has zero dtime. Fix? no

Deleted inode 547 has zero dtime. Fix? no

Deleted inode 548 has zero dtime. Fix? no

Inode 549 has imagic flag set. Clear? no

Inode 550 is in use, but has dtime set. Fix? no

Inode 550 has imagic flag set. Clear? no

Inode 550 has compression flag set on filesystem without compression support. Clear? no

Inode 550 has INDEX_FL flag set but is not a directory.

Clear HTree index? no

Illegal block #0 (4261413117) in inode 597. IGNORED.

Illegal block #1 (16580671) in inode 597. IGNORED.

Illegal block #2 (4193792) in inode 597. IGNORED.

Illegal block #3 (4261413117) in inode 597. IGNORED.

Illegal block #4 (16580671) in inode 597. IGNORED.

Illegal block #5 (4193792) in inode 597. IGNORED.

Illegal block #6 (4261413117) in inode 597. IGNORED.

Illegal block #7 (16580671) in inode 597. IGNORED.

Illegal block #8 (4193792) in inode 597. IGNORED.

Illegal block #9 (4261413117) in inode 597. IGNORED.

Illegal block #10 (16580671) in inode 597. IGNORED.

If I run e2fsck on the selected device, will this fix my problem? This won't format or remove anything..right?

Please help, as I have really important data on the disk.

dumpe2fs to a text file give me the following:

Filesystem volume name: <none>

Last mounted on: <not available>

Filesystem UUID: d6700100-510d-450f-9936-2268e4685f49

Filesystem magic number: 0xEF53

Filesystem revision #: 1 (dynamic)

Filesystem features: filetype sparse_super

Default mount options: (none)

Filesystem state: clean with errors

Errors behavior: Continue

Filesystem OS type: Linux

Inode count: 1281696

Block count: 2558343

Reserved block count: 127917

Free blocks: 2518114

Free inodes: 1281696

First block: 0

Block size: 4096

Fragment size: 4096

Blocks per group: 32768

Fragments per group: 32768

Inodes per group: 16224

Inode blocks per group: 507

Filesystem created: Thu Feb 17 20:12:46 2005

Last mount time: n/a

Last write time: Thu Feb 17 20:12:46 2005

Mount count: 0

Maximum mount count: 30

Last checked: Thu Feb 17 20:12:46 2005

Check interval: 15552000 (6 months)

Next check after: Tue Aug 16 21:12:46 2005

Reserved blocks uid: 0 (user root)

Reserved blocks gid: 0 (group root)

First inode: 11

Inode size: 128

Default directory hash: tea

Directory Hash Seed: afff1a91-eb12-42fe-b094-98480e5e5b27

and then lots of numbers, if it would help, I will uplaod it somewhere. but the text-file is 10 mb.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Was it too much to ask to show the icon in this article?
    • Frankly, I blame whoever is writing such articles. "A big improvement/update and/or new feature is now available to everyone! Also, use this unofficial tweak tool to enable it because it actually isn't available to you yet officially and might not in fact even be entirely ready or whatever, hence why it is perhaps not enabled for you*. But it's great and you should enable it!" I mean there's nothing wrong with sharing info about some feature you might need to enable via unofficial means, of course. It's just that these articles tend to essentially end up being two news pieces in one, and one of them tends to be a bit misleading. (*Yes, yes, the "it's a controlled rollout!" thing. Not a fan of that one either. The argument, not the actual rollout.)
    • Thank you. Will do. I read in the release notes that editor config might be at play here.
    • Actually, I think even Microsoft doesn't know how to control it
    • OpenAI is making Codex more useful in Chrome and the cloud by Pradeep Viswanathan OpenAI's Codex now has more than 5 million users, up nearly 4x from earlier this year. To further accelerate Codex's growth among developers, OpenAI today announced that it has agreed to acquire Ona, a company that builds secure cloud execution and orchestration technology for developers. Ona will enable developers to run Codex with persistent and controlled cloud infrastructure for long-running agentic workflows. Right now, most Codex execution happens locally on developers' laptops and PCs, and the agents work continuously for hours. Through Ona, OpenAI aims to make Codex agents keep working for days without being tied to a user’s local machine or an active session. This will be an important capability for enterprises that want to deploy AI agents in production while maintaining control over infrastructure, data, security boundaries, credential scope, logging, and review workflows. Like any acquisition, the deal is still subject to customary closing conditions, including regulatory approvals. Until the deal closes, OpenAI and Ona will continue to operate as separate companies. After closing, Ona’s team will join the Codex team to improve developer workflows. Alongside the Ona acquisition announcement, OpenAI today introduced a few Codex updates. Developers can now save Codex rate limit resets and use them later instead of losing them when they are not needed immediately. OpenAI is also adding a referral option where users can invite a friend to Codex and get a saved rate limit reset. OpenAI today also announced a developer mode for browser use in Chrome and the Codex in-app browser. With this mode, Codex can use the Chrome DevTools Protocol to debug web apps, inspect pages, and work more directly with browser-based development workflows. Developers can use this when they want Codex to profile JavaScript, inspect console output and network traffic, examine web page states including the DOM and applied styles, and more.
  • Recent Achievements

    • One Month Later
      Jamswaz earned a badge
      One Month Later
    • Week One Done
      Jamswaz earned a badge
      Week One Done
    • Rookie
      Marzoid went up a rank
      Rookie
    • Community Regular
      coch went up a rank
      Community Regular
    • One Year In
      slackerzz earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      509
    2. 2
      PsYcHoKiLLa
      186
    3. 3
      +Edouard
      157
    4. 4
      Steven P.
      83
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!