On Thu, Apr 30, 2015 at 11:33 AM, Craig Skinner <skin...@britvault.co.uk> wrote:
>
> Thinking about DUIDs & my dump scripts & 5.7 being released soon,
> does dump with DUIDs dump the raw character device, or the block device?
>
> /usr/src/sbin/dump/main.c notes:
> /* Convert potential duid into a device name */
> But I don't know how to read the C code.... Sorry.

It's the character device.  The code in question is:
/* Convert potential duid into a device name */
if ((diskfd = opendev(argv[i], O_RDONLY | O_NOFOLLOW, 0,
    &realpath)) >= 0) {
        argv[i] = strdup(realpath);
        [...]
}
The man page for opendev(3) lists its prototype as:
    int opendev(const char *path, int oflags, int dflags, char **realpath);

and for dflags:
    The dflags are specified by OR'ing the following values:
OPENDEV_PART attempt to open the raw partition during expansion
OPENDEV_BLCK open the block device (default is character device)

dump is calling opendev() with dflags=0 (defaults), so it's using the
character device.

Reply via email to