📄 vinum-object-naming.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Object Naming</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD 使用手册" href="index.html" /><link rel="UP" title="The Vinum Volume Manager" href="vinum-vinum.html" /><link rel="PREVIOUS" title="Some Examples" href="vinum-examples.html" /><link rel="NEXT" title="Configuring Vinum" href="vinum-config.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD 使用手册</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="vinum-examples.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 13. The Vinum Volume Manager</td><td width="10%" align="right" valign="bottom"><a href="vinum-config.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="VINUM-OBJECT-NAMING" name="VINUM-OBJECT-NAMING">13.7. ObjectNaming</a></h1><p>As described above, Vinum assigns default names to plexes and subdisks, although theymay be overridden. Overriding the default names is not recommended: experience with theVERITAS volume manager, which allows arbitrary naming of objects, has shown that thisflexibility does not bring a significant advantage, and it can cause confusion.</p><p>Names may contain any non-blank character, but it is recommended to restrict them toletters, digits and the underscore characters. The names of volumes, plexes and subdisksmay be up to 64 characters long, and the names of drives may be up to 32 characterslong.</p><p>Vinum objects are assigned device nodes in the hierarchy <ttclass="FILENAME">/dev/vinum</tt>. The configuration shown above would cause Vinum tocreate the following device nodes:</p><ul><li><p>The control devices <tt class="DEVICENAME">/dev/vinum/control</tt> and <ttclass="DEVICENAME">/dev/vinum/controld</tt>, which are used by <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">vinum</span>(8)</span> and the Vinumdaemon respectively.</p></li><li><p>Block and character device entries for each volume. These are the main devices used byVinum. The block device names are the name of the volume, while the character devicenames follow the BSD tradition of prepending the letter <span class="emphasis"><iclass="EMPHASIS">r</i></span> to the name. Thus the configuration above would include theblock devices <tt class="DEVICENAME">/dev/vinum/myvol</tt>, <ttclass="DEVICENAME">/dev/vinum/mirror</tt>, <ttclass="DEVICENAME">/dev/vinum/striped</tt>, <tt class="DEVICENAME">/dev/vinum/raid5</tt>and <tt class="DEVICENAME">/dev/vinum/raid10</tt>, and the character devices <ttclass="DEVICENAME">/dev/vinum/rmyvol</tt>, <ttclass="DEVICENAME">/dev/vinum/rmirror</tt>, <ttclass="DEVICENAME">/dev/vinum/rstriped</tt>, <ttclass="DEVICENAME">/dev/vinum/rraid5</tt> and <ttclass="DEVICENAME">/dev/vinum/rraid10</tt>. There is obviously a problem here: it ispossible to have two volumes called <span class="emphasis"><iclass="EMPHASIS">r</i></span> and <span class="emphasis"><iclass="EMPHASIS">rr</i></span>, but there will be a conflict creating the device node <ttclass="DEVICENAME">/dev/vinum/rr</tt>: is it a character device for volume <spanclass="emphasis"><i class="EMPHASIS">r</i></span> or a block device for volume <spanclass="emphasis"><i class="EMPHASIS">rr</i></span>? Currently Vinum does not address thisconflict: the first-defined volume will get the name.</p></li><li><p>A directory <tt class="DEVICENAME">/dev/vinum/drive</tt> with entries for each drive.These entries are in fact symbolic links to the corresponding disk nodes.</p></li><li><p>A directory <tt class="FILENAME">/dev/vinum/volume</tt> with entries for each volume.It contains subdirectories for each plex, which in turn contain subdirectories for theircomponent subdisks.</p></li><li><p>The directories <tt class="DEVICENAME">/dev/vinum/plex</tt>, <ttclass="DEVICENAME">/dev/vinum/sd</tt>, and <tt class="DEVICENAME">/dev/vinum/rsd</tt>,which contain block device nodes for each plex and block and character device nodesrespectively for each subdisk.</p></li></ul><p>For example, consider the following configuration file:</p><pre class="PROGRAMLISTING"> drive drive1 device /dev/sd1h drive drive2 device /dev/sd2h drive drive3 device /dev/sd3h drive drive4 device /dev/sd4h volume s64 setupstate plex org striped 64k sd length 100m drive drive1 sd length 100m drive drive2 sd length 100m drive drive3 sd length 100m drive drive4</pre><p>After processing this file, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">vinum</span>(8)</span> creates the following structure in <ttclass="FILENAME">/dev/vinum</tt>:</p><pre class="PROGRAMLISTING"> brwx------ 1 root wheel 25, 0x40000001 Apr 13 16:46 Control brwx------ 1 root wheel 25, 0x40000002 Apr 13 16:46 control brwx------ 1 root wheel 25, 0x40000000 Apr 13 16:46 controld drwxr-xr-x 2 root wheel 512 Apr 13 16:46 drive drwxr-xr-x 2 root wheel 512 Apr 13 16:46 plex crwxr-xr-- 1 root wheel 91, 2 Apr 13 16:46 rs64 drwxr-xr-x 2 root wheel 512 Apr 13 16:46 rsd drwxr-xr-x 2 root wheel 512 Apr 13 16:46 rvol brwxr-xr-- 1 root wheel 25, 2 Apr 13 16:46 s64 drwxr-xr-x 2 root wheel 512 Apr 13 16:46 sd drwxr-xr-x 3 root wheel 512 Apr 13 16:46 vol /dev/vinum/drive: total 0 lrwxr-xr-x 1 root wheel 9 Apr 13 16:46 drive1 -> /dev/sd1h lrwxr-xr-x 1 root wheel 9 Apr 13 16:46 drive2 -> /dev/sd2h lrwxr-xr-x 1 root wheel 9 Apr 13 16:46 drive3 -> /dev/sd3h lrwxr-xr-x 1 root wheel 9 Apr 13 16:46 drive4 -> /dev/sd4h /dev/vinum/plex: total 0 brwxr-xr-- 1 root wheel 25, 0x10000002 Apr 13 16:46 s64.p0 /dev/vinum/rsd: total 0 crwxr-xr-- 1 root wheel 91, 0x20000002 Apr 13 16:46 s64.p0.s0 crwxr-xr-- 1 root wheel 91, 0x20100002 Apr 13 16:46 s64.p0.s1 crwxr-xr-- 1 root wheel 91, 0x20200002 Apr 13 16:46 s64.p0.s2 crwxr-xr-- 1 root wheel 91, 0x20300002 Apr 13 16:46 s64.p0.s3 /dev/vinum/rvol: total 0 crwxr-xr-- 1 root wheel 91, 2 Apr 13 16:46 s64 /dev/vinum/sd: total 0 brwxr-xr-- 1 root wheel 25, 0x20000002 Apr 13 16:46 s64.p0.s0 brwxr-xr-- 1 root wheel 25, 0x20100002 Apr 13 16:46 s64.p0.s1 brwxr-xr-- 1 root wheel 25, 0x20200002 Apr 13 16:46 s64.p0.s2 brwxr-xr-- 1 root wheel 25, 0x20300002 Apr 13 16:46 s64.p0.s3 /dev/vinum/vol: total 1 brwxr-xr-- 1 root wheel 25, 2 Apr 13 16:46 s64 drwxr-xr-x 3 root wheel 512 Apr 13 16:46 s64.plex /dev/vinum/vol/s64.plex: total 1 brwxr-xr-- 1 root wheel 25, 0x10000002 Apr 13 16:46 s64.p0 drwxr-xr-x 2 root wheel 512 Apr 13 16:46 s64.p0.sd /dev/vinum/vol/s64.plex/s64.p0.sd: total 0 brwxr-xr-- 1 root wheel 25, 0x20000002 Apr 13 16:46 s64.p0.s0 brwxr-xr-- 1 root wheel 25, 0x20100002 Apr 13 16:46 s64.p0.s1 brwxr-xr-- 1 root wheel 25, 0x20200002 Apr 13 16:46 s64.p0.s2 brwxr-xr-- 1 root wheel 25, 0x20300002 Apr 13 16:46 s64.p0.s3</pre><p>Although it is recommended that plexes and subdisks should not be allocated specificnames, Vinum drives must be named. This makes it possible to move a drive to a differentlocation and still recognize it automatically. Drive names may be up to 32 characterslong.</p><div class="SECT2"><h2 class="SECT2"><a id="AEN19104" name="AEN19104">13.7.1. Creating File Systems</a></h2><p>Volumes appear to the system to be identical to disks, with one exception. Unlike<span class="TRADEMARK">UNIX</span>® drives, Vinum does not partition volumes, whichthus do not contain a partition table. This has required modification to some diskutilities, notably <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">newfs</span>(8)</span>, which previously tried to interpret thelast letter of a Vinum volume name as a partition identifier. For example, a disk drivemay have a name like <tt class="DEVICENAME">/dev/ad0a</tt> or <ttclass="DEVICENAME">/dev/da2h</tt>. These names represent the first partition (<ttclass="DEVICENAME">a</tt>) on the first (0) IDE disk (<tt class="DEVICENAME">ad</tt>) andthe eighth partition (<tt class="DEVICENAME">h</tt>) on the third (2) SCSI disk (<ttclass="DEVICENAME">da</tt>) respectively. By contrast, a Vinum volume might be called <ttclass="DEVICENAME">/dev/vinum/concat</tt>, a name which has no relationship with apartition name.</p><p>Normally, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">newfs</span>(8)</span> interprets the name of the disk andcomplains if it cannot understand it. For example:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">newfs /dev/vinum/concat</kbd>newfs: /dev/vinum/concat: can't figure out file system partition</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> The following is only valid for FreeBSD versions prior to 5.0:</p></blockquote></div><p>In order to create a file system on this volume, use the <var class="OPTION">-v</var>option to <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">newfs</span>(8)</span>:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">newfs -v /dev/vinum/concat</kbd></pre></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="vinum-examples.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="vinum-config.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Some Examples</td><td width="34%" align="center" valign="top"><a href="vinum-vinum.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Configuring Vinum</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -