Recovering data after filesystem errors

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

Recovering data after filesystem errors

Postby firestk on Mon Dec 30, 2013 2:03 pm

Changed the title of this post because, while I'm curious about this sudden crash (one minute I have an awesome computer <Mint seemed really great>, next minute it's useless), my pressing need is to rescue my data if possible.

Previously this post was titled: error: attempt to read or write outside of disk `hd0'. I looked at the other post with this subject viewtopic.php?f=46&t=144889]
but I'm not getting a grub> prompt as mentioned in that post and every other post I can find on the error. So...

Specs:
New Lenovo Thinkpad x1 in June, in October put then new/current Mint on it... version 14(or 16, which ever was new/current) Cinnemon 64bit (I think). Dual boot.

What happened:
1) Tried moving files onto usb drive, it was too full so I deleted some and emptied the trash, moved files onto drive. Unmounted the drive. Tried to eject it but it wouldn't, since it was unmounted I pulled the drive anyway.
2) Tried saving a text file to /home/alec/somewhere (just normal subdirectory of my user account) but got an error about trying to write to read-only disk.
3) I think the gui became inactive then because I wasn't able to close any program or shutdown the computer properly. So I held the computer's power button to force shutdown.
4) That is was the end. Not able to boot anymore into Mint or Windows. I get the normal os selection menu, but when I choose Mint I get the following (and w/Windows it starts but fails and then also brings up the following, or maybe it goes back to os selection menu)
IMAG0760.jpg

Whether I click a key or stare at the screen for a long time I get this:
IMAG0764.jpg

From there I can't find any files from the normal file system and the directory structure does not look like what I'm accustomed to.

Now:
I'm running Mint off a usb drive on this computer.
I can access files saved on the Windows partition.
I cannot access files on the Linux partition:
Screenshot.png


I tried:
Code: Select all
mint@mint ~ $ sudo fsck /dev/sda7
fsck from util-linux 2.20.1
e2fsck 1.42.5 (29-Jul-2012)
/dev/sda7: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? yes
fsck.ext4: unable to set superblock flags on /dev/sda7


/dev/sda7: ********** WARNING: Filesystem still has errors **********


And don't know what else to do. My Linux/commandline skills aren't great, but I'm not inept or completely new either.

Thanks in advance. ~Alec
Last edited by firestk on Tue Dec 31, 2013 7:24 pm, edited 3 times in total.
firestk
Level 1
Level 1
 
Posts: 5
Joined: Mon Dec 30, 2013 12:53 pm

Linux Mint is funded by ads and donations.
 

Re: error: attempt to read or write outside of disk `hd0'

Postby jungle_boy on Mon Dec 30, 2013 7:44 pm

Run Gparted
Take a snapshot
Post here.
LM16 Cinnamon (PC); LM14 Cinnamon with AMD Catalyst (notebook)
HP Pavilion g4-1316br, AMD Quad Core, 1,5 GHz, Radeon 6520G/7450M,
Image
Linuxcounter Registered User #506065 (2008)
User avatar
jungle_boy
Level 6
Level 6
 
Posts: 1171
Joined: Thu Aug 19, 2010 2:51 pm
Location: Amazon Rain Forest, Brazil

Re: error: attempt to read or write outside of disk `hd0'

Postby firestk on Mon Dec 30, 2013 8:07 pm

Thank you! Here it is...

gparted.png
firestk
Level 1
Level 1
 
Posts: 5
Joined: Mon Dec 30, 2013 12:53 pm

Re: error: attempt to read or write outside of disk `hd0'

Postby jungle_boy on Mon Dec 30, 2013 8:58 pm

What are doing a windows file partition (fat32) between linux partitions?

The partitions are out of order (sda7; sda6; sda5), the correct would be sda5, sda6, sda7

Backup all your data and reinstall Linuxmint from scratch; fix partitions as follows:

sda1 SYSTEM_DRV
sda2 windows7
sda3 extended; 31 GB
sda5 logic for linux-swap, up to 2 GB
sda6 logic for LM, ext4, 19GB
sda7 logic for test another distros, ext4, 10GB
sda4 ntfs (not fat32), for recovery data, 30GB

I think so.
LM16 Cinnamon (PC); LM14 Cinnamon with AMD Catalyst (notebook)
HP Pavilion g4-1316br, AMD Quad Core, 1,5 GHz, Radeon 6520G/7450M,
Image
Linuxcounter Registered User #506065 (2008)
User avatar
jungle_boy
Level 6
Level 6
 
Posts: 1171
Joined: Thu Aug 19, 2010 2:51 pm
Location: Amazon Rain Forest, Brazil

Re: error: attempt to read or write outside of disk `hd0'

Postby firestk on Mon Dec 30, 2013 9:03 pm

I don't know how to get the data off -- when I boot of usb drive I can't mount the partition (see screenshot in original post) and when I go in via commandline without the usb sda7 is empty and /home/alec doesn't exist.
firestk
Level 1
Level 1
 
Posts: 5
Joined: Mon Dec 30, 2013 12:53 pm

Re: Saving data after filesystem errors

Postby firestk on Tue Dec 31, 2013 7:23 pm

and when I try:
fsck -p /dev/sda7
it outputs
Code: Select all
fsck from util-linux 2.20.1
/dev/sda7: recovering journal
/dev/sda7: Superblock needs_recovery flag is clear, but journal has data.
/dev/sda7: Run journal anyway

/dev/sda7: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
   (i.e., without -a or -p options)


Running it without -p gives me the response I pasted in the original post:
Code: Select all
fsck.ext4: unable to set superblock flags on /dev/sda7


/dev/sda7: ********** WARNING: Filesystem still has errors **********


At a loss on what to do. In over my head but I'm used to that so please instruct...
firestk
Level 1
Level 1
 
Posts: 5
Joined: Mon Dec 30, 2013 12:53 pm

Re: Recovering data after filesystem errors

Postby WharfRat on Wed Jan 01, 2014 3:39 am

firestk,

Try to recover an alternate superblock. Open the terminal and
Code: Select all
sudo -i

Code: Select all
mke2fs -n /dev/sda7

You will get a return of something like
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, etc.

Now try the first or second block
Code: Select all
e2fsck -b 98304 /dev/sda7

Code: Select all
reboot


Unfortunately I have never heard of a successful recovery with that error, but you never know.

Good luck :wink:
Image
User avatar
WharfRat
Level 10
Level 10
 
Posts: 3122
Joined: Thu Apr 07, 2011 8:15 pm

Re: Recovering data after filesystem errors

Postby firestk on Sun Jan 05, 2014 9:44 pm

Not sure about the cause (forced shutdown might well have been it) or the fix yet (out of ideas on that)...
Code: Select all
ddrescue -r3 /dev/hda2 /dev/hdb2 logfile
e2fsck -v -f /dev/hdb2

from https://help.ubuntu.com/community/DataR ... m_or_drive
Was able to rescue the data.
firestk
Level 1
Level 1
 
Posts: 5
Joined: Mon Dec 30, 2013 12:53 pm

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: austin.texas, Google [Bot], tinca and 11 guests