1

I have an external 2TB HD, that should have only one ext4 partition but the partition table is damaged and I'd love to rebuild/restore the partition.

Things ain't that easy so here's the longer version. I had problems with my NAS and did a backup to the external drive. The backup was ok and so I've reinstalled the NAS Firmware. When I wanted to restore it, I recognized that the external drive is not mountable anymore (don't ask).

I've plugged the drive into my macbook to see if my ubuntu VM can mount it but it can not. fdisk states "doesn't contain a valid partition table" and parted is also not able to see the partition. testdisk claims that there are two not recoverable HFS+ Partitions on it. The analysis of testdisk is valid, because I've formatted it as HFS+ earlier but after that I've reformatted it as ext4, to serve as pseudo backup for the NAS (it's a qnap ts-469L and the default fs is ext4, that's why).

I am pretty sure the files are all ok and it's just the partition table and I'm desperately looking for a way to rewrite/rebuild/recover the partition layout. I know I can get the files back but with crypted-like filenames and not structured. That's not what I want ;)

The only info I could gather is:

[~] # mke2fs -n /dev/sdf
mke2fs 1.41.4 (27-Jan-2009)
/dev/sdf is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
122101760 inodes, 488378112 blocks
24418905 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
14905 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848

and

[~] # parted /dev/sdf 
GNU Parted 2.2
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit B                                                           
unit B
(parted) print                                                            
print
Warning: /dev/sdf contains GPT signatures, indicating that it has a GPT table.
However, it does not have a valid fake msdos partition table, as it should.
Perhaps it was corrupted -- possibly by a program that doesn't understand GPT
partition tables.  Or perhaps you deleted the GPT table, and are now using an
msdos partition table.  Is this a GPT partition table?
Yes/No? Yes                                                               
Yes
Model: WD Elements 1048 (scsi)
Disk /dev/sdf: 2000396746752B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End             Size            File system  Name  Flags
 1      17408B  2000396729855B  2000396712448B

Right now it's plugged to the NAS to make an image with dd, before I'm willing to do something invasive - but it will take at least 10 more hours until it's done.

I'm no pro so I don't know how to recover/rebuild the partition layout. I don't know if I can use the dd image directly, or if I have to stream it to any physical device.

Note: I have a backup of most of the files but it's ~4 months old and what I'm mostly interested in are the *.cr2 raw photo's and *.mov videos (about 1k since then). I know I can get them back most likely with photoRec and rename the files based on the metadata but I prefer to recover the filesystem if possible.

biophonc
  • 129
  • 1
  • 2
  • 1
    You've formatted the disk _at least twice_, and done it incorrectly at least one of those two times. This isn't just a partition table issue anymore. You've destroyed much or all of your data. It's time to go to your backups. – Michael Hampton Mar 14 '14 at 23:29
  • @MichaelHampton as replied to @michael-sqlbot, as far as I understand the man pages of `mke2fs` and `parted`, I did not wrote anything to the disk but displayed only some infos. Please correct me if I'm wrong. – biophonc Mar 15 '14 at 08:35
  • I only go by your own words: "The analysis of testdisk is valid, because I've formatted it as HFS+ earlier but after that I've reformatted it as ext4"... – Michael Hampton Mar 15 '14 at 14:04
  • Ah sorry. The backup data is on the ext4 fs. I was mentioning it only because testdisk finds them but not the ext4. – biophonc Mar 15 '14 at 14:35
  • @biophonc that was my mistake, `mke2fs -n` is a dry-run that doesn't modify data. It shows you what it would have done to the disk, which isn't necessarily all that useful in this case, either, but I've removed that answer. – Michael - sqlbot Sep 14 '14 at 22:11

0 Answers0