现在的位置: 首页FreeBSD>正文
FreeBSD下使用内存文件系统 [原创]
2012年02月28日 FreeBSD FreeBSD下使用内存文件系统 [原创]已关闭评论 ⁄ 被围观 47,703 次+
  1. MDCONFIG(8) FreeBSD System Manager's Manual MDCONFIG(8)   
  2.   
  3. NAME   
  4. mdconfig -- configure and enable memory disks   
  5.   
  6. SYNOPSIS   
  7. mdconfig -a -t type [-n] [-o [no]option] ... [-f file] [-s size]   
  8. [-S sectorsize] [-u unit] [-x sectors/track] [-y heads/cyl]   
  9. mdconfig -d -u unit   
  10. mdconfig -l [-n] [-u unit]   
  11.   
  12. DESCRIPTION   
  13. The mdconfig utility configures and enables md(4) devices.   
  14.   
  15. Options indicate an action to be performed:   
  16.   
  17. -a Attach a memory disk. This will configure and attach a memory   
  18. disk with the parameters specified and attach it to the system.   
  19.   
  20. -d Detach a memory disk from the system and release all resources.   
  21.   
  22. -t type   
  23. Select the type of the memory disk.   
  24.   
  25. malloc Storage for this type of memory disk is allocated with   
  26. malloc(9). This limits the size to the malloc bucket   
  27. limit in the kernel. If the -o reserve option is not   
  28. set, creating and filling a large malloc-backed memory   
  29. disk is a very easy way to panic a system.   
  30.   
  31. vnode A file specified with -f file becomes the backingstore   
  32. for this memory disk.   
  33.   
  34. swap Swap space is used to back this memory disk.   
  35.   
  36. -f file   
  37. Filename to use for the vnode type memory disk. Options -a and -t   
  38. vnode are implied if not specified.   
  39.   
  40. -l List configured devices. If given with -u, display details about   
  41. that particular device.   
  42.   
  43. -n When printing md device names, print only the unit number without   
  44. the md prefix.   
  45.   
  46. -s size   
  47. Size of the memory disk. Size is the number of 512 byte sectors   
  48. unless suffixed with a b, k, m, g, or t which denotes byte, kilo-   
  49. byte, megabyte, gigabyte and terabyte respectively. Options -a   
  50. and -t swap are implied if not specified.   
  51.   
  52. -S sectorsize   
  53. Sectorsize to use for malloc backed device.   
  54.   
  55. -x sectors/track   
  56. See the description of the -y option below.   
  57.   
  58. -y heads/cylinder   
  59. For malloc or vnode backed devices, the -x and -y options can be   
  60. used to specify a synthetic geometry. This is useful for con-   
  61. structing bootable images for later download to other devices.   
  62.   
  63. -o [no]option   
  64. Set or reset options.   
  65.   
  66. [no]async   
  67. For vnode backed devices: avoid IO_SYNC for increased   
  68. performance but at the risk of deadlocking the entire   
  69. kernel.   
  70.   
  71. [no]reserve   
  72. Allocate and reserve all needed storage from the start,   
  73. rather than as needed.   
  74.   
  75. [no]cluster   
  76. Enable clustering on this disk.   
  77.   
  78. [no]compress   
  79. Enable/Disable compression features to reduce memory   
  80. usage.   
  81.   
  82. [no]force   
  83. Disable/Enable extra sanity checks to prevent the user   
  84. from doing something that might adversely affect the sys-   
  85. tem.   
  86.   
  87. [no]readonly   
  88. Enable/Disable readonly mode.   
  89.   
  90. -u unit   
  91. Request a specific unit number for the md(4) device instead of   
  92. automatic allocation.   
  93.   
  94. EXAMPLES   
  95. To create a 4 megabyte malloc(9) backed memory disk. The name of the   
  96. allocated unit will be output on stdout like ``md3'':   
  97.   
  98. mdconfig -a -t malloc -s 4m   
  99.   
  100. To create a disk named /dev/md4 with /tmp/boot.flp as backing:   
  101.   
  102. mdconfig -a -t vnode -f /tmp/boot.flp -u 4  
  103.   
  104. To detach and free all resources used by /dev/md4:   
  105.   
  106. mdconfig -d -u 4  
  107.   
  108. To create and mount a 128MByte swap backed file system on /tmp:   
  109.   
  110. mdconfig -a -t swap -s 128M -u 10  
  111. newfs -U /dev/md10   
  112. mount /dev/md10 /tmp   
  113. chmod 1777 /tmp   
  114.   
  115. To create a 5MB file-backed disk ( --a and --t vnode are implied):   
  116.   
  117. dd if=/dev/zero of=somebackingfile bs=1k count=5k   
  118. mdconfig -f somebackingfile -u 0  
  119. bsdlabel -w md0 auto   
  120. newfs md0c   
  121. mount /dev/md0c /mnt   
  122.   
  123. SEE ALSO   
  124. md(4), bsdlabel(8), fdisk(8), mdmfs(8), malloc(9)   
  125.   
  126. HISTORY   
  127. The mdconfig utility first appeared in FreeBSD 7.0 as a cleaner replace-   
  128. ment for the vn(4) and vnconfig(8) combo.   
  129.   
  130. AUTHORS   
  131. The mdconfig utility was written by Poul-Henning Kamp <phk@FreeBSD.org>.   
  132.   
  133. FreeBSD 7.2 November 62010 FreeBSD 7.2  
本文地址:http://www.92csz.com/31/1076.html
如非注明则为本站原创文章,欢迎转载。转载请注明转载自:moon's blog

上一页 1 2 3 4 5 6 下一页

抱歉!评论已关闭.