Menu

Feature request: ignore-disk for diff (and small bug report)

Help
jwill42
2014-10-20
2014-10-25
  • jwill42

    jwill42 - 2014-10-20

    I think a useful feature for SnapRAID to have would be an option that can ignore one or more specified drives when running the diff command.

    This would be useful if you have had one or more drives fail, and you are wondering if you have changed any of the files on the other drives, so you know what to expect before you start a fix command. Say that you have two drives that failed, d3 and d8. You could say

    snapraid --ignore-disk d3,d8 diff

    and snapraid would run the usual diff command except that it would not report any changes on drives d3 or d8.

    One more thing. I tried unmounting one of my drives and then running snapraid diff to see what would happen. As I expected, it reported all of the files on the unmounted drive as being removed. But it also included on STDERR a message which I believe is incorrect and therefore a bug:

    All the files previously present in disk 'r3c2' at dir '/mnt/r3c2/' are now missing or rewritten!
    This could happen when deleting all the files from a disk,
    and restoring them with a program not setting correctly the timestamps.
    If this is really what you are doing, you can 'diff' anyway,
    using 'snapraid --force-empty diff'.
    Instead, it's possible that you have some disks not mounted.

    The part about 'snapraid --force-empty diff' is what I think is a bug. The man page says that --force-empty can only be used with the sync command, and indeed, when I tried it with the diff command it did not do anything very helpful. It just complained about the UUID being changed, suppressed the previous error message, and printed a table of the changes (all the "removed" files).

     

    Last edit: jwill42 2014-10-20
  • Andrea Mazzoleni

    Hi jwill42,

    Yes, you are correct. For diff doesn't make sense to have --force-empty, and also --force-zero. Just fixed that, and added a TODO entry for allow to filter disks in diff.

    Ciao,
    Andrea

     

Log in to post a comment.

MongoDB Logo MongoDB