vd(4)
NAME
vd - virtual disk
DESCRIPTION
The vd* devices are virtual disks made up by concatenating one or more
regular disks or partitions. A virtual disk will appear to have a size
equal to the sum of the sizes of the disks it is made of. The blocks in
a virtual disk are all the blocks in the real disks in the same order as
the order in which the disks were attached to the virtual disk. So if
virtual disk vd is made up of disks d0, d1, ... dn then the following
command will return true:
cat d0 d1 ... dn | cmp - vd
Virtual disks devices can be formed by using the following ioctl call on
an open virtual disk file descriptor:
ioctl(fd, DIOCVDATTACH, &struct vdisk_attach);
The third argument is a pointer to a struct vdisk_attach as defined in
<minix/vdisk.h>:
struct vdisk_attach {
int index; /* Position in the list of subdisks */
int task_nr; /* Subdisk = <task, minor> */
int minor;
};
The index field is the position that the subdisk must have in the list of
disks that make up the virtual disk. Attaching the first disk with index
0 (re)sets the list of subdisks to just that one disk. Each next disk
must have an index number that is one higher.
The task_nr and minor fields specify the disk device to use as a subdisk.
These numbers can be obtained by translating a device number with the
FSDEVMAP svrctl call.
One of the subdisks may be another virtual disk device. There is little
reason to do this now, but this may change if other methods of combining
disks are implemented.
The overhead of the virtual disk driver is so small it is hard to
measure. The main cost is a context switch to the task that handles the
proper subdisk. So there is no reason to shun the use of virtual disks
for performance reasons.
FILES
/dev/vd*
SEE ALSO
ioctl(2), svrctl(2), vdisk.conf(5), vdisk_ctrl(8).
NOTES
The driver allows up to 8 virtual disks. They can have 32 subdisks
total.
Virtual disks do not have partitions, so vd1 is not the first partition
of vd0, they are separate virtual disks.
BUGS
The "cat|cmp" example will fail if you use block devices that are not a
whole number of kilobytes in length. Raw devices always work.
Other interesting ways of combining disks, like striping, may well be
slower than concatenation under Minix. So don't hold your breath.
Disk devices used as subdisks should be made unusable to prevent aliasing
problems. For now, beware!
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)