Help With Corrupted Superblock

I am using openSUSE 13.1, 64-bit.

I recently tried a routine back up of my HDD with Clonezilla Live but the utility kept on giving me an error to the effect that it could not find a partition in the boot manager. (Or something like that…)

So I ran fsck with these results:

% fsck /dev/sda
fsck from util-linux 2.22.2
e2fsck 1.42.8 (20-Jun-2013)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks…
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

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>

I am not sure what needs to be done now in order to fix the problem. fsck suggests to run

e2fsck -b 8193 <device>

but what is this “<device>”?? And what is a “magic” number??

BTW everything seems to be working fine with my openSUSE installation. I seem to be able to access everything and I get no error messages when I start and use openSUSE…

We would need more specifics of the error message.

So I ran fsck with these results:

% fsck /dev/sda

 

That’s probably wrong already. You would, instead, need something like:


# fsck /dev/sda3

That assumes partition 3. Not knowing your disk, I cannot guess which partition to check.

You attempted “fsck” on the entire disk, instead of on just the part that holds the file system. That’s why you got those errors. As for the clonezilla errors - I’m not good at guessing without useful information.

You ran fsck on the whole hard disk.
But fsck is for checking a file system. A file system exists on a partition, not on the hard disk as a whole.

Use “fdisk -l” to see what partitions you have, and then run fsck on those partitions, f.e.:

fsck /dev/sda1

Notice the number there?

See also SDB:Basics of partitions, filesystems, mount points - openSUSE Wiki .

I am not sure what needs to be done now in order to fix the problem.

There is no problem. (other than a user error :wink: )
At least not in the output you posted.

No idea about your CloneZilla problem though.
Hard to tell anyway without any specific error message.

When in doubt about the partition layout on the disk you can use

fdisk -l

Note that is a lower case L not a one

My HDD is so organized:

  • sda1 swap
  • sda2 /
  • sda3 /home

This is the error message that I get when running Clonezilla Live:

Warning: The disk has bad sectors. This means physical damage on the disk surface caused by deterioration, manufacturing faults or another reason. The reliability of the disk may remain stable or degrade quickly. Use the --resque option to efficiently save as much data as possible.
Failed to save partition /dev/sda2

This is what I get when running fsck for every partition:

% fsck /dev/sda2
fsck from util-linux 2.22.2
e2fsck 1.42.8 (20-Jun-2013)
openSUSE_(/): clean, 515721/1313280 files, 3536201/5242880 blocks

% fsck /dev/sda3
fsck from util-linux 2.22.2
e2fsck 1.42.8 (20-Jun-2013)
openSUSE_(/home): clean, 7168/29089792 files, 2463019/116327424 blocks

% fsck /dev/sda1
fsck from util-linux 2.22.2
fsck: fsck.swap: not found
fsck: error 2 while executing fsck.swap for /dev/sda1

On 2014-07-05 22:46 (GMT) tb75252 composed:

> My HDD is so organized:
> * sda1 swap
> * sda2 /
> * sda3 /home

> This is the error message that I get when running Clonezilla Live:

>> Warning: The disk has bad sectors. This means physical damage on the
>> disk surface caused by deterioration, manufacturing faults or another
>> reason. The reliability of the disk may remain stable or degrade
>> quickly. Use the --resque option to efficiently save as much data as
>> possible.
>> Failed to save partition /dev/sda2

> This is what I get when running fsck for every partition:

>> % fsck /dev/sda2
>> fsck from util-linux 2.22.2
>> e2fsck 1.42.8 (20-Jun-2013)
>> openSUSE_(/): clean, 515721/1313280 files, 3536201/5242880 blocks

You could try again with the -f option if you don’t believe the report of bad
sectors.

>> % fsck /dev/sda3
>> fsck from util-linux 2.22.2
>> e2fsck 1.42.8 (20-Jun-2013)
>> openSUSE_(/home): clean, 7168/29089792 files, 2463019/116327424 blocks

>> % fsck /dev/sda1
>> fsck from util-linux 2.22.2
>> fsck: fsck.swap: not found
>> fsck: error 2 while executing fsck.swap for /dev/sda1

One does not use fsck on a swap partition. fsck is for checking filesystems.
Swap partitions do not have filesystems. Nothing on them needs to be saved.
New ones are quickly and easily created on new disks or partitions.

If your sda2 / partition really does have a problem, maybe it’s time for a
new HD, before you start finding bad sectors in your home/data partition. An
OS doesn’t usually need to be saved, only reinstalled. Your data is what
matters to save from a failing HD, before it’s too late.

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata *** http://fm.no-ip.com/

On 2014-07-06 00:46, tb75252 wrote:
>
> My HDD is so organized:
> * sda1 swap
> * sda2 /
> * sda3 /home
>
> This is the error message that I get when running Clonezilla Live:
>> Warning: The disk has bad sectors. This means physical damage on the
>> disk surface caused by deterioration, manufacturing faults or another
>> reason. The reliability of the disk may remain stable or degrade
>> quickly. Use the --resque option to efficiently save as much data as
>> possible.
>> Failed to save partition /dev/sda2

Well, it is recommending you to use the “–resque option”, it says
naught about using fsck.

> This is what I get when running fsck for every partition:
>> % fsck /dev/sda2
>> fsck from util-linux 2.22.2
>> e2fsck 1.42.8 (20-Jun-2013)
>> openSUSE_(/): clean, 515721/1313280 files, 3536201/5242880 blocks
>>
>> % fsck /dev/sda3
>> fsck from util-linux 2.22.2
>> e2fsck 1.42.8 (20-Jun-2013)
>> openSUSE_(/home): clean, 7168/29089792 files, 2463019/116327424 blocks

That only means that the filesystems are consistent, but nothing about
badsectors, because you are not testing for them.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

I did run Clonezilla Live with the --rescue option. Did not notice anything different in the way Clonezilla ran, i.e. got the same error message and /dev/sda2 was not saved.

So… there’s no Linux utility that can repair bad sectors?

I might have solved the problem…

  1. I booted up using a copy of System Rescue CD and went to the command prompt;
  2. I entered “e2fsck -cfpv /dev/sda2”, and when that finished running (it took a while)
  3. I ran “fsck /dev/sda2” and followed some prompts;
  4. I then backed up the HDD with Clonezilla Live and there were no error messages.

On 2014-07-06 05:36, tb75252 wrote:

> I did run Clonezilla Live with the --rescue option. Did not notice
> anything different in the way Clonezilla ran, i.e. got the same error
> message and /dev/sda2 was not saved.

You first said “–resque” - so which it is? Computers are not forgiving
with spelling errors.

Looking at the clonezilla web page, I find this note, with very little help:

http://drbl.org/faq/fine-print.php?path=./2_System/83_rescue_mode_for_clonezilla.faq#83_rescue_mode_for_clonezilla.faq

+++···········································
When I save an image, I see messages like “{ DriveReady Error }” or “{
DriveReady DataRequest Error }”, what can I do?

hda: possible failed opcode: 0xc8
dma_instr: status=0x41 { DriveReady Error }
hda: task_pio_intr: status=0x49 { DriveReady DataRequest Error }
io_all: errno = Input/output error(5)

It means that your hard drive has hardware issues, e.g. bad blocks.
You’d better to copy important data before you continue to use it. If
you want to use Clonezilla to save the image, you can try to enter
expert mode, choose “-q2” and “-rescue” (the rest of options can be
default ones) so that it can use the rescue mode of partclone to save
the image for you. However, this does not mean it always work. Good luck!
···········································+±

Notice that it is neither “–resque” nor “–rescue”, but “-rescue”, and
it has to be used in expert mode.

The clonezilla documentation I’m unable to find without booting the
live, but here there is a link:

http://sourceforge.net/projects/clonezilla/files/clonezilla_live_doc/QuickReference_Card_0.9.5/

It is obsolete, though, it Applies to Clonezilla v.1.2.12-10

But it says:

-rescue Continue reading past block read errors.

-q ntfsclone > partimage > dd
-q1 dd only
-q2 (default) partclone > partimage > dd

Well, that does not say that it will “solve somehow” bad block errors,
only that it will not stop and will continue working - which is what you
need.

(the full clonezilla doc is here:
http://www.clonezilla.org/clonezilla-live-doc.php)

The advanced options:

http://www.clonezilla.org/clonezilla-live/doc/01_Save_disk_image/advanced/09-advanced-param.php

> So… there’s no Linux utility that can repair bad sectors?

Repairing bad blocks is utterly impossible. Repairing bad blocks means
sending the disk back to a manufacturer so that it replaces the platter
surface, so forget it.

What is done is “bypassing” it. You put a notice in the road so that
cars skip the potholes.

For instance, you create a map of the badblocks, and reformat the device
telling the utility where the potholes are, and avoid them. The
resulting filesystem skips the holes.

Or, you cause a /write/ operation on the known holes. This causes the
disk firmware to re-map that particular bad sector to an area that was
reserved by the manufacturer for that purpose.

When I know that a disk has bad sectors, I intentionally write the
entire disk with something; zeroes, for instance. This finds and remaps
all bad sectors. Then I run a long SMART test for verification. If it
passes, perhaps I continue using the disk. If I see the number of bad
sectors increase, it goes to the garbage immediately.

On 2014-07-06 07:26, tb75252 wrote:
>
> I might have solved the problem…
>
> 1) I booted up using a copy of System Rescue CD and went to the command
> prompt;
> 2) I entered “e2fsck -cfpv /dev/sda2”, and when that finished running
> (it took a while)

-c This option causes e2fsck to use badblocks(8)
program to do a read-only scan of the device in
order to find any bad blocks. If any bad blocks
are found, they are added to the bad block inode
to prevent them from being allocated to a file
or directory. If this option is specified
twice, then the bad block scan will be done
using a non-destructive read-write test.

So, it maps the found bad sectors out.

What happens if a sector was used already by a file, huh? It does not
say… :wink:

I would recommend you run the long SMART test ASAP, then consider
“garbaging” the disk.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)