LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-20-2009, 06:33 PM   #16
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,042

Rep: Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914

Quote:
Originally Posted by i92guboj View Post
PS: Just for future reference, note that this is the reason why it's a very good thing to save a note on your drawer with the locations of the backups of your superblocks, each time that you mkfs a new filesystem.
No need for that or the procedure linked to - " mkfs -n /dev/<whatever>" will show the superblocks that would be used (using defaults).
Hopefully anybody that doesn't allow the software to pick the blocksize would remember they did it, and also add that to the command.
 
Old 03-20-2009, 08:08 PM   #17
ste85
LQ Newbie
 
Registered: Jun 2005
Distribution: SUSE and Debian
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
I don't think file recovery is any riskier than attempting to recover the superblock or the partition table.
I've used file recovery utilities before, and always ended up with hundreds of files corrupt, incomplete, etc... just to search for one single html file.
If I were to do that for 80GB of data, it would be a nightmare!
What I still hope for is recovery of the orginal file structure.


Quote:
If you have really valuable data, then just get the drive to a data recovery specialist.
That's exactly what I intended to do, if only I had a clue about how to contact such a person (see earlier posts #7, #9 and #11) -> please do suggest something about that too!


Quote:
That's space reserved for the superuser, which has nothing to do with the superblock.
"Space reserved for the superuser" is space that is not directly used by me? So, not actually "_my_" data, but operating system data?
Is this a contiguous space where dd would begin to write? That would practically "save me", right? (assuming partition size, writing speed, and my reaction time as I reckoned before...)

Last edited by ste85; 03-20-2009 at 08:16 PM.
 
Old 03-20-2009, 08:35 PM   #18
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by ste85 View Post
"Space reserved for the superuser" is space that is not directly used by me? So, not actually "_my_" data, but operating system data?
It's just space reserved for the root user. By default a 5%. That means that, if a given fs has a size of 100mb, then you can store at most 95mb on it. The rest of the space will not be available for the regular users, and you can only write that remaining space if you are logged in as root.

Quote:
Is this a contiguous space where dd would begin to write?
I never looked into how this is implemented, but I am almost sure that it's not tied to any concrete region of the disk, and, even more, I don't think that the space is pre-allocated or something like that. So, if my theory is correct, then this will not save you. However, as said, I am not sure about this. Maybe someone else around can answer this.

syg00, thanks for the tip, I always wondered about that.
 
Old 03-20-2009, 09:49 PM   #19
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,042

Rep: Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914
As suggested above, I always take an image prior to attempting recovery. Then it doesn't matter what else goes wrong (work on the image). I'd be looking to do a fsck using a backup superblock - try several in need. Then you might want to look at "fsck.ext3 -S ..." - note the warnings in the manpage (less of an issue on an image of the data). I have tested this with a partially zeroed partition in the past, and got all data back. The caveat is that it was a new partition with only a few (new, non fragmented) files, so may not have been truly representative.
 
Old 03-20-2009, 10:04 PM   #20
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
Post #15 gives you your best approach to recovering from your particular problem, but more than likely you will be reading some hex; you'll have to find one of those copies of the superblock, and you'll have to find it exactly. When you find it approximately (which you will using the technique set forth in post 15) then you can use dd to copy off a relevant section of the HD to a file, then examine that file using a hex editor. This should let you zoom in on the exact start of the copy of the superblock.

You will only get a completely accurate map of the copies if the file you format on loopback is identically the size of the partition that you lost; you are unlikely to be that lucky, so you'll be casting around a bit to find it.

I doubt that testdisk will work, but you might try it.

For future reference, I ALWAYS use dd to image my boot block on all hard drives. Then, if I do something like you did, I can just use dd to put the bootblock (and hence partition table) back. Once I have restored that, testdisk or other recovery software will work.

edit: On further consideration, I do believe that ext2/3 will put those backup copies on power of 2 block boundaries in the partition. So you should be able to find one or more without too much trouble. Also, you might find yourself reconstructing at least part of your partition table manually, in order to get enough system together for fsck to work...not sure.

Last edited by jiml8; 03-20-2009 at 10:13 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lilo says, "L 01 01 01" and fdisk says, "Unable to seek on /dev/hda1" clausawits Linux - General 3 12-31-2007 10:33 PM
C Drive "/dev/hda1" accidently used in dd command at "of=" switch M D Linux - Software 4 04-26-2007 09:56 AM
How do I switch the labels "/dev/sda1" with "/dev/sda3" vonst Linux - General 10 05-27-2006 11:48 PM
What are "/dev/hde" and "/dev/hdf" in #fdisk -l b0nd Linux - Newbie 1 03-31-2006 10:09 PM
How can I recover my RedHat if it BOOTs to a "Kernel Panic" error and stop running? yuzuohong Linux - General 5 12-05-2002 11:39 PM


All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration