Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Partition recovery
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
VagrantLove
n00b
n00b


Joined: 15 Nov 2005
Posts: 6

PostPosted: Sat Dec 03, 2005 2:11 am    Post subject: Partition recovery Reply with quote

I have searched and searched and I really can't find the answer....

okay I have an 80GB hard drive
/dev/hdb
~70GB RieserFS
~10GB Unpartitioned (for windows install)


But I stuck in my windows CD and deleted my rieserfs partition....

I haven't touched it since.......

I tried testdisk and this is what I get...

Code:
Analyse Disk /dev/hdb - CHS 155061 16 63 - 76319 MB
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 07
get_geometry_from_list_part_aux head=16 nbr=1
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
get_geometry_from_list_part_aux head=32 nbr=1
get_geometry_from_list_part_aux head=64 nbr=1
get_geometry_from_list_part_aux head=255 nbr=1
Current partitions:
Invalid NTFS boot
 1 P HPFS - NTFS          135644   1  1 155039  15 63   19551105
 1 P HPFS - NTFS          135644   1  1 155039  15 63   19551105
Bad ending head
No partition is bootable
Backup partition structure

partition_save

search_part()
Disk /dev/hdb - CHS 155061 16 63 - 76319 MB

ReiserFS Marker at 0/1/1

recover_rfs
block_count=17091136
block_size=4096
   D Linux                    0   1  1 135643  15 62  136729088
     ReiserFS 3.6 with standard journal, 66762 MB

HFS magic value at 142159/0/1

HFS magic value at 143208/0/1
get_geometry_from_list_part_aux head=16 nbr=1
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
get_geometry_from_list_part_aux head=32 nbr=1
get_geometry_from_list_part_aux head=64 nbr=1
Warning: the current number of heads per cylinder is 16 but the correct value may be 64.

Results
   * Linux                    0   1  1 135643  15 63  136729089
     ReiserFS 3.6 with standard journal, 66762 MB

   * Linux                    0   1  1 135643  15 63  136729089
     ReiserFS 3.6 with standard journal, 66762 MB
Recompile with progsreiserfs library


So i tried Gpart

Code:
Possible partition(ReiserFS filesystem), size(66762mb), offset(0mb)

* Warning: short read near sector(156301299), 64512 bytes instead of 66048. Skipping...
End scan.

Checking partitions...
Partition(Linux ext2 filesystem): primary
Ok.

Guessed primary partition table:
Primary partition(1)
   type: 131(0x83)(Linux ext2 filesystem)
   size: 66762mb #s(136729088) s(63-136729150)
   chs:  (0/1/1)-(1023/15/63)d (0/1/1)-(135643/15/62)r


I found this but no such luck...

Code:
reiserfsck --rebuild-tree --scan-whole-partition --logfile /root/recovery.log /dev/hdb


but it came up with

Code:
reiserfs_open: the reiserfs superblock cannot be found on /dev/hdb.
Failed to open the filesystem.

If the partition table has not been changed, and the partition is
valid  and  it really  contains  a reiserfs  partition,  then the
superblock  is corrupted and you need to run this utility with
--rebuild-sb.



I don't really know which commands to use or how to use them I am still pretty new at linux....

any ideas???
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Dec 03, 2005 6:20 am    Post subject: Reply with quote

if reiserfs was on the first partition, and you just deleted the partition from the partition table (e.g. did not actually write on the partition or even worse format it), you may be able to restore it just by creating one big partition on the drive. After all, what's most important is that the beginning of the partition is the same, and since it's supposed to be at the beginning on the disk, that's easy to find.

So, in short, create one whopping 80GB partition on the drive and see what kind of data you can find on /dev/hdb1 then. Be careful to do everything you do read-only (except for writing the partition table), since any other write access might actually damage your data.
Back to top
View user's profile Send private message
VagrantLove
n00b
n00b


Joined: 15 Nov 2005
Posts: 6

PostPosted: Sat Dec 03, 2005 3:50 pm    Post subject: Reply with quote

So how exactly do I go about making it read only???

just fdisk /dev/hdb????

what exact command would I use????
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Dec 03, 2005 7:27 pm    Post subject: Reply with quote

What I meant about read-only was, just try to mount it and stop if it doesn't work - don't try to run fsck or similar programs on it that might try to write something there. The reiserfsck command you ran on /dev/hdb directly was really dangerous in my opinion, since there is no reiserfs on hdb directly, unless I'm missing something here and it's actually searching for a partition first...

So please follow the following instructions at your own risk only. I might be wrong and be sending your data to the depths of hell.

Having a closer look at the output you posted, it seems that your lost partition was already detected correctly:

Code:
   * Linux                    0   1  1 135643  15 63  136729089
     ReiserFS 3.6 with standard journal, 66762 MB


Also this message here stumped me:
Code:
Recompile with progsreiserfs library


It seems that your testdisk is lacking the necessary reiserfs support. If you're running this from a Gentoo installation, be sure to put reiserfs into your use flags. If you do that and re-emerge testdisk, it might even be able to restore your partition directly. It would probably be safest to try this first.

Otherwise, just run fdisk /dev/hdb. I assume you know how to use fdisk already, or what were you using to create the partitions before?

In fdisk, you do something along the lines of:
Quote:
# empty partition table just in case
Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

# recreate the first primary partition /dev/hdb1 for reiserfs
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-155061, default 1): <Enter> or 1
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-155061, default 155061): +66762M
# WARNING: It'd probably be safer to use sector numbers here, if you know them...

# Let's have a look at what we created:
Command (m for help): p

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 129361 65197912+ 83 Linux

# If it looks okay, write this table to disk
w


Then, assuming the table was re-read by the kernel correctly, you can try to mount your partition somewhere:

Code:
mount -o ro /dev/hdb1 /path/to/some/mount/point/


The -o ro stands for mounting read-only option. If you see your files in there, it seems you succeeded in restoring your partition, and you can umount it again, reiserfsck it, and reintegrate this partition back into your system or whatever.
Back to top
View user's profile Send private message
VagrantLove
n00b
n00b


Joined: 15 Nov 2005
Posts: 6

PostPosted: Fri Dec 09, 2005 3:42 am    Post subject: Reply with quote

I am not sure what is going on with fdisk does this look okay??

Quote:
Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 8118 65207803+ 83 Linux



i think it is because of this
Code:
The number of cylinders for this disk is set to 9729.
There is nothing wrong with that, but this is larger than 1024


and how do I go about finding sector numbers??


Thanks for helping a noob like me.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Dec 09, 2005 7:38 am    Post subject: Reply with quote

Some boot loaders have problems booting from partitions on big drives (if they are not at the beginning of the drive). That's all there is to this warning message, you can usually just ignore it.

Not sure what you mean by finding sector numbers now. testdisk detected them, didn't it?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum