Add support for zfs mount -R <filesystem>

This commit adds support for mounting a dataset along with all of
it's children with '-R' flag for zfs mount. There can be scenarios
where we want to mount all datasets under one hierarchy instead of
mounting all datasets present on system with '-a' flag.

'-R' flag should work on all root and non-root datasets. Usage
information and man page has been updated for zfs mount. A test
for verifying the behavior for '-R' flag is also added.

Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #16015
This commit is contained in:
Umer Saleem
2024-04-12 03:10:24 +05:00
committed by GitHub
parent e2035cdbf7
commit a100a195fa
7 changed files with 216 additions and 18 deletions
+4 -2
View File
@@ -43,7 +43,7 @@
.Cm mount
.Op Fl Oflv
.Op Fl o Ar options
.Fl a Ns | Ns Ar filesystem
.Fl a Ns | Ns Fl R Ar filesystem Ns | Ns Ar filesystem
.Nm zfs
.Cm unmount
.Op Fl fu
@@ -61,7 +61,7 @@ Displays all ZFS file systems currently mounted.
.Cm mount
.Op Fl Oflv
.Op Fl o Ar options
.Fl a Ns | Ns Ar filesystem
.Fl a Ns | Ns Fl R Ar filesystem Ns | Ns Ar filesystem
.Xc
Mount ZFS filesystem on a path described by its
.Sy mountpoint
@@ -83,6 +83,8 @@ for more information.
.It Fl a
Mount all available ZFS file systems.
Invoked automatically as part of the boot process if configured.
.It Fl R
Mount the specified filesystems along with all their children.
.It Ar filesystem
Mount the specified filesystem.
.It Fl o Ar options