LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 08-20-2009, 06:25 AM   #1
mrcharles
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Rep: Reputation: 0
How to rewrite partition structure without deleting any data?


Hi,

Sorry, but I'm pretty new to linux, and I'm facing a problem with an ext3 partition on an external hdd. I'm not sure whether the hdd is about to crash or not, however I've had a few problems accessing it in the past.

This is what I get when trying to mount it:

[ 9090.405125] scsi 3:0:0:0: Direct-Access WD 3200BEV External 1.04 PQ: 0 ANSI: 4
[ 9090.452048] sd 3:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB)
[ 9090.453332] sd 3:0:0:0: [sdb] Write Protect is off
[ 9090.453337] sd 3:0:0:0: [sdb] Mode Sense: 21 00 00 00
[ 9090.453340] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 9090.468218] sd 3:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB)
[ 9090.469325] sd 3:0:0:0: [sdb] Write Protect is off
[ 9090.469330] sd 3:0:0:0: [sdb] Mode Sense: 21 00 00 00
[ 9090.469333] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 9090.469760] sdb: sdb1 sdb2 < sdb5 sdb6 >
[ 9090.549390] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 9090.551253] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 9092.691588] EXT3-fs error (device sdb6): ext3_check_descriptors: Block bitmap for group 128 not in group (block 0)!
[ 9092.701717] EXT3-fs: group descriptors corrupted!
[ 9093.414353] EXT3-fs error (device sdb6): ext3_check_descriptors: Block bitmap for group 128 not in group (block 0)!
[ 9093.414366] EXT3-fs: group descriptors corrupted!

I have a second external hdd, the exact same drive, that has the exact same partition configuration, but holds different data. So, my question is; is it possible to backup the partition structure of the second working drive, and using this information to rewrite the partition structure of the failing hdd without damaging the data stored on that drive?

Any ideas?

Cheers,
Charles
 
Old 08-20-2009, 07:01 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Welcome to LQ!!

First, what command produced all of that output?

Please post the output of "fdisk -l" (ell, not one---run this as root)

Also, what happens if you try to mount one or more of the partitions manually using "mount"? e.g.: Suppose you have a mount point named "/mnt/ext_1". Try running
Code:
mount /dev/sdb1 /mnt/ext_1
cd /mnt/ext_1
ls
With respect to restoring the partition structure, there are at least two aspects:
1. the partition table which is simply a map of the partition locations. This can readily be copied from an identical disk.

2. the "formatting"--i.e. the filesystem structure of each partition. I've never heard of copying this from another drive, but I doubt that it can be done without altering data. It CAN however be repaired with tools like fsck.-----But first, lets find out where the problem is.


If you think the drive is physically failing, and you have really valuable data, then the first thing to consider is cloning the whole drive.
 
Old 08-27-2009, 10:46 AM   #3
mrcharles
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Pixellany,

The output was just a part of a dmesg. Fdisk -l gives me the following output:

$ fdisk -l /dev/sdb

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x28f12a69

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 608 4883728+ 83 Linux
/dev/sdb2 609 38913 307684912+ f W95 Ext'd (LBA)
/dev/sdb5 609 730 979933+ 82 Linux swap / Solaris
/dev/sdb6 731 38913 306704916 83 Linux

The partition that gives me trouble is sdb6. Manually mounting this partition gives me the following...

$ sudo mount /dev/sdb6 /mnt/tmp
mount: wrong fs type, bad option, bad superblock on /dev/sdb6,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Cheers,
Charles


Quote:
Originally Posted by pixellany View Post
Welcome to LQ!!

First, what command produced all of that output?

Please post the output of "fdisk -l" (ell, not one---run this as root)

Also, what happens if you try to mount one or more of the partitions manually using "mount"? e.g.: Suppose you have a mount point named "/mnt/ext_1". Try running
Code:
mount /dev/sdb1 /mnt/ext_1
cd /mnt/ext_1
ls
With respect to restoring the partition structure, there are at least two aspects:
1. the partition table which is simply a map of the partition locations. This can readily be copied from an identical disk.

2. the "formatting"--i.e. the filesystem structure of each partition. I've never heard of copying this from another drive, but I doubt that it can be done without altering data. It CAN however be repaired with tools like fsck.-----But first, lets find out where the problem is.


If you think the drive is physically failing, and you have really valuable data, then the first thing to consider is cloning the whole drive.
 
  


Reply

Tags
partition, recovery


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
Question about raid 5 data structure esaym Linux - Hardware 2 02-27-2009 11:21 PM
A data structure problem Asuralm Programming 1 12-24-2007 07:49 AM
c++ data structure libraries kpachopoulos Programming 2 01-16-2007 04:22 PM
Data structure trie spank Programming 7 05-21-2006 07:21 AM
Wait Free Data Structure neo_119 Programming 0 11-27-2004 01:44 AM


All times are GMT -5. The time now is 06:37 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration