# MBR: I think I'm fracked

## tecknojunky

Hi.

I've been reading a lot of threads abouot lost MBR in these forums and on whatever Google could give me.  It just seem I have lost my MBR.  I can get the /boot partition with testdisk, but it would seem I can't get any good readings about my root partition.

I have this feeling the data is still there, but I have no way of retrieving it since i have no cluse what were the CHS setiings for the individual paritions.

I have tried also to include is in a vmware drive and use Partition Magic, but it shows up as a unpartitioned hardrive.

I hope to a realy genuine knowlegable helping post.

Thanks

----------

## NeddySeagoon

tecknojunky,

First the good news. Unless you use DOS or Windows before Windows 98, the C/H/S numbers don't matter an should all be set to zero.

The C/H/S method of describing hard disks only works for drives of 8Gb or less.

What and how you get your data back, depends on what you did. The main thing is to be cautious, its easy to make things worse.

Do you know what partitions you had on the drive ?

So what did you do and what partitions did you have. Partition numbers will be a great help because extended and logical partitions need different handling to primary partitions.

----------

## mmbrothers

This problem seems to be of pandemic proportions    :Very Happy: 

This thread might be of assistance  https://forums.gentoo.org/viewtopic-t-405914.html

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 Hi NeddySeagoon.  :Very Happy: 

 *NeddySeagoon wrote:*   

> First the good news. Unless you use DOS or Windows before Windows 98, the C/H/S numbers don't matter an should all be set to zero.
> 
> The C/H/S method of describing hard disks only works for drives of 8Gb or less.

 This is solely a linux drive.  It has(/had?  :Sad:  ) the very boring standard boot/ext2, swap, root/reiser3 partition, and the size is ~3GB.

 *NeddySeagoon wrote:*   

> What and how you get your data back, depends on what you did. The main thing is to be cautious, its easy to make things worse.
> 
> Do you know what partitions you had on the drive ?

 Would I wish it would be that easy, to simply recreate the partitions using fdisk.  :Sad: 

 *NeddySeagoon wrote:*   

> So what did you do and what partitions did you have. Partition numbers will be a great help because extended and logical partitions need different handling to primary partitions.

 I have runned testdisk and it can't give me back a scheme that is recognisable.  I does seem to id my /boot partition, browsing it yields the usual kernel file with system and the grub folder also, but I can't flag it bootable withoy testdisk saying the structure is invalid.

For the what-would-be the root partition, I think it's really screwed up.  testdisk will give me two partitions, none are browseable.  The best that looks plausibly like what I had is this:

```
# testdisk /list /dev/evms/hdb

TestDisk 5.9-WIP, Data Recovery Utility, August 2005

Christophe GRENIER <grenier@cgsecurity.org>

http://www.cgsecurity.org

Please wait...

Disk /dev/evms/hdb - CHS 11024 9 63 - 3052 MB, sector size=512

Disk /dev/hda - CHS 79656 16 63 - 39205 MB, sector size=512

Disk /dev/hdb - CHS 11024 9 63 - 3052 MB, sector size=512

Disk /dev/evms/hdb - CHS 11024 9 63 - 3052 MB

     Partition                  Start        End    Size in sectors

Partition sector doesn't have the endmark 0xAA55

Disk /dev/hda - CHS 79656 16 63 - 39205 MB

     Partition                  Start        End    Size in sectors

 1 * Linux                    0   1  1   525  14 63     530082

Warning: Bad ending head (CHS and LBA don't match)

 2 P Linux Swap             525  15  1  2613  11 63    2104515

Warning: Bad ending head (CHS and LBA don't match)

 3 P Linux                 2613  12  1 79655   9 63   77658210

Warning: Bad ending head (CHS and LBA don't match)

Disk /dev/hdb - CHS 11024 9 63 - 3052 MB

     Partition                  Start        End    Size in sectors

Partition sector doesn't have the endmark 0xAA55

TestDisk exited normally.
```

These sizes are not possible.

I did everything read-only, and tried tests on a dd image of the drive.  So far, everything is screwed up just like it was before.  The worst is that this is a router.  I was not doing anything on that box.  It just showed a constant lite drive led and I could not access any terminals (remote/local).  After a reboot I got a "no OS found" or the like.

I just wish I could salvage some data from the drive.  I can live with a rebuild, although I would have done something else these holiday's  :Crying or Very sad: 

----------

## NeddySeagoon

tecknojunky,

That testdisk output is not very helpful.

If the disk were partitioned with linux, the C/H/S sizes would be left at all zeros and only the LBA entries filled.

Since the drive was full, if you can remember the size of /boot and swap root will fall into place.

Were they all primary partitions ?

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon,  :Very Happy: 

 *NeddySeagoon wrote:*   

> That testdisk output is not very helpful.
> 
> If the disk were partitioned with linux, the C/H/S sizes would be left at all zeros and only the LBA entries filled.

 That's probabbly why I get invalid CHS...

```
Check the harddisk size: HD jumpers settings, BIOS detection, OS limitation...

The following partition can't be recovered. The harddisk seems too small!

     Partition               Start        End    Size in sectors

D Linux                  950   2  1 11133   2 63    5773824
```

 *NeddySeagoon wrote:*   

> Since the drive was full, if you can remember the size of /boot and swap root will fall into place.

 I wish I knew what they were.  I would have hope for testdisk to be able to retreive them.

 *NeddySeagoon wrote:*   

> Were they all primary partitions ?

 Yes.

The other outputs were:

```
Warning: the current number of heads per cylinder is 9

but the correct value may be 128.

Use the Geometry menu to change this value.
```

```
Disk sanfran.hda - CHS 11024 9 63 - 3052 MB

     Partition               Start        End    Size in sectors

D Linux                    0   1  1   369   8 63     209727

D Linux Swap             369   7  1   839   8 63     266616

* Linux                 2127   0  1  2496   8 63     209790

L Linux                 7182   1  1  7551   8 63     209727
```

But apart the first two, the last two partitions are not browseable.  Further, it is the third partition that is flagged bootable primary when it is obvious it should be the first.

```
Disk sanfran.hda - CHS 11024 9 63 - 3052 MB

     Partition                  Start        End    Size in sectors

 1 * Linux                 2127   0  1  2496   8 63     209790

 2 E extended LBA          7182   0  1  7551   8 63     209790

 5 L Linux                 7182   1  1  7551   8 63     209727
```

This is the final partitions given by testdisk without performing a search.  These I can't understand.  Why my bootable primary be located at cylinder 2127?  I don't recall at all using an extended partition (I never do... I'd go LVM instead if I needed to).  The sizes would also be consistant only with that of the boot partition which I usualy set to 100MB.

So, with those, I'm unsure what to do next.  I would be tempted to use some of the entries to recreate the partition table with fdisk, but fdisk does not accept CHS delimiters, only cylinders.  So I can't precicely define the borders.

----------

## NeddySeagoon

tecknojunky,

If there are no extended partitons, you can have as many goes as creating the partition table as you like without damaging your data.

Don't worry about creating partitions with the right Head and sector numbers. Traditionally, partitions always started on a cylinder bounday, so thats head 0 sector 0, apart from the first partition, which starts at head 1 because the MBR is at head 0 sector 0 cylinder  0.

Using logical block addressing, have a go at partition creation. Do not mount them for writing until you are sure they are right.

Based on your posts up to now, I would have a first stab by converting the sizes in sectors and recreate the first two partitions with fdisk. They are at least contiguious as you would expect, then make a third partition for the rest of the drive. 

Mount the /boot partition read only and have a look around.

Mount the 3rd partition read only (if you can) and look round. If the filesystem on root is ext2 or ext3 ask fsck to have a go read only but with different copies of the superblock. See man e2fsck. If its not an ext2/3 fs I'm not use what tools to use.

The important thing is not to let anything write to it.

----------

## pjp

Moved from Other Things Gentoo

----------

## syg00

First person I've heard of where testdisk hasn't done the job.

I'd probably take the hint offered, and change the number of heads, then let it (re-)analyze. *Quote:*   

> Note: Correct disk geometry is required for a successful recovery. 'Analyse' process may give some warnings if it thinks the logical geometry is mismatched.

 

----------

## tecknojunky

 *syg00 wrote:*   

> First person I've heard of where testdisk hasn't done the job.
> 
> I'd probably take the hint offered, and change the number of heads, then let it (re-)analyze. *Quote:*   Note: Correct disk geometry is required for a successful recovery. 'Analyse' process may give some warnings if it thinks the logical geometry is mismatched. 

 Hum...  It does seem to output less crap:

```
Disk sanfran.hda - CHS 776 128 63 - 3055 MB

     Partition               Start        End    Size in sectors

* Linux                    0   1  1    25 127 63     209601

P Linux Swap              26   0  1    58 127 63     266112
```

These sizes are more consistant to what I think I had... at least they are al dividable to a round number in MB.

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon,  :Very Happy: 

 *NeddySeagoon wrote:*   

> If there are no extended partitons, you can have as many goes as creating the partition table as you like without damaging your data.
> 
> Don't worry about creating partitions with the right Head and sector numbers. Traditionally, partitions always started on a cylinder bounday, so thats head 0 sector 0, apart from the first partition, which starts at head 1 because the MBR is at head 0 sector 0 cylinder 0.

 Okidoki.  I will backup the first sector though.

 *NeddySeagoon wrote:*   

> Using logical block addressing, have a go at partition creation. Do not mount them for writing until you are sure they are right.
> 
> Based on your posts up to now, I would have a first stab by converting the sizes in sectors and recreate the first two partitions with fdisk. They are at least contiguious as you would expect, then make a third partition for the rest of the drive.
> 
> Mount the /boot partition read only and have a look around.
> ...

 This would seem to be the way to go then.

I was wondering if you guys know if it is possible to access partitions inside an image file?  I mean, I don't think it's possible to loop mount an image of a drive to be equivalent to /dev/hdb.  So, would it be possible to loop mount the equivalent of /dev/hdb[1|3] that are inside an image file?  I ask because I feel safer to toy on that image rather than the real drive.

----------

## syg00

 *tecknojunky wrote:*   

> I was wondering if you guys know if it is possible to access partitions inside an image file?  I mean, I don't think it's possible to loop mount an image of a drive to be equivalent to /dev/hdb.  So, would it be possible to loop mount the equivalent of /dev/hdb[1|3] that are inside an image file?  I ask because I feel safer to toy on that image rather than the real drive.

 No idea - but I'd doubt it using normal tools.

No real point. As Neddy says, playing with the part table doesn't (of itself) expose your data. And you said you had an image backup of it anyway - can always copy it back.

Me, I like to mess around like this from Knoppix. By default it mounts your disk R/O, so you have to deliberately do something to screw one of your disks. Nice safety-net.

----------

## tecknojunky

So, I have rewritten the partition table by allocating the remaining space to a primary partition.

I did not have any hdb?, so created them manually with mknod.

What I feared would happen happenned.  I could not mount hdb3.  I can mount hdb1 and start swap with hdb2.

My concern is that I maybe don't have the proper CHS for it.

----------

## Cintra

If you have a floppy I would advise getting hold of MBRWIZ to quickly save & restore your MBRs from floppy in future

see http://www.simtel.net/product.download.mirrors.php?id=68928

ftp://ftp.nic.surfnet.nl/mirror/simtel/msdos/diskutil/MBRWiz.zip

Mvh

----------

## tecknojunky

 *Cintra wrote:*   

> If you have a floppy I would advise getting hold of MBRWIZ to quickly save & restore your MBRs from floppy in future
> 
> see http://www.simtel.net/product.download.mirrors.php?id=68928
> 
> ftp://ftp.nic.surfnet.nl/mirror/simtel/msdos/diskutil/MBRWiz.zip
> ...

 Thanks.  I've seen it.  Although it does not resolve my current problem.  Beside... won't dd if=/dev/hd?? count=1 bs=512 of=myMBR do the same?

----------

## Cintra

sorry about your trouble btw. 

it might well do.. I'm afraid mbwiz is something I've used since XP days  :Wink: 

like an insurance - buy it after you've had an accident and you'll never need it again!

cross fingers...

----------

## NeddySeagoon

tecknojunky,

Linux does not use C/H/S addressing so thats never a problem.

fdisk does try to obey the DOS fdisk rules and create partitions that begin on a cylinder boundary, it may even fill in the C/H/S fields in the partition table, in case you want to install DOS.

Since you can mount hdb2, it must start in the right place (hdb1 starts at the beginning of the disk, so that doesn't prove anything), that provides some assurance that your hdb1 is correct but says nothing about the end of hdb2.

What filesystem type is/was on hdb3 ?

The primary superblock may be damaged, which would prevent it mounting, however many filesystems ext2, ext3 I know, save copies, so it can be fixed. If you do try fsck on hdb3 make sure you do it read only.

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon,   :Very Happy: 

 *NeddySeagoon wrote:*   

> Since you can mount hdb2, it must start in the right place...

 To be precise, hdb2 is swap.  Issuing swapon /dev/hdb2 might have been a huge mistake on my part.  For sure swap partition will not give a damn what's in the partition, it will initially considere everything as zeros and simply expand memory from it without any filesystem layer.  So my assumption is quite bogus,  I think, and maybe starting swap on it may have written stuffs over good data, but I doubt that because my swap on hda is not even used at all.

 *NeddySeagoon wrote:*   

> ...(hdb1 starts at the beginning of the disk, so that doesn't prove anything), that provides some assurance that your hdb1 is correct but says nothing about the end of hdb2.

 So, I could allocate the whole disk as hdb1 and it would still mount?  :Confused:  Could I scan the disk myself in trying to locate where my hdb3 starts?

 *NeddySeagoon wrote:*   

> What filesystem type is/was on hdb3 ?

 Reiser3

 *NeddySeagoon wrote:*   

> The primary superblock may be damaged, which would prevent it mounting, however many filesystems ext2, ext3 I know, save copies, so it can be fixed. If you do try fsck on hdb3 make sure you do it read only.

 I tried running reiserfsck on it, but it does not recognise the filesystem at all.

Isn't there any tool at all that can recreate my partition table by scanning the data on the drive and spot the partition boundaries (0xAA55  :Question:  )?

In the mean time, I have started to rebuild myself a router in a chroot environement, just in case I get it done faster this way, rather than trialing and erroring on partitions layout.  But this does not give me my settings back.  Man, this sucks.  :Crying or Very sad: 

----------

## NeddySeagoon

tecknojunky,

When you did 

```
mkswap /dev/hdb2 
```

the partition was marked as a swap partition.

swapon must have found this mark, or it will not mount the partition. It follows that /dev/hdb2 starts in the right place.

The kernel will ignore the content of swap at startup and only write what it needs when it needs to. Writing zeros is a waste of time, so the kernel will not do it.

I don't know anything of reiserfs - so I can't help further with fsck.

You only have one partition table on your disk - its at the end of the MBR and contains at most four entries.

If you had created an Extended partition, you would have had more. The AA55 is likely to occur in data as well as in the partition tables too.

You can look at the raw disk with hexedit but on a 3Gb disk, it will take a while.

If you make a single partition for the whole disk, it will mount but you will still only see /boot because the filesystem on it only describes the blocks used by /boot - you will not be able to read off the end of the filesystem.

I wonder if the mkswap marker written at the beginning of the swapfile includes the size of the partition ?

The kernel needs to know it somehow. 

```
man mkswap 
```

and

```
less /proc/swaps
```

 may help - It looks like the actual size of swap can be determined by looking at the first 'page' of the swap file, so you can determine where it ends. Your /dev/hdb3 will start at the next block.

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon!   :Very Happy: 

 *NeddySeagoon wrote:*   

> When you did 
> 
> ```
> mkswap /dev/hdb2 
> ```
> ...

 Well, I was merely saying the kernel will presume zeros.  Of course, it does not go write zeros.  I knew that  :Wink: 

 *NeddySeagoon wrote:*   

> I don't know anything of reiserfs - so I can't help further with fsck.
> 
> You only have one partition table on your disk - its at the end of the MBR and contains at most four entries.
> 
> If you had created an Extended partition, you would have had more. The AA55 is likely to occur in data as well as in the partition tables too.
> ...

 Good call.  Doing an e2fsck yielded errors and... THE SIZE!!!  :Very Happy:  Using this new information to recreate the partition, e2fsck said all was good.  So, for sure, the swap partition begins on the next block and the root partition finishes until the end of the disk.  I tried to rely on testdisk to determine that frontier between the two:

```
Disque /dev/evms/hdb: 3200 Mo, 3200311296 octets

128 têtes, 63 secteurs/piste, 775 cylindres

Unités = cylindres de 8064 * 512 = 4128768 octets

  Périphérique Amorce    Début         Fin      Blocs    Id  Système

/dev/evms/hdb1   *           1          26      104800+  83  Linux

/dev/evms/hdb2              27          59      133056   82  Linux swap / Solaris

/dev/evms/hdb3              60         776     2890944   83  Linux
```

But this does not work.

 *NeddySeagoon wrote:*   

> I wonder if the mkswap marker written at the beginning of the swapfile includes the size of the partition ?
> 
> The kernel needs to know it somehow. 
> 
> ```
> ...

 

```
# cat /proc/swaps

Filename                                Type            Size    Used    Priority

/dev/evms/hda2                          partition       1052248 388     -1

/dev/hdb2                               partition       133048  0       -4 
```

I usually assign ram+video as swap (128+4=132).  Now I see 133048 from /proc/swaps, but testdisk gave 133056.   I can't make fdisk create a swap of 133048.  It always round it to the nearest cylinder, and the closest I can come to is the current 133056.  Can I force this?  Is it wise?

----------

## NeddySeagoon

tecknojunky,

If fdisk is forcing the partition to cylender boundaries now, it will have done so before.

So I suspect you have the size of swap correct. The size given by /proc/swaps may be less than the partition size, since it may only report useful swap space. The man page says that the first 'page' is used to keep track of free spaces and so on, so I would not be unduly worried about swap ending in the wrong place.

Its time to have a look at the bounday between /dev/hdb2 and /dev/hdb3 with hexedit.

The very first sector of every partition is empty - someone may want to install grub there. I don't know what reiserfs puts next.

Good luck anyway.

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon!  :Very Happy: 

 *NeddySeagoon wrote:*   

> Its time to have a look at the bounday between /dev/hdb2 and /dev/hdb3 with hexedit.
> 
> The very first sector of every partition is empty - someone may want to install grub there. I don't know what reiserfs puts next.

 Yeah.  :Sad:  I'll try to discypher something from those bunch of ones and zeros.

 *NeddySeagoon wrote:*   

> Good luck anyway.

 You've been of great help  :Exclamation:   :Idea: 

----------

## NeddySeagoon

tecknojunky,

Read the reisefs code - I suspect the superblock will be read into a record for easy access.

Its likely to be at the the start of the partition too, since it must be outside the filesystem proper.

It has to be read to read the the filesystem. Thats true of all filesystems.

----------

## tecknojunky

For other reasons, I had to reboot my box.  While booting, the kernel issued a bunch of driveseek which may behinting on why I have such difficulties in aligning the partition table to the real thing on the drive.

Here's what dmesg recorded:

```
ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257656

Buffer I/O error on device hdb3, logical block 722735

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257656

Buffer I/O error on device hdb3, logical block 722735

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257656

Buffer I/O error on device hdb3, logical block 722735

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257600

Buffer I/O error on device hdb3, logical block 722728

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257600, sector=6257600

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257600

Buffer I/O error on device hdb3, logical block 722728

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257648

Buffer I/O error on device hdb3, logical block 722734

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

ide0: reset: success

hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257648, sector=6257648

ide: failed opcode was: unknown

end_request: I/O error, dev hdb, sector 6257648

Buffer I/O error on device hdb3, logical block 722734

cdrom: open failed.

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

Adding 1052248k swap on /dev/evms/hda2.  Priority:-1 extents:1 across:1052248k

Realtime LSM initialized (group 18, mlock=1)

8139too Fast Ethernet driver 0.9.27

ACPI: PCI Interrupt 0000:00:0d.0[A] -> Link [LNKD] -> GSI 10 (level, low) -> IRQ 10

eth0: RealTek RTL8139 at 0x7000, 00:50:fc:fe:64:4d, IRQ 10

eth0:  Identified 8139 chip type 'RTL-8139C'

tun: Universal TUN/TAP device driver, 1.6

tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

[drm] Initialized drm 1.0.0 20040925

Failure registering capabilities with primary security module.

cdrom: open failed.

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table

device-mapper: device 3:64 too small for target

device-mapper: dm-linear: Device lookup failed

device-mapper: error adding target to table
```

Now, I'm wondering if those are related to the fact the partition table might be misaligned, or if the drive's hardware or the mb controller have hickups or something.

----------

## NeddySeagoon

tecknojunky,

These errors

```
hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }

hdb: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=6257656, sector=6257656 
```

are low level read errors.

The drive is saying it cant find the block to read it. Sector 6257656 starts at byte 3,203,919,872 which may actually be off the end of your disc. It could be caused by errors in the partition table. How many bytes does you disk actually have ?

hdparm -i /dev/hdb  will show that.

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon!  :Very Happy: 

 *NeddySeagoon wrote:*   

> These errors
> 
> ```
> hdb: task_in_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }
> 
> ...

 

```
/dev/hdb:

 Model=SAMSUNG SV0322A, FwRev=JK200-35, SerialNo=0085J1EJB05903

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=11024/9/63, TrkSize=34902, SectSize=554, ECCbytes=4

 BuffType=DualPortCache, BuffSize=478kB, MaxMultSect=16, MultSect=16

 CurCHS=11024/9/63, CurSects=6250608, LBA=yes, LBAsects=6250608

 IORDY=yes, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 *udma2

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: ATA/ATAPI-4 X3T13 1153D revision 7:  1 2 3 4

 * signifies the current active mode
```

Yeah.  I noticed also that testdisk will show overlapping paritions like if they would have "slide" somehow.  In one of the above posts including testdisk outputs, I could not help notice that the only plausible root candidate spans pass the end of the drive.  Coincidently, it is also starting pass the swap partition by about the same amount of bytes.

I'm just about tempted to run a reiserfsck --rebuild-tree on the last partition I have marked.  But I have the feeling it's only to screw things up.

----------

## NeddySeagoon

tecknojunky,

Your post includes LBAsects=6250608, thats sectors 0..6250607,

So reading sector 6257656 can be expected to fail, its off the end of the drive.

That means your partition table is correct, and the superblock of your rieserfs is corrupt or

the partition table is not correct and the system is reading something thats not a reiserfs superbock but can't tell.

My money is is the former, since all the filesystems I know of can tell if they are reading a superbock or not.

Anyway, something is asking your kernel to read a piece of your disk you don't have.

----------

## tecknojunky

 *NeddySeagoon wrote:*   

> tecknojunky,

 NeddySeagoon!  :Very Happy: 

 *NeddySeagoon wrote:*   

> Your post includes LBAsects=6250608, thats sectors 0..6250607,
> 
> So reading sector 6257656 can be expected to fail, its off the end of the drive.
> 
> That means your partition table is correct, and the superblock of your rieserfs is corrupt or
> ...

 So, if I understand correctly, the kernel go read the superblock inside the partition I have delimited by guessing.  If I have guessed wrong, the result is similar to a C pointer holding a bogus address that I then try to access (segfault  :Rolling Eyes:  ).

So, if I have not identified correctly the size of the swap partition on my drive, it means the third partition (root) start somewhere nowhere near good.  The kernel then go try to read an allege superblock where it would expect to find one but which isnt.  Thus, it reads bogus data and tries to read past the end of the drive.

Am I assuming correctly?

----------

## NeddySeagoon

tecknojunky,

Exactly - but I would have expected the filesystem code to have some checks for a real superblock that were applied before the kernel tried to read anything else from the disc. If these checks are there (I don't know reiserfs) they clearly passed, since reads went ahead.

----------

