LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-19-2013, 04:54 AM   #1
datashredder
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Rep: Reputation: Disabled
ext3 (Superblock) damage while partition extend


I lost the ext3 File system after resizing the Partition on an md raid device. The whole story:

I added an SSD and freshly installed Centos 6. The Raid devices for the former / and swap had to be deleted and the Data Partition should receive the entier disc capacity. I started with two hard disks, having three partitions type fd and three raid1 devices.

Code:
/dev/sdb1	50G	Linux raid auto
/dev/sdb2	240G	Linux raid auto
/dev/sdb3	4G	Linux raid auto
Code:
/dev/sdc1	50G	Linux raid auto
/dev/sdc2	240G	Linux raid auto
/dev/sdc3	4G	Linux raid auto
Code:
md125:active raid1 sdc1[1] sdb1[2] [UU]  ext3 (previously mounted on /)
md126:active raid1 sdc2[1] sdb2[2] [UU]  provided to KVM guest as raw device (virtual file server)
md127:active raid1 sdc3[1] sdb3[2] [UU]  swap (not in use anymore)
The new setup had no /etc/mdadm.conf - the md devices were run automatically. I deleted /dev/md125 and /dev/md127 and removed one disk from md126

Code:
mdadm /dev/md126 --fail /dev/sdb2 --remove /dev/sdb2
using fdisk i deleted all partitions on /dev/sdb and created

Code:
/dev/sdb1 	320G	Linux raid auto
then i ran

Code:
mdadm -a /dev/md126 /dev/sdb1
and waited for the sync to finish. After that, the same procedure on /dev/sdc removing, creating, adding and syncing /dev/sdc1 wth the entier disc capacity. Last step on the array was to

Code:
mdadm --grow /dev/md126 -z max
That done, i had /dev/md126 up and running with 310GB capacity containing the partition /dev/md126p1 having 240GB and an ext3 Filesystem. Mountable, unsable, perfect.

Next step was to extend the partition /dev/md126p1. Using fdsik /dev/md126 i deleted the partition (form 1 to 32028) and created an new one (form 1 to last). From that moment on, the ext3 is not detected as ext3 anymore and unusable even with -t ext3. It always says "wrong fs type, bad option, bad superblock"

I tried to use backup superblocks displayed by mke2fs -n via fsck as well as via mount -o sb=1234 - nothing.

Can someone help me finding the Data?

thanks,
datashredder
 
Old 12-20-2013, 02:41 AM   #2
datashredder
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
meanwhile is set up a perl script

Code:
foreach (30000..30000000){
	@back = `mount -t ext3 -o ro,sb=$_  /dev/md126 /mnt/temp`;
}
Its still running, but it doesnt look as if there is any usable buperblock.

Any idea, please?

datashredder
 
Old 12-20-2013, 03:09 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Normal response when screwing with partitions - restore from the backup you took before you started screwing around.
No, I'm not being flippant.

That said, it looks like what you did is sane - I'd blame fdisk. Recent versions align partitions differently for compatibility with the newer 4k sector drives - if the old alignment was to cylinder 1 (as in sector 63), the filesystem won't align to the start of the new partition. So your filesystem would be ok, but you won't be able to find it. "fdisk -l" should tell you.

(I didn't reply earlier as I didn't want to pull you off the "0 reply" list).
 
Old 12-20-2013, 05:21 AM   #4
datashredder
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for your reply, syg00. Ok - i found in the web, that fdisk since v. 2.17.1 (i used 2.17.2) aligns the partition begin to a sector divisible by 1024, if the DOS compatibility mode is disabled. But i can see the partition beginning at sector 1. Are the more new behaviours? I think, i give an old recue disk a try to recreate the partition.

thanks

datashredder
 
Old 12-20-2013, 07:17 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
The only partitioning tool I know that will do exactly what you tell it to do is sfdisk when run with the "--force" option, but you will have to put up with a non-interactive user interface that sometimes doesn't seem to have been intended for humans.
 
Old 12-21-2013, 04:00 AM   #6
datashredder
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you guys,

after using an old fdisk, that didnīt help, i decided to restore the backup. It might be very interesting to find out, what happened, but i have neither enough disks nor sufficient time.

datashredder
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i replace corrupted superblock of my ext3 partition win281 Linux - Newbie 1 05-10-2009 07:12 AM
ext3 superblock/partition table problem sxeraverx Linux - Software 7 03-14-2008 10:31 PM
Extend ext3 Partition Using Unpartitioned Space On Same Hard Drive - Fedora Core 6 aaron4katie Linux - Hardware 9 01-11-2007 05:20 AM
How do I extend an ext3 partition? chrislev Linux - Hardware 2 01-27-2006 10:35 AM
howto extend ext3 partition compfriend Linux - Hardware 1 09-16-2003 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:35 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