I have an external drive formatted in ext4 that throws this error message when is plugged in EXT4-fs (sdd2): error count: 8 initial error at 1366215273 last error at 1366215527,it generally works just fine,apart from some times when it doesn't get automounted:I reckon it is about time for a fsck,but how can I do this in the safest possible way ? Is fsck -f -v the most advisable option ? Should I backup the data first ?


In general fsck is not dangerous above all not on volumes which can be mounted yet. I can suggest two possibilities to reduce the risk even more:

  1. Make a backup of the file system meta data: man e2image
  2. Put a DM device on top of the external drive (i.e. plain linear mapping over the whole device), make a snapshot (with permanent metadata) of this device, run e2fsck on the snapshot. If you are happy with the result, save the COW volume to an image file and then merge the snapshot changes back into the original volume.

AFAIK there are no tools for this kind of snapshot so you have to do that yourself with dmsetup. No black magic though. You need the DM targets snapshot-origin, snapshot, and snapshot-merge. See the device mapper documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.