bad superblock AFTER a tar restore

I’m working on an old HP machine with 11.3 on it. (YES i know but 11.3 was the latest version I could get to run on this machine and its a chairity case)!

To make a long stort short they let some kid have the root password and he blew the system away. I keep a good incremental backup so I didn’t think it would be a big deal to rebuild. Got the os on but when I restored the full backup it ate the superblock on the /home partition - that’s problem 1, how do I rebuild an ext4 superblock?

Problem 2 is how can a tar backup/restore crash a superblock in thefirst place???>:(

NOTE: ignore the signature block, Im running 12.1 now. Just havent updated it yet. :open_mouth:

I found a procedure for fixing a superblock problem with EXT4 here: HOWTO: Repair a broken Ext4 Superblock in Ubuntu

The example is for Ubuntu, but I don’t think it matters. You will need to do this using a LiveCD as you can’t fix it when the partition is mounted. I have a script that can help create a LiveUSB if the OLD PC supports such:

S.C.L.U. - SuSE Create Live USB - Version 1.02 - Blogs - openSUSE Forums

Thank You,

On your question “How can …”.

That is what I wonder also. I would think the file system was allready corrupted in the first place. Did you create a fresh file system on that partition before you restored? I guess yes, because it is the ultimate way to be sure that it is empty before you restore, but I ask nevertheless to be sure. If not, then do create the fs anew before you use tar to restore.

On 2011-12-19 04:06, jim7634 wrote:
> Problem 2 is how can a tar backup/restore crash a superblock in
> thefirst place???>:(

Chance. Maybe it was broken before, maybe it broke during writes. After
all, ext4 is new.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

It’s not that new.linux accepted it in 2008

Jim

It’s possible that the file system was corrupt before the backup but that means I don’t understand all I thought I understood about TAR.

It was my understanding that all tar did was copy the data from each file sequentially compresses it and writes it to the backup media (tape CD external HD, etc). Am I missing something? Under that senario I may get a corrupt file but it shouldn’t affect the superblock.

Did that, it would seem that the tarball itself is the culprit. See my post below. Thanks anyway.

Jim

No, you are not missing something. tar does just copy files, originaly to a tape (tar: Tape ARchiver), but also to a file (well, in Unix/Linux a tape is also a file, thus this is very logical). The compressing is only an extra, but does not change the principle.

Thus when you “untar”, you create the files and write their contents, just the same as every other program would create a file and write it’s contents.

Thus we have a chicken-egg problem here. When the fs was corrupt, how could tar have written anything? When the fs was OK, how could tar have corrupted it?

But to be sure there are no misunderstandings (we believing that you did the correct tar and you “thinking” that you did the correct* tar*), please post the tar statement you used. After all as disk (partition), like a tape, is also a file in Unix/Linux and you could have written to the partition instead of to the file system.

That was the first thing I did, and the second. It finally registered that the tarball was the culprit. See my post about what I thought I knew before I knew what I don’t know. Thanks though.

Jim

That was the first thing I did, and the second. It finally registered that the tarball was the culprit. See my post about what I thought I knew before I knew what I don’t know. Thanks though.

Jim

On 2011-12-19 17:16, jim7634 wrote:

> It’s not that new.linux accepted it in 2008

New.
And 11.3 is old.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2011-12-19 17:36, jim7634 wrote:

> Am I missing something? Under that senario I may
> get a corrupt file but it shouldn’t affect the superblock.

A superblock corruption may happen during a write operation of any program.
Just chance.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

You are today’s Rock Star.rotfl!

In actual fact one of the files was corrupt. Just to make it more fun the file that was actually in two locations.

the fix: I had to rebuild the system with a single partition, restore the data from the tarball. After that I created a new tarball and it failed at the bad file (I still don’t understand why it didn’t fail while creating the original tarball). I removed the bad file and tried to create another tarball – It turned out that that file was in two different directories:O. again removed it went through the tarball creation again with no problems. After that I started with my original plan and partitioned the disk as I wanted it, restored the corrected tarball and all was well – FINALLY.

To everybody who responded many many thanks.
Jim