Hi -
> After a power break the file ibdata1 become corrupted. I think it's a hardware issue (got an I/O error when trying to copy ibdata1 file). So I tried to save what I can using:
> dd if=/var/lib/mysql/ibdata1 of=/var/lib/mysql/ibdata1.recovery conv=noerrors
>
> I managed to get ibdata1.recovery with a similar size to original ibdata1. So I backed up ibdata1 and renamed ibdata1.recovery to ibdata1.
>
> I tried with innodb_force_recovery=1 -> 6, no luck. I get these errors:
>
> "120807 21:41:51InnoDB: Error: trying to access a stray pointer 0x1c4a7ff8
> InnoDB: buf pool start is at 0x9c490000, end at 0xac490000
> InnoDB: Probable reason is database corruption or memory"
>
> I've tried this command:
> ./constraints_parser -5 -f /var/lib/mysql/ibdata1
> but all I see is SYS_TABLES
>
> Is there any way to "fix" ibdata1 or recover the databases?
Honestly it doesn't look good and would require qualified manual work.
It depends on how much data at what exactly offsets was corrupted. But
it should be possible to recover the data going page by page, or if
just a few pages corrupted, creating a fixed image of them. For
mission-critical data in the absence of backups I can of course
suggest contracting us to do the recovery.
Maybe Aleksandr could comment more?
--
Laurynas
www.percona.com