Failed Sector on HDD - MySQL Error?

  • Hi,

    didnt find a better topic so ... Im confronted with HDD crashes in the past, but I got everything working due to my backups ... It was not easy but it did work ...

    Now a Server of a friend is getting in a bad trouble.

    This in the syslog:

    Cant dump all databased - tried to copy /var/lib/mysq/ I got:


    cp: reading `/var/lib/mysql/ibdata1': Input/output error
    cp: failed to extend `/home/backups/mysql/ibdata1': Input/output error

    So can someone help my backing up the mysql database so I can replace the fault hdd? All web files, config files and so one are save ... :x

  • Are you using no RAID? When you replace the drive, do you need to reinstall the whole system?

    You could test this command to export all SQL DB's:

    1. mysqldump -uroot -p --all-databases > alldb.sql

    and to import:

    1. mysql -u root -p < alldb.sql
  • Its only a small workstation with one hdd ... the export is not possible:

    mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `domain_traffic` at row: 371550

    Its backing up over 1,9GB of Databases but at this (imscp database) the mysql server every time says goodbye ... and the syslog is spammed full of kernel errors

  • @FraggDieb

    Did you tried to check and fix bad sectors using fsck ? You should try this before any SQL db dump attempts. If you cannot repair we can do nothing for you. This explain why you must always store your backups on another server ;)