3 nbdkit-client - how to mount NBD filesystems on a client machine
7 For NBD exports that contain filesystems there are several approaches
8 to mounting them on a client machine.
10 To ensure the nbd kernel module is loaded you may need to do:
12 # echo nbd > /etc/modules-load.d/nbd.conf
14 This will not take effect until you reboot, so also do:
18 =head2 Easy mounting at boot time
20 For simple setups the following method is the easiest way to get an
21 NBD filesystem to mount at boot. Create or edit F</etc/rc.local> or
22 F</etc/rc.d/rc.local>:
27 nbd-client server /dev/nbd0
30 =head2 Mounting using systemd mount points
32 You can use systemd mount points to mount NBD filesystems at boot
35 Set up an L<nbdtab(5)> mapping. If F</etc/nbdtab> doesn't exist, then
36 create it first. Add this line:
38 nbd0 server / bs=512,persist
41 L<https://github.com/NetworkBlockDevice/nbd/issues/91> you must
42 currently modify the F<nbd@.service> file:
44 # cp /usr/lib/systemd/system/nbd@.service /etc/systemd/system/
45 # vi /etc/systemd/system/nbd@.service
47 and edit or create these settings in the C<[Service]> section:
52 ExecStart=/usr/sbin/nbd-client %i
53 ExecStop=/usr/sbin/nbd-client -d /dev/%i
55 Finally create a systemd mount file called
56 F</etc/systemd/system/mnt.mount>:
59 Requires=nbd@nbd0.service
65 You can either reboot now or do:
67 # systemctl start mnt.mount
69 Other systemd services which need this mount point can depend on this
88 Copyright (C) 2013-2020 Red Hat Inc.