S
S
SterhXXX2022-01-24 10:25:22
linux
SterhXXX, 2022-01-24 10:25:22

How to transfer bd Mysql from a partially broken hard drive mounted to a running Linux?

Good afternoon.
The hard drive crashed. After a series of manipulations, access to it was obtained and even the system starts up, but the file system works only in read mode. It is necessary to pull out bd MariaDB (Mysql) from it. Mounted the drive to a running machine. I don't know what's next. Or maybe you can boot on it to bring the file system out of read-only mode to dump it using mysqldump?
Please help. Zabbix stood there, a lot of work and soul was invested in it (((

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Bogachev, 2022-01-26
@SterhXXX

I fundamentally disagree with the answer from Melkij Trying
to bypass a physical failure on the HDD programmatically, and even at the DBMS level, is an extremely inefficient approach. And it is fraught with the loss of all data on the drive!
You need to find a working HDD of equal or larger volume. Connect both to a test PC and use ddrescue to make a clone of the failed disk OR make an image of it as a huge file. I would make a clone. And after ddrescue has done everything possible, already on a new working disk, look at files, connect databases, etc.
How to work with ddrescue there are many descriptions on the net and most importantly on their project website. The easiest way is to use the SystemRescue bootable flash drive
https://www.system-rescue.org/
ddrescue is there.
I recovered several times data from very bad screws.
There are many nuances. If you need help, call
+ seven nine O nine HH 17 HF1
I will tell and explain everything I know.
Be healthy.

M
Melkij, 2022-01-24
@melkij

  • double-check that the DBMS is stopped and not running
  • find datadir (e.g. /var/lib/mysql/ )
  • put on the working system mariadb (or mysql - find out which one was installed) of the same version
  • copy everything in datadir to the new location
  • start the DBMS and look at the log

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question