Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Some how my partition on /dev/sdb has gotten all buggered up. This hard drive contains a lot of data that I need to recover and haven't been able to backup yet. WHen I attempt to mount it:

#mount -t ext4 /dev/sdb /world
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Also when I run fdisk to try see what partitions are on the hard drive:

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x25467742

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb3   *           1           1           0    0  Empty
Partition 3 does not end on cylinder boundary.

I have attempted to use TestDisk to try to recover my lost partition but both quick and deep scans find no partitions present.

I am able to look at the used space and all of my data is still intact on the hard drive it self it just seems my partition is complete done. Is there any way I can recover this data? Any tools or details that I am missing? Thanks for your help in advance.

EDIT:

Output of my fstab file:

/dev/mapper/vg_atlasserver-lv_root /                       ext4    defaults        1 1
UUID=195465e0-00b6-49ad-9e81-2521316a808c /boot                   ext4    defaults        1 2
/dev/mapper/vg_atlasserver-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_atlasserver-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sdb                /world                  ext4    defaults        0 0
share|improve this question
    
Since you've previously mounted /dev/sdb directly, it seems that you haven't had a valid partition table before - and have just made a filesystem on the disk. Partition-recovering applications will not work in that setup (as there aren't any partition table to rescue). You're in a situation where file recovery is very difficult, and you should start by doing an immediate dd of your entire drive to some place safe. –  Kvisle Oct 17 '11 at 0:09
    
@Kvisle I am doing a dd right now to my backup hard drive but it is taking forever. I know it is a 1TB hard drive but it has been going for over 8 hours, is this normal? –  Nic Young Oct 17 '11 at 3:51
    
You should verify that you're actually copying data in the process. Is the target file increasing in size? It may be taking forever because the harddrive you're copying from is having big problems - which could explain the problems you're having in the first place. –  Kvisle Oct 17 '11 at 5:39
    
@Kvisle I have been running the dd pretty much all day, and now when I look at /dev/sdc it says that it is of an unknown file type even though before I started this process it was recognized as ext4. Is there a way to dd in a specific file say a tar file? –  Nic Young Oct 17 '11 at 7:53
    
dd if=/dev/sdb of=/path/to/filename/on/disk –  Kvisle Oct 17 '11 at 7:58

2 Answers 2

up vote 1 down vote accepted
  1. Obviously you (should) mean "mount -t ext4 /dev/sdb1 /world"
  2. Make a 'dd' of your disk and work on that. The risk of hosing what's left is high
  3. Do you have a record of the previous partition layout? If so, you may try to recreate it. Remember to always mount readonly.

Cheers

share|improve this answer
    
I tried to mount /dev/sdb1 and it says mount: special device /dev/sdb1 does not exist. Also I am not exactly sure how to make a dd of the disk. I do not have the previous partition layout sadly. –  Nic Young Oct 15 '11 at 6:29
    
Your fdisk output says /dev/sdb3; did you try that too (even though it's empty, just in case)? What partitions are listed in /etc/fstab? –  Handyman5 Oct 15 '11 at 8:05
    
I have tried /dev/sdb3 and it gives me the same result. I ran dd if=/dev/sdb of=/dev/sdc bs=512 conv=noerror,sync to create a disk image of the hard drive but it is taking an unusually log time. Is this normal? How long can I expect this to take? The drive I am imaging is 1TB –  Nic Young Oct 16 '11 at 22:42
    
(1) You should not be using /dev/sdc as output file!!! Either there is no sdc disk, in which case you are creating a 1TB file named sdc under /dev (not good) or (much worse) there is a sdc disk, which is now pretty hosed, just as sdb was in the first place. (2) How long? what disk are we talking about (USB, Sata, sas), what transfer rate? ls -l /dev/sdc should be telling you the size of what's been read so far. –  Alien Life Form Oct 18 '11 at 13:42

An important point to note is that recreating your partitions does not actually affect the data stored on them; if you were to delete your partition table and recreate it _absolutely_exactly_, you should be able to mount the partitions that lived on it previously. The partition table is just instructions to the operating system about which blocks ought to contain various things (like the beginning of filesystems); if you ensure that there exists a partition table which makes the operating system look in the right place, then it should be able to find the filesystem.

It's also possible to edit your partition table by hand with a hex editor in lieu of recreating it from scratch. (I know the comic says FAT, it was really the partition table.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.