LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-04-2015, 01:34 PM   #91
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477

I have an idea but not sure about the success rate. Instead of running e2fsck to reconstruct the superblock using backup superblock why can't we try mounting LV with backup superblock?

Basically this is what you have to do, perform pvcreate, vgcfgrestore and vgchange as you did yesterday. To find the superblock run dumpe2fs:

Code:
dumpe2fs /dev/mapper/VolGroup00-LogVol02 | less
scroll down where it shows backup superblock.

Now try mounting it as follows:

Code:
mount -t ext3 -sb <backup-superblock> /dev/mapper/VolGroup00-LogVol02 /newdisk
I thought it is worth giving a try before you run e2fsck on the disk.

Note: You will have multiple backup superblock try couple of them and see if you get any result
 
Old 05-04-2015, 01:53 PM   #92
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Unfortunately, dumpe2fs will fail because the primary super block is missing, but testdisk will report the backup super block locations if you run the "Advanced" (Filesystem utils) action and then select "Superblock". That number will be in filesystem blocksize units, so it needs to be multiplied by 4 (typically) to convert to the 1K block size units needed by the mount command.

I just gave that a try, but could not mount the filesystem if the root directory was overwritten.

Last edited by rknichols; 05-04-2015 at 02:01 PM.
 
1 members found this post helpful.
Old 05-04-2015, 02:28 PM   #93
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Yes you are right. What about mke2fs -n, that will give an idea where backup superblocks are. This is something which has to be tried with caution, if command mke2fs run without -n switch it will end up formatting the partition.
 
1 members found this post helpful.
Old 05-04-2015, 02:59 PM   #94
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
I even tried mkfs.ext3 with the "-S" and "-b 4096" options to rewrite the super blocks and group descriptors, and I still didn't get a filesystem that I could mount. It makes sense. The kernel can't do much with a filesystem that lacks its root directory. The only way I got anything recoverable was by letting fsck.ext3 "do its thing".
 
Old 05-04-2015, 03:28 PM   #95
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
Thanks a lot for all these hints! I will try them shortly.
 
Old 05-04-2015, 03:37 PM   #96
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
I started by doing a deep search with Testdisk. Still at the beginning with following results.
ext4 surprised a little.
Attached Thumbnails
Click image for larger version

Name:	Testdisk_deep_search_start.png
Views:	18
Size:	25.8 KB
ID:	18364  
 
Old 05-04-2015, 04:12 PM   #97
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
I also went through all backup super blocks recommended by mke2fs -n with e2fsck -n -b, but all checks reported just
e2fsck: Bad magic number in super-block while trying to open /dev/mapper/VolGroup00-LogVol02

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>
 
Old 05-04-2015, 04:14 PM   #98
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
That looks like the result you get if you choose the "Analyze" (Analyse current partition structure ...) function rather than the "Advanced" (Filesystem Utils) function. Filesystem Utils should be essentially instantaneous in detecting the ext3 filesystem.
 
Old 05-04-2015, 04:17 PM   #99
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by vpp View Post
I also went through all backup super blocks recommended by mke2fs -n with e2fsck -n -b, but all checks reported just
e2fsck: Bad magic number in super-block while trying to open /dev/mapper/VolGroup00-LogVol02
Did you multiply those numbers by 4? mke2fs reports in fs block size units (typically 4K). The mount command wants 1K block size.

[EDIT] Oops, sorry. You were talking about e2fsck, not mount. Really, e2fsck should find the backup super blocks on its own.

Last edited by rknichols; 05-04-2015 at 04:19 PM. Reason: Oops
 
Old 05-04-2015, 04:19 PM   #100
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
Did I need to multiply the reported backup locations also for e2fsck command?
 
Old 05-04-2015, 04:21 PM   #101
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
Oops sorry, I didn't read your message till the end...
 
Old 05-04-2015, 04:27 PM   #102
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
I am ready to give the final command for this problematic hard disk. After getting whatever out of it, I will then initialize it for traditional use.
 
Old 05-04-2015, 04:31 PM   #103
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
That's about where I am, too. Something other than the simple removal of the LVM structure went on. What's left doesn't seem recoverable. Sorry things didn't work out better.
 
Old 05-04-2015, 04:33 PM   #104
vpp
Member
 
Registered: Apr 2015
Posts: 62

Original Poster
Rep: Reputation: Disabled
Anyway, thanks to all of you, you are invaluable!
 
Old 05-04-2015, 05:03 PM   #105
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You're welcome.

Thanks to you too for all the testing and rknichols for fantastic discussion!
 
  


Reply



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
LVM issue circus78 Linux - Server 5 12-12-2014 01:32 AM
LVM issue call_krushna Linux - Virtualization and Cloud 0 10-30-2012 10:58 AM
LVM issue AndyD236 Linux - General 2 11-24-2009 07:26 AM
LVM Issue bondoq Linux - General 8 05-12-2009 09:35 AM
LVM issue pauloco Linux - Hardware 1 11-14-2006 11:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:24 AM.

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
Open Source Consulting | Domain Registration