Thanks for your feedback! > I like the idea. I would have liked to read an explanation for the > selected solution though, or a brief description of it.
I'll add a description below for the benefit of other readers. > I think adding a check to make sure there is a nonzero duid [...] > is reasonable. Right, I'll add that. > I think -U should imply -u, since there is no use for it without it. I'm not sure. Whether or not -u is given, dump searches /etc/dumpdates for the date of the latest lower-level dump. With my patch, if you want dump to search by duid, you need to give it the -U flag. So, as it is now, -U should not imply -u. On the other hand, it might make sense to always search for both duid and device-filename (preferring the duid when both are present). Description of the diff: In main.c, when the flag -U is given, we set duidflag = 1. Then, the program proceeds normally to determine what is to be dumped. We end up with disk being the device file name. We then read the disklabel from disk using ioctl DIOCGDINFO. We then do duid = asprintf(...) to print the duid from the disklabel, followed by a '.' and a partition letter (last character in disk). In itime.c, the function getdumptime() reads off the date of the latest lower-level dump. The patch modifies it so that it searches for duid instead of disk if duidflag is set. Similarly, putdumptime() is modified to update /etc/dumpdates with duid instead of disk. In include/protocols/dumprestore.h, I had to change the format strings DUMPOUTFMT and DUMPINFMT. These are used for writing and reading /etc/dumpdates, and when we allow duids in that file, the first field has to be wider.
