Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 ?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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