LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Partition recovery (https://www.linuxquestions.org/questions/linux-hardware-18/partition-recovery-347936/)

ElVirolo 07-29-2005 03:19 AM

Partition recovery
 
Hi all !

My hard disk used to be divided into 5 partitions :

/dev/hda1 was fat32 with Windows XP on it 5 (~ 30 GB)
/dev/hda3 was ext3, and empty : i wanted to install Ubuntu Lite on it (~10 GB)
/dev/hda7 (but not sure about the number) was etx3 : / partition for Ubuntu (~ 5 GB)
/dev/hda8 (not sure) was swap (~ 500 GB)
/dev/hda9 (not sure) was /home ( ~ 40 GB)

I tried to install Ubuntu Lite, but before the installer had even started up, it started fiddling my my partitions (by running mkswap) ... So I rebooted the machine ... and of course GRUB wouldn't show up anymore ... So I started Knoppix up to see what was wrong.

Here's my /etc/fstab under Knoppix :

Code:

/proc      /proc      proc  defaults            0 0
/sys      /sys        sysfs  noauto              0 0
/dev/pts  /dev/pts    devpts mode=0622          0 0
/dev/fd0  /mnt/auto/floppy auto  user,noauto,exec,umask=000    0 0
/dev/cdrom /mnt/auto/cdrom  auto  user,noauto,exec,ro 0 0
/dev/cdrom1 /mnt/auto/cdrom1  auto  users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/hda1 none swap defaults 0 0
# Added by KNOPPIX
/dev/hda2 /mnt/hda2 auto noauto,users,exec 0 0

So Knoppix has only detected /dev/hda1 and /dev/hda2 ...

/dev/hda is definitely swap. And I can't mount /dev/hda2 :

This is what sudo mount /dev/hda2 /mnt/hda2 shows :


Code:

mount: you must specify the filesystem type
So I tried mounting is as ext2, ext3 and vfat, and it says :
Code:

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

However, fdisk says /dev/hda2 is of type 83 (Linux) ...


What shall I do to get my old partitions back ?

Thanks in advance,

Alex.

[|RoA|]RoadRunner 07-29-2005 03:42 AM

At first look, it seems to happened that a command from You destroyed the partition table of /dev/hda.

You can give testdisk a try to find the lost partitions. It can restore the partition table of a HD, but read the doc's carefully.

Although, please clear out what partition is swap? First You talk of /dev/hda8, later You tell /dev/hda ( 1? ) is or was swap.

ElVirolo 07-29-2005 03:44 AM

Thanks, I'll look it up right now ...

Well, I think /dev/hda8 _used_ to be swap ... What is sure now is that /dev/hda1 _is_ swap.


Thanks again,

Alex.

ElVirolo 07-29-2005 03:55 AM

Strangely enough, testdisk seems to detect only /dev/hdc (my CD burner) ... Maybe I should download UltimateBootCD to see...

I checked the log, and only /dev/hdc appears...

ElVirolo 07-29-2005 07:14 AM

Well, I tried testdisk, but it doesn't find my old partitions ... Here's the log :

Code:

Fri Jul 29 11:56:02 2005
TestDisk command line : /log /debug
TestDisk 5.3, Data Recovery Utility, May 2004
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Linux version
Using locale 'C'.
file_read(4,1,buffer,160087724(9964/254/63)) seek err Invalid argument
file_read(5,1,buffer,240974(14/254/63)) seek err Invalid argument
Hard disk list
Disk /dev/hda - CHS 9964 255 63 - 78159 MB
Disk /dev/hdc - CHS 14 255 63 - 109 MB


Analyse Disk /dev/hda - CHS 9964 255 63 - 78159 MB
Geometry from MBR: head=255 sector=63
check_part 83
get_geometry_from_list_part_aux head=255 nbr=2
Current partitions:
 1 P Linux Swap              0  1  1    24 254 63    401562
No EXT2, JFS or Reiser marker
 2 * Linux                  25  0  1  9963 254 63  159670035
 2 * Linux                  25  0  1  9963 254 63  159670035

search_part()
Disk /dev/hda - CHS 9964 255 63 - 78159 MB
  D Linux Swap              0  1  1    24 254 45    401544

recover_EXT2: s_block_group_nr=0/117, s_mnt_count=0/29, s_blocks_per_group=32768
recover_EXT2: boot_sector=0, s_blocksize=4096
recover_EXT2: s_blocks_count 3857608
recover_EXT2: part_size 30860864
  D Linux                3863  0  1  5783 254 62  30860864
    EXT3 Sparse superblock
  D Linux Swap            5784  0  1  5846 254 40    1012072
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=255 nbr=3

Results
  * Linux Swap              0  1  1    24 254 63    401562
  P Linux                3863  0  1  5783 254 63  30860865
    EXT3 Sparse superblock
  P Linux Swap            5784  0  1  5846 254 63    1012095

interface_write()
 1 * Linux Swap              0  1  1    24 254 63    401562
 2 P Linux                3863  0  1  5783 254 63  30860865
 3 P Linux Swap            5784  0  1  5846 254 63    1012095
simulate write!

write_mbr: starting...
write_all_log: starting...
New options :
 Paranoid : No
 Dump : No
Cylinder boundary : Yes
 Mode : Fast
 Allow partial last cylinder : No
 Ask partition order : No
 Halt on errors : Yes
 Maximize extended part : No
 Expert mode : No

TestDisk exited normally.

Could anyone help me ?

Thanks,

Alex.

[|RoA|]RoadRunner 07-29-2005 02:41 PM

Testdisk found three partitions on hda, one ext3-linux and two swap. You can direct testdisk to " search deeper " for partitions. This may take several hours and often does not bring THE result.

At this point You will restore the last backup of Your HD or install again ( formatting, etc. ). :(

Maybe Anyone on this Forum can give other helpful suggestions?

ElVirolo 07-30-2005 03:25 AM

Thanks for your help, but even "searching deeper" didn't get helpful results ... So I formatted the hard disk and installed my (old) backup...

Thanks again,

Alex.


All times are GMT -5. The time now is 05:40 PM.