LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-29-2005, 03:19 AM   #1
ElVirolo
LQ Newbie
 
Registered: Jul 2004
Location: France
Posts: 8

Rep: Reputation: 0
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.
 
Old 07-29-2005, 03:42 AM   #2
[|RoA|]RoadRunner
Member
 
Registered: Jul 2005
Distribution: LFS
Posts: 43

Rep: Reputation: 15
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.
 
Old 07-29-2005, 03:44 AM   #3
ElVirolo
LQ Newbie
 
Registered: Jul 2004
Location: France
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-29-2005, 03:55 AM   #4
ElVirolo
LQ Newbie
 
Registered: Jul 2004
Location: France
Posts: 8

Original Poster
Rep: Reputation: 0
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...

Last edited by ElVirolo; 07-29-2005 at 04:00 AM.
 
Old 07-29-2005, 07:14 AM   #5
ElVirolo
LQ Newbie
 
Registered: Jul 2004
Location: France
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-29-2005, 02:41 PM   #6
[|RoA|]RoadRunner
Member
 
Registered: Jul 2005
Distribution: LFS
Posts: 43

Rep: Reputation: 15
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?
 
Old 07-30-2005, 03:25 AM   #7
ElVirolo
LQ Newbie
 
Registered: Jul 2004
Location: France
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
  


Reply



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
partition recovery cgetty Linux - Software 3 04-18-2005 10:03 PM
Partition Recovery Salpula Linux - Software 0 09-01-2004 04:35 PM
Partition table recovery SYakush Linux - General 4 08-04-2004 04:55 AM
Partition recovery julien.r Linux - Hardware 2 11-19-2003 08:00 AM
partition recovery cshaigh Linux - Software 9 08-26-2001 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:39 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration