Command Reference
Running juicefs
by itself and it will print all available commands. In addition, you can add -h/--help
flag after each command to get more information, e.g., juicefs mount -h
.
NAME:
juicefs - A POSIX file system built on object storage.
USAGE:
juicefs [global options] command [command options] [arguments...]
VERSION:
5.1.1 (2024-09-20 1faf43b)
COMMANDS:
help, h Shows a list of commands or help for one command
ADMIN:
auth Authorize a volume
destroy Destroy an existing volume
gc Garbage collector of objects in data storage
fsck Check consistency of a volume
dump Dump metadata into a JSON file
load Load metadata from a previously dumped JSON file
version Show version
quota Manage directory quotas
heal Heal a replicated volume
INSPECTOR:
status Show status of a volume
stats Show real time performance statistics of JuiceFS
profile Show profiling of operations completed in JuiceFS
info Show internal information of a path or inode
summary Show data and files distribution of a directory
debug, doctor Collect and display system static and runtime information
lsof List open files
SERVICE:
mount Mount a volume
umount Unmount a volume
gateway Start an S3-compatible gateway
webdav Start a WebDAV server
TOOL:
bench, benchmark Run benchmarks on a path
objbench Run benchmarks on an object storage
warmup Build cache for target directories/files
clone, snapshot Clone a file/directory without copying data
rmr Remove directories recursively
sync Sync between two storages
import Import existing files from object storage
merge merge files together without copying.
grep parallelized file pattern searcher
compact Trigger compaction of chunks
GLOBAL OPTIONS:
--verbose, --debug, -v enable debug log (default: false)
--quiet, -q show warning and errors only (default: false)
--trace enable trace log (default: false)
--no-agent disable pprof (:6060) agent (default: false)
--pyroscope value pyroscope address
--no-color disable colors (default: false)
--help, -h show help
--version, -V print version only (default: false)
Global options
Items | Description |
---|---|
-v --verbose --debug | Enable debug logs. |
-q --quiet | Show only warning and error logs. |
--trace | Enable more detailed debug logs than the --debug option. |
--no-agent | Disable pprof agent. |
--pyroscope | Config Pyroscope address, e.g. http://localhost:4040 . |
--no-color | Disable log color. |
Admin
juicefs auth
Authenticate the client against JuiceFS Console, and fetch or update configuration file for the JuiceFS Volume, and stored in $HOME/.juicefs/$VOL_NAME.conf
. This command is useful when you need to deploy JuiceFS via script, or use self-hosted object storage for onpremise deployment.
Synopsis
juicefs auth NAME [options]
juicefs auth myjfs --token xxx --access-key xxx --secret-key xxx
Options
Items | Description |
---|---|
NAME | Name of your file system. |
--token=TOKEN | Token of your file system, obtain in JuiceFS Web Console. |
--bucket=BUCKET | When a file system is first created, object storage bucket is already specified in the web console. When in need, client can override this setting by specifying this option, in order to for example, connect to object storage in special network environments. Same as the file system bucket setting in the web console, you can either specify the bare bucket name string, or the full endpoint starting with https:// or http:// . These two method have different implications:
|
--access-key=ACCESSKEY | Object storage access key, see How to get AK/SK. An interactive prompt will occur to collect this info if missing in the command line options. Leave empty if you have configured host to access object storage without credentials. |
--secret-key=SECRETKEY | Object storage secret key, see How to get AK/SK. An interactive prompt will occur to collect this info if missing in the command line options. Leave empty if host have been configured to access object storage without credentials. |
--session-token=SESSIONTOKEN | Optionally provide object storage session token. |
--storage-class=value | Storage class for the destination storage, if supported. Read relevant docs for more, e.g. S3. |
--bucket2=BUCKET2 | Optionally provide the name or endpoint for the secondary bucket For Data replication, same format and caveats as --bucket . |
--access-key2=ACCESSKEY2 | When data replication is enabled, use this parameter to specify the access key for the secondary bucket. Learn more at Cross-region data replication. |
--secret-key2=SECRETKEY2 | When data replication is enabled, use this parameter to specify the secret key for the secondary bucket. Learn more at Cross-region data replication. |
--session-token2=SESSION_TOKEN2 | the session token to access the bucket (optional) |
--passphrase=PASSPHRASE | Passphrase for encrypted key, see Data Encryption for more. |
--encrypt-keys | Encrypt the object access and secret keys locally or not (default: false). |
--subdir=SUBDIR | Specify a sub-directory for mount, you can also create ACL to restrict client access to specific sub-directories, learn more at Client Access Control |
--shards=0 | Same as the Community Edition's --shards option. JuiceFS Enterprise Edition volumes are usually paired with scalable object storage services, and do not easily reach the single bucket performance (or capacity) limit. Hence, this option is provided to maintain compatibility, and should not be your first option because multi-bucket increases complexity. |
--conf-dir=CONFDIR | Directory to store configuration files, default to ~/.juicefs ) |
--no-update | Client will by default obtain latest config from JuiceFS Web Console, set to true to disable this behavior, and then client will no longer talk to JuiceFS Console when mounting. |
juicefs gc
Deal with leaked objects, and garbage fragments produced by file overwrites.
Synopsis
juicefs gc [command options] VOLUME-NAME
# Check and print results, but don't actually delete anything
juicefs gc $VOL_NAME
# Delete leaked objects
juicefs gc $VOL_NAME --delete
Options
Items | Description |
---|---|
--delete | delete leaked objects (default: false) |
--threads=10, -p 10 | Number of concurrent threads, default to 10. |
juicefs fsck
This command checks the file system's consistency. If any files have missing object storage blocks, use this command to find them.
Synopsis
juicefs fsck [command options] VOLUME-NAME
juicefs fsck $VOL_NAME
Options
Items | Description |
---|---|
--threads=10, -p 10 | Number of concurrent threads, default to 10. |
--repair | Fix the hash prefix of objects. JuiceFS Enterprise Edition automatically adds a hash prefix (slice ID mod 256, same as Community Edition's --hash-prefix ) to all object storage blocks. This distributes data blocks evenly across actual object storage regions, offering more consistent performance.If a JuiceFS volume did not use this naming pattern (for example, importing a JuiceFS CE volume which disabled --hash-prefix ), use this option to repair it. |
juicefs dump
Dump metadata into a JSON file. Different from JuiceFS CE, JuiceFS EE require no manual metadata dump in order to make a backup, it's already handled by our engineers in the server end. Thus, this command is used mainly for debugging, or migration between CE and EE.
Synopsis
juicefs dump [command options] PATH JSON-PATH
# Export metadata to meta-dump.json
juicefs dump /jfs meta-dump.json
# Export metadata for only one subdirectory of the file system
juicefs dump /jfs/subdir meta-dump.json
Options
Items | Description |
---|---|
PATH | Mount point path. |
JSON-PATH | Export file path. If the filename ends with .gz , it will be automatically compressed. |
--gzip | Compress with gzip. |
juicefs load
Load metadata into an empty file system, often used for migrations between JuiceFS CE and EE.
Synopsis
juicefs load [command options] PATH [FILE]
# Import the metadata backup file into the file system
juicefs load /mnt/jfs meta-dump.json.gz
juicefs version
Show the JuiceFS version information. The update details of each version can be viewed on the "Release Notes".
Synopsis
juicefs version [options]
# Upgrade client version and seamless restart
juicefs version -u -r
Options
Items | Description |
---|---|
-u --upgrade | Upgrade the JuiceFS client to latest version. |
-r --restart | Execute seamless remount, if client is upgraded. |
juicefs quota
Manage directory quota. Different from Community Edition, JuiceFS Enterprise Edition manages quota directly from the web console, and users should not directly run this command from the terminal. The purpose of this command is to stay consistent with CE interface, so that CSI Driver may approach quota management using the same code.
juicefs heal
Repair data when using data replication. Execute a bidirectional synchronization on object storage for both file system.
Synopsis
juicefs heal VOL-NAME [options]
Option
Items | Description |
---|---|
--start=value | Specify object storage key range. |
--upload-limit=0 | Maximum bandwidth for upload in Mbps, default to 0 (unlimited). |
--conf-dir=/root/.juicefs | a directory for configuration (default: /root/.juicefs ) |
Inspector
juicefs status
Show status of JuiceFS.
Synopsis
juicefs status [command options] VOLUME-NAME
juicefs status $VOL_NAME
Options
Items | Description |
---|---|
--session=0 -s 0 | Show detailed information of one session, specified using a session ID (get from the SID field from the status output). |
juicefs stats
The stats
command reads the metrics of the JuiceFS client and prints the changes of each metric per second.
For more introduction and usage of this command, see "Real-time Performance Monitoring".
Synopsis
juicefs stats [options] MOUNTPOINT
Options
Items | Description |
---|---|
--schema=ufmco | Schema string that controls the output, default to “ufmco”, its meaning: u: usage f: FUSE m: meta c: blockcache o: object g: go |
--interval=1 | Update interval in seconds, default to 1. |
--verbosity=0 | Verbosity level, increase to see more information. |
juicefs profile
Performs basic profiling based on access log, and writes comprehensive statistics to command line output. Use this command to quickly identify the overall file system access pattern of your application, and assess performance.
For more introduction and usage of this command, see "Real-time Performance Monitoring".
Synopsis
juicefs profile [options]
Options
Items | Description |
---|---|
-x PATH --path=PATH | The directory path of access log, default to /jfs . |
-f FILE --file=FILE | The filename of the access log, default to .ophistory . Refer to Access Log for different types of access log. |
-g GROUP_BY --group-by=GROUP_BY | Group the output by a specific attribute, default to cmd , choose from uid , pid , cmd . |
-s SORT_BY --sort-by=SORT_BY | Sort the output by a specific column, default to total_time , choose from group , number , avg_time , total_time . |
-u FILTER_BY_UID --filter-by-uid=FILTER_BY_UID | Filter the output by one or multiple keywords on the UID column, please separate multi keywords by comma (,). |
-p FILTER_BY_PID --filter-by-pid=FILTER_BY_PID | Filter the output by one or multiple keywords on the PID column, please separate multi keywords by comma (,). |
-w WINDOW_SIZE --window-size=WINDOW_SIZE | Analysis time window, accept float value, default to 60 seconds. |
-i FLUSH_INTERVAL --flush-interval=FLUSH_INTERVAL | Flush output interval, accept float value, default to 2 seconds. |
juicefs info
Show internal information of a path or inode.
Synopsis
juicefs info [command options] PATH/INODE
# Lookup single file
juicefs info /mnt/jfs/foo
# Lookup directory
juicefs info -r /mnt/jfs/bar/
# Lookup file information through inode
cd /mnt/jfs
juicefs info -i 100
Options
Items | Description |
---|---|
PATH/INODE | Target file path or inode. |
-i --inode | Lookup file information through inode. Note that the current directory must be in the JuiceFS mount point. |
-r --recursive | Recursively obtain information about all subdirectories and files in a directory. |
--raw | Show internal raw information. |
juicefs summary
Show tree summary of target directory.
Synopsis
juicefs summary [command options] PATH
# Show with path
juicefs summary /jfs/foo
# Show max depth of 5
juicefs summary --depth 5 /jfs/foo
# Show top 20 entries
juicefs summary --entries 20 /jfs/foo
Options
Items | Description |
---|---|
--depth=2 -d 2 | Depth of tree to show, 0 means only show root, defaults to 2. |
--entries=10 -e 10 | Show top N entries, sort by size, defaults to 10. |
--csv | Print summary in csv format. |
juicefs doctor
Collect abundant debug information, including access log, client log, CPU stats, Goroutine stacktraces. When run into unexpected situations, JuiceFS team may asks you to collect information with this command, and send back the result to continue support.
We encourage you to also take a look at Troubleshooting Methods and Troubleshooting Cases, and try to solve some of the more frequently encountered problems by yourself.
Synopsis
juicefs doctor MOUNTPOINT
juicefs lsof
List recently (within 10 minutes) opened files in JuiceFS.
Synopsis
juicefs lsof PATH
Service
juicefs mount
Mount the file system. You must provide the token of the file system (check the "File System Settings" in the website console), and the key pair to access the object storage (refer to How to Get Object Storage Access Key and Secret Key for details).
If the configuration file is not generated by the auth
subcommand before mounting the file system, the client will ask you to provide the file system token and the key pair to access the object storage API separately through command line interaction.
You can mount JuiceFS as root or normal user, but due to permission issues, cache and client log locations will be different, read option descriptions below for more.
Synopsis
juicefs mount NAME MOUNTPOINT [options]