forsyth20121205-174063a80cc13 years agoHistory
145 lines · 2.6 KB · Text
RawDownload
.TH DS 3.SH NAMEds \- compound device subsystems.SH SYNOPSIS.nf.B bind -b #k /dev .B /dev/ds.B /dev/ds/ctl.B /dev/ds/....fi.SH DESCRIPTION.I Dsbuilds complex block storage subsystems out of simpler ones.Inspired by the Plan 9 file server kernel's configuration strings,it provides device mirroring, partitioning, interleaving, and catenationfor block-oriented file systems..PPIt serves a two-level directory.The top level contains a single directory.BR ds ,which contains a control file.B ctland one file per configured device..PPThe control messages each introduce a new device, here named.IR new .The.I filearguments are interpreted in the name space of the writer..TP.BI mirror " new files" \fR...The device.I newcorresponds to a RAID 1 mirroring of.IR files .Writes to.BI neware handled by sequentially writing to the.I filesfrom right to left (the reverse ofof the order in the control message).If any write fails, the write is aborted.Reads from.BI neware handled by sequentially reading from the.I filesfrom left to right until one succeeds.The length of the mirror device is the minimum of the lengths of the.IR files ..TP.BI part " new file offset length"The device.I newcorresponds to the.I lengthbytes starting at.I offsetin.IR file .If.IR offset + lengthreaches past the end of.IR file ,.I lengthis silently reduced to fit..TP.BI inter " new files" \fR...The device.I newcorresponds to the block interleaving of.IR files ;an 8192-byte block size is assumed..TP.BI cat " name files" \fR...The device.I newcorresponds to the catenation of.IR files ..PD.LPIf the variable.B fsconfigis set in.IR plan9.ini (8)then.I dswill read its configuration from the file.B $fsconfigon the first attach.This is useful when the machine bootsfrom a local file server that uses.IR fs ..SH EXAMPLEMirror the two disks.B /dev/sdC0/dataand.B /dev/sdD0/dataas.BR /dev/ds/m0 ;similarly, mirror.B /dev/sdC1/dataand.B /dev/sdD1/dataas.BR /dev/ds/m1 :.IP.EXecho mirror m0 /dev/sdC0/data /dev/sdD0/data >/dev/ds/ctlecho mirror m1 /dev/sdC1/data /dev/sdD1/data >/dev/ds/ctl.EE.LPInterleave the two mirrored disks to create.BR /dev/ds/data :.IP.EXecho inter data /dev/ds/m0 /dev/ds/m1 >/dev/ds/ctl.EE.LPRun.IR kfs (4)on the interleaved device:.IP.EXdisk/kfs -f /dev/ds/data.EE.LPSave the configuration:.IP.EXcp /dev/ds/ctl /dev/fd0disk.EETo load the configuration automatically at boot time,add this to.IR plan9.ini :.IP.EXfsconfig=/dev/fd0disk.EE.SH "SEE ALSO".IR dossrv (4).SH SOURCE.B /os/port/devds.c.SH BUGSShould be able to select block size for interleaved devices.