From 44cf212c0d2e6cc07c1443110b87b0c952b6872c Mon Sep 17 00:00:00 2001 From: Zac Dover Date: Thu, 12 Dec 2024 07:17:40 +1000 Subject: [PATCH] doc/cephfs: edit 2nd 3rd of mount-using-kernel-driver Edit the second third of doc/cephfs/mount-using-kernel-driver.rst in preparation for correcting mount commands that may not work in Reef as described in this documentation. This commit edits only English-language strings in doc/cephfs/mount-using-kernel-driver.rst. No technical content (that is, no commands and no settings) have been altered in this commit. Technical alterations to this file will be made only after the English is unambiguous. Co-authored-by: Anthony D'Atri Signed-off-by: Zac Dover (cherry picked from commit 0526124b60500f97f536060ba372d2753b936c9e) --- doc/cephfs/mount-using-kernel-driver.rst | 70 +++++++++++++++--------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/doc/cephfs/mount-using-kernel-driver.rst b/doc/cephfs/mount-using-kernel-driver.rst index 0b99733d31db9..977e801e8c62f 100644 --- a/doc/cephfs/mount-using-kernel-driver.rst +++ b/doc/cephfs/mount-using-kernel-driver.rst @@ -56,50 +56,68 @@ for backporting fixes to their stable kernel: check with your vendor. Synopsis ======== -In general, the command to mount CephFS via kernel driver looks like this:: +This is the general form of the command for mounting CephFS via the kernel driver: - mount -t ceph {device-string}={path-to-mounted} {mount-point} -o {key-value-args} {other-args} +.. prompt:: bash # + + mount -t ceph {device-string}={path-to-mounted} {mount-point} -o {key-value-args} {other-args} Mounting CephFS =============== -On Ceph clusters, CephX is enabled by default. Use ``mount`` command to -mount CephFS with the kernel driver:: +CephX authentication is enabled by default in Ceph clusters. Use the ``mount`` +command to use the kernel driver to mount CephFS: - mkdir /mnt/mycephfs - mount -t ceph @.=/ /mnt/mycephfs +.. prompt:: bash # -``name`` is the username of the CephX user we are using to mount CephFS. -``fsid`` is the FSID of the ceph cluster which can be found using -``ceph fsid`` command. ``fs_name`` is the file system to mount. The kernel -driver requires MON's socket and the secret key for the CephX user, e.g.:: + mkdir /mnt/mycephfs + mount -t ceph @.=/ /mnt/mycephfs + +#. ``name`` is the username of the CephX user we are using to mount CephFS. +#. ``fsid`` is the FSID of the Ceph cluster, which can be found using the + ``ceph fsid`` command. ``fs_name`` is the file system to mount. The kernel + driver requires a ceph Monitor's address and the secret key of the CephX + user. For example: + + .. prompt:: bash # + + mount -t ceph cephuser@b3acfc0d-575f-41d3-9c91-0e7ed3dbb3fa.cephfs=/ -o mon_addr=192.168.0.1:6789,secret=AQATSKdNGBnwLhAAnNDKnH65FmVKpXZJVasUeQ== - mount -t ceph cephuser@b3acfc0d-575f-41d3-9c91-0e7ed3dbb3fa.cephfs=/ -o mon_addr=192.168.0.1:6789,secret=AQATSKdNGBnwLhAAnNDKnH65FmVKpXZJVasUeQ== +When using the mount helper, monitor hosts and FSID are optional. The +``mount.ceph`` helper discovers these details by finding and reading the ceph +conf file. For example: -When using the mount helper, monitor hosts and FSID are optional. ``mount.ceph`` -helper figures out these details automatically by finding and reading ceph conf -file, .e.g:: +.. prompt:: bash # + + mount -t ceph cephuser@.cephfs=/ -o secret=AQATSKdNGBnwLhAAnNDKnH65FmVKpXZJVasUeQ== - mount -t ceph cephuser@.cephfs=/ -o secret=AQATSKdNGBnwLhAAnNDKnH65FmVKpXZJVasUeQ== +.. note:: Note that the dot (``.`` in the string ``cephuser@.cephfs``) must be + a part of the device string. -.. note:: Note that the dot (``.``) still needs to be a part of the device string. +A weakness of this method is that it will leave the secret key in your shell's +command history. To avoid this, copy the secret key inside a file and pass the +file by using the option ``secretfile`` instead of ``secret``. For example: -A potential problem with the above command is that the secret key is left in your -shell's command history. To prevent that you can copy the secret key inside a file -and pass the file by using the option ``secretfile`` instead of ``secret``:: +.. prompt:: bash # - mount -t ceph cephuser@.cephfs=/ /mnt/mycephfs -o secretfile=/etc/ceph/cephuser.secret + mount -t ceph cephuser@.cephfs=/ /mnt/mycephfs -o secretfile=/etc/ceph/cephuser.secret -Ensure the permissions on the secret key file are appropriate (preferably, ``600``). +Ensure that the permissions on the secret key file are appropriate (preferably, +``600``). -Multiple monitor hosts can be passed by separating each address with a ``/``:: +Multiple monitor hosts can be passed by separating addresses with a ``/``: - mount -t ceph cephuser@.cephfs=/ /mnt/mycephfs -o mon_addr=192.168.0.1:6789/192.168.0.2:6789,secretfile=/etc/ceph/cephuser.secret +.. prompt:: bash # -In case CephX is disabled, you can omit any credential related options:: + mount -t ceph cephuser@.cephfs=/ /mnt/mycephfs -o + mon_addr=192.168.0.1:6789/192.168.0.2:6789,secretfile=/etc/ceph/cephuser.secret + +If CephX is disabled, omit any credential-related options. For example: + +.. prompt:: bash # - mount -t ceph cephuser@.cephfs=/ /mnt/mycephfs + mount -t ceph cephuser@.cephfs=/ /mnt/mycephfs -.. note:: The ceph user name still needs to be passed as part of the device string. +.. note:: The Ceph user name must be passed as part of the device string. To mount a subtree of the CephFS root, append the path to the device string:: -- 2.39.5