Scroll to navigation

mfsbdev(8) This is part of MooseFS mfsbdev(8)

NAME

mfsbdev - MooseFS block device daemon/management tool

SYNOPSIS

mfsbdev start [-H masterhost] [-P masterport] [-S masterpath] [-p masterpassword | -x passwordfile] [-l linksocket] [-F]

mfsbdev stop [-l linksocket]

mfsbdev map [-l linksocket] -f mfsfile [-d nbddevice] [-n linkname] [-s bdevsize] [-r]

mfsbdev unmap [-l linksocket] ( -f mfsfile | -d nbddevice | -n linkname )

mfsbdev list [-l linksocket] [-t m|u]

mfsbdev resize [-l linksocket] ( -f mfsfile | -d nbddevice | -n linkname ) [-s bdevsize]

DESCRIPTION

This tool is used to manage block devices. This tool works in Linux ONLY. Kernel module nbd must be loaded for this tool to work properly.

COMMANDS

start - starts the daemon; the daemon only listens on a socket at this point; all the other commands use the socket to communicate with the daemon; if no socket is specified via -l option, the default is used: /dev/mfs/nbdsock

stop - stops the daemon

map - maps a file on mfs to be used as a block device

unmap - removes a mapping

list - lists current mappings

resize - changes the size of a block device (requires kernel version 4.18 or higher)

OPTIONS

-H - master host; default is 'mfsmaster'

-P - master port; default is '9421'

-S - master path (subfolder in MFS that will be used as a root for all block device mappings); default is '/'

-p - master password; mutually exclusive with -x option; if neither -p nor -x are supplied, the tool tries to connect without a password

-x - path to a file containing master password; mutually exclusive with -p option; if neither -p nor -x are supplied, the tool tries to connect without a password

-l - path to communication socket; default is /dev/mfs/nbdsock

-F - do not daemonize the tool (run in foreground)

-f - path to mfs file used to map block device;

-d - path to network block device ('/dev/nbdX'); by default (if this parameter is not supplied) first available device is used with the map command

-n - name of symbolic link created in '/dev/mfs', pointing at the network block device created by the map command; default is a combination of master hostname, port and mfs file name

-s - size of the block device, both SI and IEC suffixes can be used; default is the size of the file the block device is mapped to

-r - maps block device as readonly (allows multiple mappings of the same file)

-t - forces the list command to display information in a format ready to use with map (m parameter) or unmap (u parameter) command

EXAMPLES

mfsbdev start - start nbd daemon with default options (masterhost = mfsmaster, masterport = 9421, linksocket = /dev/mfs/nbdsock, authentication without password)

mfsbdev start -H mfsmaster.my.domain -P 9521 -x /etc/mfs/mastersecret - start nbd daemon that will connect to master mfsmaster.my.domain on port 9521 using password read from file /etc/mfs/mastersecret

mfsbdev stop -l /tmp/mynbdinstance - stop nbd daemon using for communication unix socket /tmp/mynbdinstance

mfsbdev map -f devices/mybdev1.bin -s 2Ti -n mytestvm - add mapping to daemon using for communication default socket (/dev/mfs/nbdsock). Device will be assigned automatically, file devices/mybdev1.bin will be mapped to this device, link '/dev/mfs/mytestvm' to this device will be created and block device will have size of 2TiB.

mfsbdev unmap -n mytestvm - remove mapping that has link named mytestvm (uses link /dev/mfs/mytestvm).

REPORTING BUGS

Report bugs to <bugs@moosefs.com>.

COPYRIGHT

Copyright (C) 2021 Jakub Kruszona-Zawadzki, Core Technology Sp. z o.o.

This file is part of MooseFS.

MooseFS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 (only).

MooseFS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with MooseFS; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA or visit http://www.gnu.org/licenses/gpl-2.0.html

SEE ALSO

mfsmount(8)

August 2021 MooseFS 3.0.116-1