API Doc
Search Docs...
⌘ K
OverviewDeploymentManagementOperationReferenceGlossary

Managing inodes

Viewing inodes

Viewing inodes under the specified path

Procedure

Run the following command on any node in the cluster to view the inodes under the specified dir_id path.

zbs-nfs inode list <dir_id>

Output example

id                  name    pool                                  preallocate    volume                                type    Encrypt Method        mode    uid    gid  size    perf unique size    perf shared size    cap unique size    cap shared size    logical used size    prioritized    downgraded_prs
------------------  ------  ------------------------------------  -------------  ------------------------------------  ------  ------------------  ------  -----  -----  ------  ------------------  ------------------  -----------------  -----------------  -------------------  -------------  ----------------
512c83c1-15db-4271  nfs1    ea479340-5d9d-4538-9386-eb1f2ab3f2d1  False          512c83c1-15db-4271-aeac-fc231f63c9f5  FILE    ENCRYPT_PLAIN_TEXT     432      0      0  0.00 B  In Process          In Process          In Process         In Process         In Process           False          0.00 B

Output note

ParameterDescription
preallocateWhether the inode file is preallocated.
volumeThe ID of the allocated volume.
typeValid values: FILE or DIR.
Encrypt MethodThe data encryption algorithm of the file.
modeThe file permissions.
uidThe user ID.
gidThe group ID.
perf unique sizeThe exclusive space occupied in the performance tier.
perf shared sizeThe performance tier space shared with other objects.
cap unique sizeThe exclusive space occupied in the capacity tier.
cap shared sizeThe capacity tier space shared with other objects.
logical used sizeThe allocated logical space.
prioritizedWhether all data is kept in the performance tier.
downgraded_prsThe space not yet promoted to the performance tier.

Viewing inode information

Procedure

  • View inode information by inode ID

    Run the following command on any node in the cluster:

    zbs-nfs inode show <inode_id>

  • View inode information by parent ID and inode name

    Run the following command on any node in the cluster:

    zbs-nfs inode lookup <parent_id> <inode_name>

Output example

-----------------  ------------------------------------
id                 512c83c1-15db-4271
name               nfs1
pool               ea479340-5d9d-4538-9386-eb1f2ab3f2d1
preallocate        False
volume             512c83c1-15db-4271-aeac-fc231f63c9f5
type               FILE
Encrypt Method     ENCRYPT_PLAIN_TEXT
mode               432
uid                0
gid                0
size               0.00 B
perf unique size   In Process
perf shared size   In Process
cap unique size    In Process
cap shared size    In Process
logical used size  In Process
prioritized        False
downgraded_prs     0.00 B
-----------------  ------------------------------------

Output note

ParameterDescription
preallocateWhether it is preallocated.
volumeThe ID of the allocated volume.
typeValid values: FILE or DIR.
Encrypt MethodThe data encryption algorithm of the file.
modeThe file permissions.
uidThe user ID.
gidThe group ID.
perf unique sizeThe exclusive space occupied in the performance tier.
perf shared sizeThe performance tier space shared with other objects.
cap unique sizeThe exclusive space occupied in the capacity tier.
cap shared sizeThe capacity tier space shared with other objects.
logical used sizeThe allocated logical space.
prioritizedWhether all data is kept in the performance tier.
downgraded_prsThe space not yet promoted to the performance tier.

Viewing inode file size

Procedure

Run the following command on any node in the cluster:

zbs-nfs inode sizeinfo <inode_id>

Output example

-----------  ----------
size                  6
volume size  1073741824
-----------  ----------

Output note

ParameterDescription
sizeThe inode file size.
volume sizeThe volume size.

Viewing inode attributes

Procedure

Run the following command on any node in the cluster:

zbs-nfs inode getattr <inode_id>

Output example

----  ----
type     2
mode   511
uid      0
gid      0
size  4096
----  ----

Output note

ParameterDescription
typeThe inode file type. 1 to 7 represent FILE, DIR, BLK, CHR, LNK, SOCK, FIFO, respectively.
modeThe inode file mode.
uidThe user ID.
gidThe group ID.
sizeThe file size.

Updating inode attributes

Procedure

Run the following command on any node in the cluster to update inode attributes:

zbs-nfs inode setattr <inode_id> [--mode <MODE>] [--uid <UID>] [--gid <GID>] [--size <SIZE>]

ParameterDescription
--mode <MODE>The file mode.
--uid <UID>The user ID.
--gid <GID>The group ID.
--size <SIZE>The file size.

Output example

-----------------  ------------------------------------
id                 7bbed56f-e5f0-4532
name               nfs1
pool               f6722181-7eb8-4ab4-ac39-7a06d29f6890
preallocate        False
volume             7bbed56f-e5f0-4532-9224-1d7ea5ca6c8f
type               FILE
Encrypt Method     ENCRYPT_PLAIN_TEXT
mode               432
uid                0
gid                0
size               16.00 B
perf unique size   In Process
perf shared size   In Process
cap unique size    In Process
cap shared size    In Process
logical used size  In Process
prioritized        False
downgraded_prs     0.00 B
-----------------  ------------------------------------

Output note

ParameterDescription
preallocateWhether it is preallocated.
volumeThe ID of the allocated volume.
typeValid values: FILE or DIR.
Encrypt MethodThe data encryption algorithm of the file.
modeThe file permissions.
uidThe user ID.
gidThe group ID.
perf unique sizeThe exclusive space occupied in the performance tier.
perf shared sizeThe performance tier space shared with other objects.
cap unique sizeThe exclusive space occupied in the capacity tier.
cap shared sizeThe capacity tier space shared with other objects.
logical used sizeThe allocated logical space.
prioritizedWhether all data is kept in the performance tier.
downgraded_prsThe space not yet promoted to the performance tier.

Renaming an inode

Procedure

Run the following command on any node in the cluster:

zbs-nfs inode rename <src_parent_id> <src_inode_name> <dst_parent_id> <dst_inode_name>

Move the inode from the src_parent_id folder to the dst_parent_id. If dst_parent_id is the same as src_parent_id, the inode is renamed.

Usage example

zbs-nfs inode rename 8be8661e-ef17-4a74 inode2 8be8661e-ef17-4a74 inode1

Output example

-----------------  ------------------------------------
id                 7bbed56f-e5f0-4532
name               inode1
pool               f6722181-7eb8-4ab4-ac39-7a06d29f6890
preallocate        False
volume             7bbed56f-e5f0-4532-9224-1d7ea5ca6c8f
type               FILE
Encrypt Method     ENCRYPT_PLAIN_TEXT
mode               432
uid                0
gid                0
size               16.00 B
perf unique size   In Process
perf shared size   In Process
cap unique size    In Process
cap shared size    In Process
logical used size  In Process
prioritized        False
downgraded_prs     0.00 B
-----------------  ------------------------------------

Updating the file size of file-type inodes

Procedure

Run the following command on any node in the cluster to change the file size of file-type inodes:

zbs-nfs inode truncate <file_id> <size>

Output example

-----------------  ------------------------------------
id                 7bbed56f-e5f0-4532
name               inode1
pool               f6722181-7eb8-4ab4-ac39-7a06d29f6890
preallocate        False
volume             7bbed56f-e5f0-4532-9224-1d7ea5ca6c8f
type               FILE
Encrypt Method     ENCRYPT_PLAIN_TEXT
mode               432
uid                0
gid                0
size               512.00 B
perf unique size   In Process
perf shared size   In Process
cap unique size    In Process
cap shared size    In Process
logical used size  In Process
prioritized        False
downgraded_prs     0.00 B
-----------------  ------------------------------------

Deleting inodes under the specified path

Procedure

Run the following command on any node in the cluster to delete the inode named <inode_name> under the <parent_id> directory:

zbs-nfs inode delete <parent_id> <inode_name> [--recursive {true|false}]

The --recursive {true|false} parameter specifies whether to recursively delete all files and directories under the inode.

Output note

If the command succeeds, no output is displayed.