Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
partition failure after power loss
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
temporary_user
n00b
n00b


Joined: 26 Aug 2012
Posts: 37

PostPosted: Thu Jul 25, 2013 5:22 pm    Post subject: partition failure after power loss Reply with quote

Hello!

After a recent power loss my Gentoo system stopped booting and displayed kernel panic instead. It turns out that my root partition can't be mounted. I've used SystemRescueCD to scan partition for errors while it was unmounted, but I got a "bad superblock" error. I've already tried to use backup superblocks, but it didn't help.

Code:
Model: ATA OCZ-VERTEX4 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name
Flags
 1      1049kB  316MB   315MB   ntfs         Basic data partition hidden, diag
 2      316MB   420MB   105MB   fat32        EFI system partition boot
 3      420MB   555MB   134MB                Microsoft reserved partition msftres
 4      555MB   80.5GB  80.0GB  ntfs         Basic data partition
 5      80.5GB  128GB   47.5GB



Code:
root@sysresccd /root % mke2fs -n /dev/sda5
mke2fs 1.42.7 (21-Jan-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
2899968 inodes, 11597568 blocks
579878 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
354 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208, 4096000, 7962624, 11239424


When I use e2fsck with blocks 32768 to 29491 it gives me "bad magic number in superblock", other values return "invalid argument".

Code:
root@sysresccd /root % e2fsck -b 32768 /dev/sda5
e2fsck 1.42.7 (21-Jan-2013)
e2fsck: Bad magic number in super-block while trying to open /dev/sda5

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>

root@sysresccd /root % e2fsck -b 819200 /dev/sda5
e2fsck 1.42.7 (21-Jan-2013)
e2fsck: Invalid argument while trying to open /dev/sda5

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>



Thank you in advance for all your help,
temporary_user
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3601
Location: USA

PostPosted: Thu Jul 25, 2013 6:44 pm    Post subject: Reply with quote

Check your dmesg (1) to see if Linux is having problems reading your SSD... It may have croaked :(
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
temporary_user
n00b
n00b


Joined: 26 Aug 2012
Posts: 37

PostPosted: Thu Jul 25, 2013 10:10 pm    Post subject: Reply with quote

I guess the disk is fine (except for this one partition) - right now I'm writing from Windows Server 2012, which is sda4.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31370
Location: 56N 3W

PostPosted: Thu Jul 25, 2013 10:34 pm    Post subject: Reply with quote

temporary_user,

Code:
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208, 4096000, 7962624, 11239424


And
Code:
Block size=4096 (log=2)
need to be read together when you specifiy an alternate superblock.

Disk software works with 1k blocks, but alternate superblock numbers are in filesystem blocks, in this case 4k.
extX can also use 1k and 2k filesystem blocks.

It is documented but not where you would expect. Read man mount, ext2 options, sb=

Having pointed to that, before you use fsck, try
Code:
mount -o ro,sb=131072 /dev/sda5 /mnt/gentoo

You don't want to mount a damaged fs rw.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
temporary_user
n00b
n00b


Joined: 26 Aug 2012
Posts: 37

PostPosted: Fri Jul 26, 2013 8:35 am    Post subject: Reply with quote

I've tried multiplying this values by four, but I get the same "bad magic number in superblock" error.
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3601
Location: USA

PostPosted: Fri Jul 26, 2013 8:54 pm    Post subject: Reply with quote

I think the e2fsck is fine using the block numbers straight from mke2fs -n, but mounting requires the offset correction. Also what happens if you skew the block by one... and are you sure you made the filesystem initially with 4K blocks?

Did you check your dmesg log after trying to read the disk? Did the kernel report issues? It might have been a few bad sectors here and there, just want to make absolutely sure because reading a different partition doesn't mean the sectors in the partition you're having trouble with are still good.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
temporary_user
n00b
n00b


Joined: 26 Aug 2012
Posts: 37

PostPosted: Thu Aug 15, 2013 5:25 pm    Post subject: Reply with quote

Here's what happens when I try to mount it with
Code:
mount  -o ro,sb=131072 /dev/sda5 /mnt/gentoo

Code:
[  954.697516] REISERFS warning (device sda5): super-6502 reiserfs_getopt: unknown mount option "sb=131072"
[  954.697831] reiser4[mount(3004)]: parse_options (fs/reiser4/init_super.c:253)[nikita-2307]:
WARNING: Unrecognized option: "sb=131072"
[  954.698308] EXT3-fs (sda5): error: can't find ext3 filesystem on dev sda5.
[  954.698879] EXT2-fs (sda5): error: can't find an ext2 filesystem on dev sda5.
[  954.699444] EXT4-fs (sda5): VFS: Can't find ext4 filesystem
[  954.699919] SQUASHFS error: Can't find a SQUASHFS superblock on sda5
[  954.700261] FAT-fs (sda5): Unrecognized mount option "sb=131072" or missing value
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum