About data recovery, how can i do

i create a private work with three nodes ,A,B,C.
i put file with ipfs add at A node . other node get data with ipfs get. i see data storage at blocks.
i modify file content in node A. i can,t get file at A node, even if i recover the content of modify.

192:Downloads iinda$ ipfs get QmabAfNFj32UYZnVY9iwg7hvHR2TSteEXvDUz4tzCC4hyH
Saving file(s) to QmabAfNFj32UYZnVY9iwg7hvHR2TSteEXvDUz4tzCC4hyH
1.13 GB / 1.13 GB [===============================================] 100.00% 42s
Error: The block referred to by ‘QmUwLnVUoNyU5qxA6UUWVJfS3RGJ2d7TEc2cJosT3GEpMB’ was not a valid merkledag node
how can i do ? a little modify cause data damage, How is data security guaranteed?

i modify file content in node A. i can,t get file at A node, even if i recover the content of modify.

How did you modify the file?

Replication across multiple IPFS nodes would address intentional damage of the file like you’ve done. Replication at the filesystem level would help with data on disk being corrupted.

1 Like

i enter foler blocks\ZZ,
vi IQGECJOYVVE7YVF5UKOWP6PS5XOKMHPCQEHIQLAIRZ3HL4GSB5EZZQ.data and add some content in the first.
then i download file with ipfs get ,arrise valid merkledag node,but recover that file wit delete my added content ,ipfs get
arrise same errror.

what will i do exact ?? what command? i think ipfs get is Replication,but is not effect .
thanks!!

Once you corrupt a datastore I don’t know if there are tools available to recover the datastore. I know you can identify corrupt blocks on a node using ipfs verify, but I’m not sure what options are next besides starting over.

This is what I mean by replication helping protect against intentional corruption on one node.

  1. on IPFS node A
  • ipfs add your content and take note of the resulting hash (Qmhash)
  1. on IPFS node B
  • ipfs pin or ipfs get your hash (Qmhash)
  1. on IPFS node A
  • corrupt your IPFS datastore
  • then delete it and reinitialize your node with ipfs init
  • then ipfs pin or ipfs get your hash (Qmhash)

Node A should now be able to retrieve the hash without error assuming that Node B and Node A can communicate with each other.

1 Like

corrupt your IPFS datastore
then delete it and reinitialize your node with ipfs init

how can i find the special file of hash and delete the file of damaged,
All delete because of a little damage, a lot of data in node must ipfs get hash one by one is very difficult.
I don’t think the plan is very reliable.
thanks!!

Agreed that it’s not ideal. I don’t know if there are tools to salvage a corrupted repository without starting over, but there might be and I just don’t know about them.

I’m not exactly sure what you did and what went wrong so I can’t really help with your specific issue.

However, leerspace is right; if you corrupted your data, you’ve lost your data (although you haven’t lost the rest of it, recovering it will be a bit tricky).

Currently, there are two ways to better avoid data loss:

  1. IPFS Cluster (alpha quality). This will allow you to create a cluster where your files will be replicated across all nodes in the cluster.
  2. Replicate the underlying storage. E.g., use raid, backup frequently, etc. However, this won’t protect you from yourself (you can still corrupt your own data).
1 Like