14d7de91fSDima Dorfman.\" 2d69f5deeSDima Dorfman.\" Copyright (c) 2001 Dima Dorfman. 34d7de91fSDima Dorfman.\" All rights reserved. 44d7de91fSDima Dorfman.\" 54d7de91fSDima Dorfman.\" Redistribution and use in source and binary forms, with or without 64d7de91fSDima Dorfman.\" modification, are permitted provided that the following conditions 74d7de91fSDima Dorfman.\" are met: 84d7de91fSDima Dorfman.\" 1. Redistributions of source code must retain the above copyright 94d7de91fSDima Dorfman.\" notice, this list of conditions and the following disclaimer. 104d7de91fSDima Dorfman.\" 2. Redistributions in binary form must reproduce the above copyright 114d7de91fSDima Dorfman.\" notice, this list of conditions and the following disclaimer in the 124d7de91fSDima Dorfman.\" documentation and/or other materials provided with the distribution. 134d7de91fSDima Dorfman.\" 144d7de91fSDima Dorfman.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 154d7de91fSDima Dorfman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 164d7de91fSDima Dorfman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 174d7de91fSDima Dorfman.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 184d7de91fSDima Dorfman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 194d7de91fSDima Dorfman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 204d7de91fSDima Dorfman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 214d7de91fSDima Dorfman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 224d7de91fSDima Dorfman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 234d7de91fSDima Dorfman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 244d7de91fSDima Dorfman.\" SUCH DAMAGE. 254d7de91fSDima Dorfman.\" 264d7de91fSDima Dorfman.\" $FreeBSD$ 274d7de91fSDima Dorfman.\" 28*bf6619baSKonstantin Belousov.Dd September 4, 2011 294d7de91fSDima Dorfman.Dt MDMFS 8 304d7de91fSDima Dorfman.Os 314d7de91fSDima Dorfman.Sh NAME 32f72709f6SDoug Barton.Nm mdmfs , 33f72709f6SDoug Barton.Nm mount_mfs 344d7de91fSDima Dorfman.Nd configure and mount an in-memory file system using the 354d7de91fSDima Dorfman.Xr md 4 364d7de91fSDima Dorfmandriver 374d7de91fSDima Dorfman.Sh SYNOPSIS 384d7de91fSDima Dorfman.Nm 39*bf6619baSKonstantin Belousov.Op Fl DLlMNPStUX 404d7de91fSDima Dorfman.Op Fl a Ar maxcontig 414d7de91fSDima Dorfman.Op Fl b Ar block-size 42c72132f0SMatteo Riondato.Op Fl c Ar blocks-per-cylinder-group 43c72132f0SMatteo Riondato.Op Fl d Ar max-extent-size 4463f8ddbeSMaxim Sobolev.Op Fl E Ar path-mdconfig 454d7de91fSDima Dorfman.Op Fl e Ar maxbpg 464d7de91fSDima Dorfman.Op Fl F Ar file 474d7de91fSDima Dorfman.Op Fl f Ar frag-size 484d7de91fSDima Dorfman.Op Fl i Ar bytes 494d7de91fSDima Dorfman.Op Fl m Ar percent-free 504d7de91fSDima Dorfman.Op Fl n Ar rotational-positions 514d7de91fSDima Dorfman.Op Fl O Ar optimization 524d7de91fSDima Dorfman.Op Fl o Ar mount-options 534d7de91fSDima Dorfman.Op Fl p Ar permissions 544d7de91fSDima Dorfman.Op Fl s Ar size 55622448faSRobert Watson.Op Fl v Ar version 569dde6035SDima Dorfman.Op Fl w Ar user : Ns Ar group 574d7de91fSDima Dorfman.Ar md-device 584d7de91fSDima Dorfman.Ar mount-point 594d7de91fSDima Dorfman.Sh DESCRIPTION 604d7de91fSDima DorfmanThe 614d7de91fSDima Dorfman.Nm 62e1205e80SPhilippe Charnierutility is designed to be a work-alike and look-alike of the deprecated 634d7de91fSDima Dorfman.Xr mount_mfs 8 . 644d7de91fSDima DorfmanThe end result is essentially the same, 654d7de91fSDima Dorfmanbut is accomplished in a completely different way. 66e1205e80SPhilippe CharnierThe 674d7de91fSDima Dorfman.Nm 68e1205e80SPhilippe Charnierutility configures an 694d7de91fSDima Dorfman.Xr md 4 704d7de91fSDima Dorfmandisk using 714d7de91fSDima Dorfman.Xr mdconfig 8 , 72e7e3ba9bSMatteo Riondatoputs a UFS file system on it (unless 73e7e3ba9bSMatteo Riondato.Fl P 74e7e3ba9bSMatteo Riondatowas specified) using 754d7de91fSDima Dorfman.Xr newfs 8 , 764d7de91fSDima Dorfmanand mounts it using 774d7de91fSDima Dorfman.Xr mount 8 . 78de63bf71SMatteo RiondatoIt can handle 79de63bf71SMatteo Riondato.Xr geom_uzip 4 80032ae0f3SCeri Daviescompressed disk images, as long as the kernel supports this GEOM class. 814d7de91fSDima DorfmanAll the command line options are passed to the appropriate program 824d7de91fSDima Dorfmanat the appropriate stage in order to achieve the desired effect. 834d7de91fSDima Dorfman.Pp 844d7de91fSDima DorfmanBy default, 854d7de91fSDima Dorfman.Nm 864d7de91fSDima Dorfmancreates a swap-based 874d7de91fSDima Dorfman.Pq Dv MD_SWAP 884d7de91fSDima Dorfmandisk with soft-updates enabled 894d7de91fSDima Dorfmanand mounts it on 904d7de91fSDima Dorfman.Ar mount-point . 914d7de91fSDima DorfmanIt uses the 924d7de91fSDima Dorfman.Xr md 4 934d7de91fSDima Dorfmandevice specified by 944d7de91fSDima Dorfman.Ar md-device . 954d7de91fSDima DorfmanIf 964d7de91fSDima Dorfman.Ar md-device 974d7de91fSDima Dorfmanis 984d7de91fSDima Dorfman.Ql md 994d7de91fSDima Dorfman(no unit number), 1004d7de91fSDima Dorfmanit will use 1014d7de91fSDima Dorfman.Xr md 4 Ns 's 1024d7de91fSDima Dorfmanauto-unit feature to automatically select an unused device. 1034d7de91fSDima DorfmanUnless otherwise specified with one of the options below, 1044d7de91fSDima Dorfmanit uses the default arguments to all the helper programs. 1054d7de91fSDima Dorfman.Pp 1064d7de91fSDima DorfmanThe following options are available. 1074d7de91fSDima DorfmanWhere possible, 1084d7de91fSDima Dorfmanthe option letter matches the one used by 1094d7de91fSDima Dorfman.Xr mount_mfs 8 1104d7de91fSDima Dorfmanfor the same thing. 1119dde6035SDima Dorfman.Bl -tag -width indent 1124d7de91fSDima Dorfman.It Fl a Ar maxcontig 1134d7de91fSDima DorfmanSpecify the maximum number of contiguous blocks that will be laid 1144d7de91fSDima Dorfmanout before forcing a rotational delay 1154d7de91fSDima Dorfman(see the 1164d7de91fSDima Dorfman.Fl d 1174d7de91fSDima Dorfmanoption). 1184d7de91fSDima Dorfman.It Fl b Ar block-size 1194d7de91fSDima DorfmanThe block size of the file system, in bytes. 120c72132f0SMatteo Riondato.It Fl c Ar blocks-per-cylinder-group 121c72132f0SMatteo RiondatoThe number of blocks per cylinder group in the file system. 1224d7de91fSDima Dorfman.It Fl D 1234d7de91fSDima DorfmanIf not using auto-unit, 1249dde6035SDima Dorfmando not run 1254d7de91fSDima Dorfman.Xr mdconfig 8 1264d7de91fSDima Dorfmanto try to detach the unit before attaching it. 127c72132f0SMatteo Riondato.It Fl d Ar max-extent-size 128c72132f0SMatteo RiondatoThe file system may choose to store large files using extents. 129c72132f0SMatteo RiondatoThis parameter specifies the largest extent size that may be 130c72132f0SMatteo Riondatoused. It is presently limited to its default value which is 16 131c72132f0SMatteo Riondatotimes the file system blocksize. 13263f8ddbeSMaxim Sobolev.It Fl E Ar path-mdconfig 13363f8ddbeSMaxim SobolevUse 13463f8ddbeSMaxim Sobolev.Ar path-mdconfig 13563f8ddbeSMaxim Sobolevas a location of the 13663f8ddbeSMaxim Sobolev.Xr mdconfig 8 13763f8ddbeSMaxim Sobolevutility. 1384d7de91fSDima Dorfman.It Fl e Ar maxbpg 1394d7de91fSDima DorfmanIndicate the maximum number of blocks any single file can allocate 1404d7de91fSDima Dorfmanout of a cylinder group before it is forced to begin allocating 1414d7de91fSDima Dorfmanblocks from another cylinder group. 1424d7de91fSDima Dorfman.It Fl F Ar file 1434d7de91fSDima DorfmanCreate a vnode-backed 1444d7de91fSDima Dorfman.Pq Dv MD_VNODE 1454d7de91fSDima Dorfmanmemory disk backed by 1464d7de91fSDima Dorfman.Ar file . 1474d7de91fSDima Dorfman.It Fl f Ar frag-size 1484d7de91fSDima DorfmanThe fragment size of the file system in bytes. 1494d7de91fSDima Dorfman.It Fl i Ar bytes 1504d7de91fSDima DorfmanNumber of bytes per inode. 1511d3170aaSRobert Watson.It Fl l 152d04b5dfeSRuslan ErmilovEnable multilabel MAC on the new file system. 1534d7de91fSDima Dorfman.It Fl L 1544d7de91fSDima DorfmanShow the output of the helper programs. 1554d7de91fSDima DorfmanBy default, 1564d7de91fSDima Dorfmanit is sent to 1574d7de91fSDima Dorfman.Pa /dev/null . 1584d7de91fSDima Dorfman.It Fl M 1594d7de91fSDima DorfmanCreate a 1604d7de91fSDima Dorfman.Xr malloc 9 1614d7de91fSDima Dorfmanbacked disk 1624d7de91fSDima Dorfman.Pq Dv MD_MALLOC 1634d7de91fSDima Dorfmaninstead of a swap-backed disk. 1644d7de91fSDima Dorfman.It Fl m Ar percent-free 1654d7de91fSDima DorfmanThe percentage of space reserved for the superuser. 1664d7de91fSDima Dorfman.It Fl N 1679dde6035SDima DorfmanDo not actually run the helper programs. 1684d7de91fSDima DorfmanThis is most useful in conjunction with 1694d7de91fSDima Dorfman.Fl X . 1704d7de91fSDima Dorfman.It Fl n Ar rotational-positions 1714d7de91fSDima DorfmanThe default number of rotational positions to distinguish. 1724d7de91fSDima Dorfman.It Fl O Ar optimization 1734d7de91fSDima DorfmanSelect the optimization preference; 1744d7de91fSDima Dorfmanvalid choices are 1759dde6035SDima Dorfman.Cm space 1764d7de91fSDima Dorfmanand 1779dde6035SDima Dorfman.Cm time , 1784d7de91fSDima Dorfmanwhich will optimize for minimum space fragmentation and 1794d7de91fSDima Dorfmanminimum time spent allocating blocks, 1804d7de91fSDima Dorfmanrespectively. 1814d7de91fSDima Dorfman.It Fl o Ar mount-options 1824d7de91fSDima DorfmanSpecify the mount options with which to mount the file system. 1834d7de91fSDima DorfmanSee 1844d7de91fSDima Dorfman.Xr mount 8 1854d7de91fSDima Dorfmanfor more information. 18605b2fd30SDima Dorfman.It Fl P 18705b2fd30SDima DorfmanPreserve the existing file system; 18805b2fd30SDima Dorfmando not run 18905b2fd30SDima Dorfman.Xr newfs 8 . 19005b2fd30SDima DorfmanThis only makes sense if 19105b2fd30SDima Dorfman.Fl F 19205b2fd30SDima Dorfmanis specified to create a vnode-backed disk. 1934d7de91fSDima Dorfman.It Fl p Ar permissions 1944d7de91fSDima DorfmanSet the file (directory) permissions of the mount point 1954d7de91fSDima Dorfman.Ar mount-point 1964d7de91fSDima Dorfmanto 1974d7de91fSDima Dorfman.Ar permissions . 198ce03e3a7SYaroslav TykhiyThe 199ce03e3a7SYaroslav Tykhiy.Ar permissions 200ce03e3a7SYaroslav Tykhiyargument can be in any of the mode formats recognized by 201ce03e3a7SYaroslav Tykhiy.Xr chmod 1 . 202ce03e3a7SYaroslav TykhiyIf symbolic permissions are specified, 203ce03e3a7SYaroslav Tykhiythe operation characters 204ce03e3a7SYaroslav Tykhiy.Dq + 205ce03e3a7SYaroslav Tykhiyand 206ce03e3a7SYaroslav Tykhiy.Dq - 207ce03e3a7SYaroslav Tykhiyare interpreted relative to the initial permissions of 208ce03e3a7SYaroslav Tykhiy.Dq a=rwx . 2094d7de91fSDima Dorfman.It Fl S 2109dde6035SDima DorfmanDo not enable soft-updates on the file system. 2114d7de91fSDima Dorfman.It Fl s Ar size 2124d7de91fSDima DorfmanSpecify the size of the disk to create. 2134d7de91fSDima DorfmanThis only makes sense if 2144d7de91fSDima Dorfman.Fl F 2154d7de91fSDima Dorfmanis 2164d7de91fSDima Dorfman.Em not 2174d7de91fSDima Dorfmanspecified. 2184d7de91fSDima DorfmanThat is, 2194d7de91fSDima Dorfmanthis will work for the default swap-backed 2204d7de91fSDima Dorfman.Pq Dv MD_SWAP 2214d7de91fSDima Dorfmandisks, 2224d7de91fSDima Dorfmanand the optional 2234d7de91fSDima Dorfman.Pq Fl M 2244d7de91fSDima Dorfman.Xr malloc 9 2254d7de91fSDima Dorfmanbacked disks 2264d7de91fSDima Dorfman.Pq Dv MD_MALLOC . 227*bf6619baSKonstantin Belousov.It Fl t 228*bf6619baSKonstantin BelousovTurn on the TRIM enable flag for 229*bf6619baSKonstantin Belousov.Xr newfs 8 . 230*bf6619baSKonstantin BelousovThe 231*bf6619baSKonstantin Belousov.Xr md 4 232*bf6619baSKonstantin Belousovdevice supports the BIO_DELETE command, enabling the TRIM on created 233*bf6619baSKonstantin Belousovfilesystem allows return of freed memory to the system pool. 234f7acb7e4SDima Dorfman.It Fl U 235f7acb7e4SDima DorfmanEnable soft-updates on the file system. 236957d7c8fSRuslan ErmilovThis is the default, and is accepted only 237f7acb7e4SDima Dorfmanfor compatibility. 238f7acb7e4SDima DorfmanIt is only really useful to negate the 239f7acb7e4SDima Dorfman.Fl S 240f7acb7e4SDima Dorfmanflag, should such a need occur. 241622448faSRobert Watson.It Fl v Ar version 242622448faSRobert WatsonSpecify the UFS version number for use on the file system; it may be 243622448faSRobert Watsoneither 244622448faSRobert Watson.Dv 1 245622448faSRobert Watsonor 246622448faSRobert Watson.Dv 2 . 247622448faSRobert WatsonThe default is derived from the default of the 248622448faSRobert Watson.Xr newfs 8 249622448faSRobert Watsoncommand. 2509dde6035SDima Dorfman.It Fl w Ar user : Ns Ar group 2519dde6035SDima DorfmanSet the owner and group to 2524d7de91fSDima Dorfman.Ar user 2534d7de91fSDima Dorfmanand 2544d7de91fSDima Dorfman.Ar group , 2554d7de91fSDima Dorfmanrespectively. 2564d7de91fSDima DorfmanThe arguments have the same semantics as with 2574d7de91fSDima Dorfman.Xr chown 8 , 2589dde6035SDima Dorfmanbut specifying just a 2599dde6035SDima Dorfman.Ar user 2609dde6035SDima Dorfmanor just a 2619dde6035SDima Dorfman.Ar group 2629dde6035SDima Dorfmanis not supported. 263ab1d004fSDima Dorfman.It Fl X 264ab1d004fSDima DorfmanPrint what command will be run before running it, and 265ab1d004fSDima Dorfmanother assorted debugging information. 2664d7de91fSDima Dorfman.El 2674d7de91fSDima Dorfman.Pp 2684d7de91fSDima DorfmanThe 2694d7de91fSDima Dorfman.Fl F 2704d7de91fSDima Dorfmanand 2714d7de91fSDima Dorfman.Fl s 2724d7de91fSDima Dorfmanoptions are passed to 2734d7de91fSDima Dorfman.Xr mdconfig 8 2744d7de91fSDima Dorfmanas 2754d7de91fSDima Dorfman.Fl f 2764d7de91fSDima Dorfmanand 2774d7de91fSDima Dorfman.Fl s , 2784d7de91fSDima Dorfmanrespectively. 2794d7de91fSDima DorfmanThe 2809dde6035SDima Dorfman.Fl a , b , c , d , e , f , i , m 2814d7de91fSDima Dorfmanand 2824d7de91fSDima Dorfman.Fl n 2834d7de91fSDima Dorfmanoptions are passed to 2844d7de91fSDima Dorfman.Xr newfs 8 2854d7de91fSDima Dorfmanwith the same letter; 2864d7de91fSDima Dorfmanthe 2874d7de91fSDima Dorfman.Fl O 2884d7de91fSDima Dorfmanoption is passed to 2894d7de91fSDima Dorfman.Xr newfs 8 2904d7de91fSDima Dorfmanas 2914d7de91fSDima Dorfman.Fl o . 2924d7de91fSDima DorfmanThe 2934d7de91fSDima Dorfman.Fl o 2944d7de91fSDima Dorfmanoption is passed to 2954d7de91fSDima Dorfman.Xr mount 8 2964d7de91fSDima Dorfmanwith the same letter. 2974d7de91fSDima DorfmanSee the programs that the options are passed to for more information 2984d7de91fSDima Dorfmanon their semantics. 2994d7de91fSDima Dorfman.Sh EXAMPLES 3004d7de91fSDima DorfmanCreate and mount a 32 megabyte swap-backed file system on 3014d7de91fSDima Dorfman.Pa /tmp : 3024d7de91fSDima Dorfman.Pp 3039dde6035SDima Dorfman.Dl "mdmfs -s 32m md /tmp" 3044d7de91fSDima Dorfman.Pp 3054460871bSDoug BartonThe same file system created as an entry in 3064460871bSDoug Barton.Pa /etc/fstab : 307031ba6ffSRuslan Ermilov.Pp 3084460871bSDoug Barton.Dl "md /tmp mfs rw,-s32m 2 0" 3094460871bSDoug Barton.Pp 3104d7de91fSDima DorfmanCreate and mount a 16 megabyte malloc-backed file system on 3114d7de91fSDima Dorfman.Pa /tmp 3124d7de91fSDima Dorfmanusing the 3134d7de91fSDima Dorfman.Pa /dev/md1 3144d7de91fSDima Dorfmandevice; 3154d7de91fSDima Dorfmanfurthermore, 316ba40ba47SDima Dorfmando not use soft-updates on it and mount it 3174d7de91fSDima Dorfman.Cm async : 3184d7de91fSDima Dorfman.Pp 3199dde6035SDima Dorfman.Dl "mdmfs -M -S -o async -s 16m md1 /tmp" 320de63bf71SMatteo Riondato.Pp 321de63bf71SMatteo RiondatoCreate and mount a 322de63bf71SMatteo Riondato.Xr geom_uzip 4 323de63bf71SMatteo Riondatobased compressed disk image: 324de63bf71SMatteo Riondato.Pp 325de63bf71SMatteo Riondato.Dl "mdmfs -P -F foo.uzip -oro md.uzip /tmp/" 326de63bf71SMatteo Riondato.Pp 327032ae0f3SCeri DaviesMount the same image, specifying the 328de63bf71SMatteo Riondato.Pa /dev/md1 329de63bf71SMatteo Riondatodevice: 330de63bf71SMatteo Riondato.Pp 331de63bf71SMatteo Riondato.Dl "mdmfs -P -F foo.uzip -oro md1.uzip /tmp/" 332de63bf71SMatteo Riondato.Pp 333de63bf71SMatteo RiondatoConfigure a vnode-backed file system and mount its first partition, 334de63bf71SMatteo Riondatousing automatic device numbering: 335de63bf71SMatteo Riondato.Pp 336de63bf71SMatteo Riondato.Dl "mdmfs -P -F foo.img mds1a /tmp/" 337f7acb7e4SDima Dorfman.Sh COMPATIBILITY 338e1205e80SPhilippe CharnierThe 339e1205e80SPhilippe Charnier.Nm 340957d7c8fSRuslan Ermilovutility, while designed to be compatible with 341f7acb7e4SDima Dorfman.Xr mount_mfs 8 , 342f7acb7e4SDima Dorfmancan be useful by itself. 343f7acb7e4SDima DorfmanSince 344f7acb7e4SDima Dorfman.Xr mount_mfs 8 345f72709f6SDoug Bartonhad some silly defaults, a 346957d7c8fSRuslan Ermilov.Dq compatibility 347f7acb7e4SDima Dorfmanmode is provided for the case where bug-to-bug compatibility is desired. 348f7acb7e4SDima Dorfman.Pp 349957d7c8fSRuslan ErmilovCompatibility is enabled by starting 350f7acb7e4SDima Dorfman.Nm 3512dc4ac06SIan Dowsewith the name 3522dc4ac06SIan Dowse.Li mount_mfs 3532dc4ac06SIan Dowseor 3542dc4ac06SIan Dowse.Li mfs 355f7acb7e4SDima Dorfman(as returned by 356f7acb7e4SDima Dorfman.Xr getprogname 3 ) . 357957d7c8fSRuslan ErmilovIn this mode, the following behavior, as done by 358f7acb7e4SDima Dorfman.Xr mount_mfs 8 , 359f7acb7e4SDima Dorfmanis duplicated: 3606a68a83eSRuslan Ermilov.Bl -bullet -offset indent 361f7acb7e4SDima Dorfman.It 362f7acb7e4SDima DorfmanThe file mode of 363f7acb7e4SDima Dorfman.Ar mount-point 364957d7c8fSRuslan Ermilovis set by default to 365f7acb7e4SDima Dorfman.Li 01777 366f7acb7e4SDima Dorfmanas if 367f7acb7e4SDima Dorfman.Fl p Ar 1777 368f7acb7e4SDima Dorfmanwas given on the command line. 369f7acb7e4SDima Dorfman.El 37029dfd70bSDima Dorfman.Sh SEE ALSO 37129dfd70bSDima Dorfman.Xr md 4 , 372f7acb7e4SDima Dorfman.Xr fstab 5 , 37329dfd70bSDima Dorfman.Xr mdconfig 8 , 37429dfd70bSDima Dorfman.Xr mount 8 , 37529dfd70bSDima Dorfman.Xr newfs 8 3769dde6035SDima Dorfman.Sh AUTHORS 3774d7de91fSDima Dorfman.An Dima Dorfman 378