The NZ Linux Resource

[wailug] Re: ext2

Blair Harrison harrison at contact.net.nz
Tue Jan 21 12:57:32 NZDT 2003


On Mon, 20 Jan 2003 13:19:06 +1300
tony at access-info.co.nz wrote:

> Got a fun problem.
> Have a 40 gig HD one partition, ext2, hdb1 on a RH7.3.
> 
> Doing some swapping around of hardware, and placed this partition on
> another 7.3. Cam up with seek errors and other crap.
> 
> Then could not mount drive.
> Currently trying to fix it on a rh6.2
> 
> fsck /dev/hdb1 reports
> Couldn't find ext2 superblock, trying backup blocks...
> fsck.ext2 Bad magic number in super-block while trying to open
> /dev/hdb1 
> 
> Tells me to try 
> e2fsck -b 8193 <device>
> 
> I do but no luck
> 
> fdisk tells me this
> 
> /dev/hdb1 start 1 end 4865 blocks 39078081
> and sees a ext2 partition
> 
> Any help or ideas. I have a semi resent backup but would like to get
> some other stuff off the drive as well like isos, whole os's rh 6.2,
> 7.3, 8.0
> 
> tx in advance


You'll need to rebuild the superblock on the drive

http://user-mode-linux.sourceforge.net/sdotm.html near the bottom there
is a script that will do just that :(change /dev/hdb1 as necessary if
you're using a different drive)

backup_sblock=`mke2fs -n /dev/hdb1 | tail -2 | grep , | awk -F, '{print
$1}'` fsck.ext2 -b $backup_sblock /dev/hdb1

basically it'll run through the process of recreating the filesystem
without actually doing anything but it will pull out a superblock backup
location and use that to recreate it.



Cheers, 
	Blair

--- toH, HIvqa' Qun'a'wIj! nachwIjDaq 'obmaQ tu'lu'! ---

--------------------------------------------------------------------
To remove yourself from this list, email wailug-request at linux.net.nz
with "unsubscribe" in the body of the message.



More information about the WaiLUG mailing list If you have any questions or comments about this page, email the Webmaster
Design Copyright © 1998-2005 Linux.net.nz