I was given a hard disk to repair/extract data from. This hard drive was once the hard drive of a computer that had windows and linux installed (using grub to change between two). Booting from the hard drive is not possible anymore. When connected to linux, 4 partitions are found (/dev/sdb[1256]
), but only /dev/sdb1
can be read. /dev/sdb1
is the grub-partition, while /dev/sdb5
was identified as swap-partition by blkid
(it might have been another program, i'll check that). Mounting the partitions 2 and 6 gives errors, var/log/syslog
says something about a bad superblock.
Still, the most irritating result gives fdisk -l
, which prints the partition table AFAIK.
Device Start End Type
/dev/sdb1 2048 19531775 83 linux
/dev/sdb2 19533822 625141759 5 extended
/dev/sdb5 19533824 36304895 82 linux swap
/dev/sdb6 36306944 625141759 83 linux
(1 sector equals 512 byte, some of the output was removed by me. I will add it if needed)
If I understand correctly, something is wrong with the partition table. Somehow partition 2 is at the same location as partitions 5 and 6, which might explain the mounting-errors. (I will ask which OS really was used on this hard drive).
Now, there are important files on this hard drive. How do I get these files from the hard drive or (better) alter the hard drive so linux can mount all partitions. My first thought was to make a backup with dd
and then let a fsck
run on /dev/sdb
(You might see I am no expert at this), although I have my doubts.
UPDATE: As grawity pointed out, the partition table is intact and there are 3 partitions, from which one is a swap-partition. /dev/sdb1
can be mounted and is the grub-partition (judging from the files on the partition). /dev/sdb5
is most likely the swap-patition (since it's labeled as such and its size is in the right magnitude). I will try doing a fsck
on /dev/sdb6
and try some recovery tools.
Also, the person who gave me the hard drive is now thinking if he gave me the right one. I will look for the files anyway.
dd
those 2 partitions to files, then mount the files and attempt recovery there./dev/sdb1
is the grub-partition" - No, I don't think it is. It's about 9.5GiB, which suggests it's the root filesystem (containing the OS + programs, but not the documents and media). Ok, the root filesystem would in this case also contain grub, but to me "grub-partition" implies that it only contains grub./dev/sdb1
would be the root partition, there would be directories such asbin
,var
,etc
and others. I just gave it a quick look but I didn't see those. I quickly decided that/dev/sdb1
was no root-filesystem because there were many files containing "grub" in the uppermost directory. But of course this does not say I'm right, so far I have only seen a limited number of linux-distributions. I will have a proper look at it later. Thank you.