.TH VD 4 .SH NAME vd \- virtual disk .SH DESCRIPTION The .B "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 .B vd is made up of disks .BR d0 , .BR d1 ", ..." .BI d n then the following command will return true: .PP .RS .BI "cat d0 d1 ... d" n " | cmp \- vd" .RE .PP Virtual disks devices can be formed by using the following .B ioctl call on an open virtual disk file descriptor: .sp .RS .ft B ioctl(\fIfd\fP, DIOCVDATTACH, &struct vdisk_attach); .ft R .RE .sp The third argument is a pointer to a .B struct vdisk_attach as defined in : .sp .nf .ta +4n +6n +16n struct vdisk_attach { int index; /* Position in the list of subdisks */ int task_nr; /* Subdisk = */ int minor; }; .fi .sp The .I 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. .PP The .I task_nr and .I minor fields specify the disk device to use as a subdisk. These numbers can be obtained by translating a device number with the .B FSDEVMAP svrctl call. .PP 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. .PP 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. .SH FILES /dev/vd* .SH "SEE ALSO" .BR ioctl (2), .BR svrctl (2), .BR vdisk.conf (5), .BR vdisk_ctrl (8). .SH NOTES The driver allows up to 8 virtual disks. They can have 32 subdisks total. .PP Virtual disks do not have partitions, so .B vd1 is .B not the first partition of .BR vd0 , they are separate virtual disks. .SH 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. .PP Other interesting ways of combining disks, like striping, may well be slower than concatenation under Minix. So don't hold your breath. .PP Disk devices used as subdisks should be made unusable to prevent aliasing problems. For now, .B beware! .SH AUTHOR Kees J. Bot (kjb@cs.vu.nl)