惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
A
About on SuperTechFans
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
罗磊的独立博客
量子位
有赞技术团队
有赞技术团队
V
V2EX
Engineering at Meta
Engineering at Meta

OneUptime Blog

How to Monitor Azure App Services (PaaS) with OpenTelemetry Grafana Stack vs OneUptime: DIY Observability or Unified Platform? Your AI Workloads Are About to Blow Up Your Observability Bill The Great Observability Consolidation Is Here How to Write Custom Object Classes for Ceph How to Write Custom Ceph Manager Modules How to Write a ceph.conf Configuration File How to Use Rook-Ceph with OpenShift How to Use Rook-Ceph with Longhorn for Comparison How to Configure Volume Snapshot Class for RBD in Rook How to Configure VolumeReplicationClass Scheduling Intervals in Rook How to Set Up Volume Replication with Rook-Ceph How to Create Volume Group Snapshots with Rook CSI How to Visualize Ceph Network Performance in Grafana How to Enable Virtual Host-Style Bucket Access in Rook How to View Runtime Configuration via Admin Socket How to View Quota Settings and Update Stats in Ceph RGW How to View PG Scaling Recommendations with autoscale-status How to View PG Distribution via Admin Socket How to View Performance Metrics in the Ceph Dashboard How to View OSD Performance Counters in Ceph How to View Connection Status via Admin Socket How to View Ceph Cluster Summary Dashboard via CLI How to Version Control Rook-Ceph Configuration How to Version Control Ceph Infrastructure with Terraform How to Verify Kubernetes Node Requirements for Rook-Ceph Deployment How to Verify Health Before and After Rook Upgrades How to Verify Data Integrity with Deep Scrubbing How to Verify Complete Rook-Ceph Cleanup How to Verify Backup Integrity from Ceph Snapshots
How to Use the CephFS Shell
Nawaz Dhandala · 2026-03-31 · via OneUptime Blog

Overview

The CephFS Shell (cephfs-shell) is an interactive command-line tool that provides filesystem operations on a CephFS instance without requiring a traditional mount. It connects directly to the CephFS metadata and data services, making it ideal for administrative tasks, diagnostics, and automation in environments where mounting is not convenient or possible.

Installation

The CephFS Shell is part of the cephfs-shell package or included in ceph-common on some distributions:

# Debian/Ubuntu (requires Ceph apt repository)
apt-get install -y cephfs-shell

Basic Usage in Rook Toolbox

The easiest way to use the CephFS Shell in a Rook-Ceph cluster is from the toolbox pod:

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
  cephfs-shell

Interactive Shell Commands

Once inside the shell, you can use familiar filesystem commands:

CephFS:~/>>>  ls
CephFS:~/>>>  ls /mydir
CephFS:~/>>>  cd /mydir
CephFS:~/mydir>>>  mkdir newfolder
CephFS:~/mydir>>>  put /tmp/localfile.txt remotefile.txt
CephFS:~/mydir>>>  get remotefile.txt /tmp/downloaded.txt
CephFS:~/mydir>>>  rm oldfile.txt
CephFS:~/mydir>>>  stat myfile.txt
CephFS:~/mydir>>>  du .
CephFS:~/mydir>>>  quit

Run Commands Non-Interactively

Execute single commands without entering interactive mode:

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
  cephfs-shell -- ls /

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
  cephfs-shell -- du /myapp

Set and View Extended Attributes

Manage extended attributes (xattrs) used for layout configuration:

CephFS:~/>>>  setxattr /mydir ceph.dir.layout.stripe_count 4
CephFS:~/>>>  getxattr /mydir ceph.dir.layout

Check Quotas

View directory quota settings from within the shell:

CephFS:~/>>>  getxattr /mydir ceph.quota.max_bytes
CephFS:~/>>>  getxattr /mydir ceph.quota.max_files

Batch Operations with Scripts

Use the shell in script mode to automate filesystem operations:

cat > /tmp/cephfs_ops.txt <<EOF
mkdir /backup
mkdir /backup/2026
put /local/data.tar.gz /backup/2026/data.tar.gz
chmod 750 /backup
EOF

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
  cephfs-shell -b /tmp/cephfs_ops.txt

Connect to a Specific Filesystem

For multi-filesystem clusters, specify the target filesystem:

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
  cephfs-shell --fs cephfs2

Summary

The CephFS Shell provides a convenient, mount-free way to interact with CephFS filesystems for administrative and automation tasks. It supports standard filesystem operations including directory management, file transfers, extended attribute management, and quota inspection. In Rook-Ceph clusters, running cephfs-shell from the toolbox pod is the most straightforward approach, requiring no host-level configuration or mount setup.