unable to read superblock

unable to read superblock

Post by Huang Zhong-Yu » Tue, 21 Jan 1997 04:00:00



Does anyone know how to rescure (or mount) a corrupted filesystem with
the following message:

unable to read superblock.

I believe the hdisk is still working properly.

Thanks in advance...

Tiong Guan

 
 
 

unable to read superblock

Post by Thijs_Po » Wed, 22 Jan 1997 04:00:00



Quote:Zhong-Yuan) writes:
> Does anyone know how to rescure (or mount) a corrupted filesystem with
> the following message:

> unable to read superblock.

> I believe the hdisk is still working properly.

> Thanks in advance...

Find out which raw device contains the filesystem. (/dev/rhd... see
/etc/filesystems).
Block 1 is the superblock, and block 31 contains a copy of it.
You could extract block 31 with dd or a little C program, and copy it
over block 1, also with dd (I do not remember the exact options, it is
some time ago I did this) or with the following C program.
You can then run fsck over it and the filesystem may mount again.

In any case, BE VERY CAREFUL !!
Good luck, Thijs.

/***************************************************

   putblock.c
   puts a block of data into a file

   usage: putblock blocknr file < blockfile

   Thijs Post, 07-Nov-1994

***************************************************/

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>

#define BLOCKSIZE 4096

void MyUsage(void);

char block[BLOCKSIZE];

int main( int argc, char *argv[] ) {

  int blocknr;
  char *file;
  int fd;
  int bytesread, byteswritten;

  /* check arguments */
  if( argc != 3 ) { MyUsage(); }
  sscanf(argv[1],"%d",&blocknr);
  file = argv[2];

  /* read data from stdin */
  bytesread = fread( block, 1, BLOCKSIZE, stdin );
  if( bytesread != BLOCKSIZE ) {
    fprintf(stderr,"fread returned %d, should be BLOCKSIZE\n",bytesread);
    exit(2);
  }

  /* open file */
  if( (fd = open(file,O_WRONLY,0)) <= 0 ) {
    fprintf(stderr,"Could not open %s\n",file);
    exit(2);
  }

  /* seek the block */
  if( lseek(fd,blocknr*BLOCKSIZE,SEEK_SET) < 0 ) {
    fprintf(stderr,"Lseek failed\n");
    exit(2);
  }

  /* write it */
  byteswritten = write(fd,block,BLOCKSIZE);
  fprintf(stdout,"bytes written: %d\n",byteswritten);

  /* close the file */
  close(fd);

Quote:}

void MyUsage(void) { /* writes Usage message to stderr and exits */
  fprintf(stderr,"Usage: putblock blocknr file < blockfile\n");
  exit(1);

Quote:}

--

Systems group                                       fax: +31 20 525 5788
Faculty of Mathematics, Computer Science, Physics and Astronomy
Univ. of Amsterdam, Valckenierstraat 65, NL-1018 XE Amsterdam, The Netherlands

 
 
 

unable to read superblock

Post by Schwitter Rued » Wed, 22 Jan 1997 04:00:00



> Does anyone know how to rescure (or mount) a corrupted filesystem with
> the following message:

> unable to read superblock.

> I believe the hdisk is still working properly.

> Thanks in advance...

> Tiong Guan


try the fsck (FileSystemCheck). Normaly, when there is a SuperBlock
wrong, you can fix ist with the -b Option. See the man-pages

--
Regards Ruedi

----------------------------------------------------------------

Haselstrasse                            Fax: ++41 56 205 54 66
CH-5400 Baden
---------------------------------------------------------------

 
 
 

unable to read superblock

Post by Huang Zhong-Yu » Thu, 23 Jan 1997 04:00:00


Thank you for those who had replied to me.
Any way the IBM engineer said the hard disk was corrupted.
Nonething can be done to save the data.
He evantually changed a new hard disk for me.
Luckily (!?) it is still under warrenty (just 3 months old).

Anybody have any recommendation for IBM compatible SCSI HDD
(internal or external). IBM original just too ex.

Regards,
Tiong Guan

 
 
 

1. unable to read superblock

I am running Linux 0.99p15 on 2 Tahiti2 1Gig optical disks.  I recently left
both disks in the drives when I rebooted under DOS.  Apparently some operation
under DOS tried to write to the disks and caused several files on my
main disk (/dev/sda1) to become corrupted.  These were easily recovered.
My problem is that the second disk (/dev/sdb1) which was mounted as
a swapdisk and temporary space under /tmp was corrupted so that I can't
mount it.  The errors that were occuring when this device was in the fstab
file were as follows:
  scsi0: resetting for second half of retries
  scsi disk error: host 0 id 1 lun 0 return code=18000002
  Current error: sd 811 :Sense key Medium error
  Ax f0 00 03 00 00 04 01 0a ...... (didn't write this down exactly)
  scsi disk I/O error: dev 0811, sector 2
  fsck.ext2: unable to read Super block
  fsck failed...please reboot.

I was hoping that there was some way to restore/repair the sectors
that would allow the disk to be mounted. Any help would be greatly
appreciated.


2. Does this OS exist?

3. ***LINUX WON'T BOOT...unable to read superblock

4. Trust your business to Linux???????--New Identity

5. Unable to read superblock (TERMINATED)

6. Loopback question

7. BIG problem: unable to read superblock

8. How to obtain IP by hostname?

9. Unable to read superblock.

10. EXT2-fs unable to read superblock

11. unable to read superblock??help

12. ??????-fs: unable to read superblock.......

13. kernel panic, unable to read superblock