docs/en/guide/tiered-storage.md
Starting with JuiceFS 1.4, tiered storage lets you map individual files or directories to different object storage classes (Storage Classes). For example, keep hot data in Standard storage and move cold data to Infrequent Access (IA) or Glacier‑class storage to save costs.
0 to 3.
0 is the default tier.1 to 3 are user‑configurable tiers.STANDARD_IA, INTELLIGENT_TIERING, or GLACIER_IR.key=value format. It is attached to objects when they are uploaded and can be used together with the cloud provider's lifecycle rules (see Custom tags).juicefs config before running juicefs tier set.Assign a storage class to each tier (1 to 3):
juicefs config redis://localhost --tier 1 --storage-class STANDARD_IA -y
juicefs config redis://localhost --tier 2 --storage-class INTELLIGENT_TIERING -y
juicefs config redis://localhost --tier 3 --storage-class GLACIER_IR -y
List the current mappings:
juicefs tier list redis://localhost
juicefs tier set redis://localhost --tier 1 /path/to/file
When you set a storage tier on a directory, any new files or subdirectories created inside it later will inherit the tier of the parent directory, automatically using the corresponding storage type.
juicefs tier set redis://localhost --tier 2 /path/to/dir
Without -r, only the directory inode is updated; files and subdirectories inside it are unchanged.
juicefs tier set redis://localhost --tier 2 /path/to/dir -r
Recursive mode processes all files and subdirectories under the target directory.
juicefs tier set redis://localhost --tier 0 /path/to/file
juicefs tier set redis://localhost --tier 0 /path/to/dir -r
--force)If you change a tier's storage-class from A to B, the files' metadata tier‑id remains unchanged, but the objects in object storage are still stored as A.
Use --force to trigger a re-write, copying the objects to the new storage class:
juicefs tier set redis://localhost --tier 2 /path/to/dir -r --force
For archive storage classes such as GLACIER or DEEP_ARCHIVE, issue a restore request with:
juicefs tier restore redis://localhost /path/to/dir -r
tier restore only sends the restore request to the object storage service. Whether and when the objects become readable depends on the provider's restore duration. The active copy remains available for 3 days (default).
Use juicefs info to inspect the tier information of a file:
juicefs info /mountpoint/path/to/file
Key fields to look for:
tier: <id>-><storage-class> — the tier stored in metadata and its mapped storage class.restore-status — indicates whether the object is in an unfrozen state and when the active copy expires.expected(...),actual(...) — shown when the metadata mapping and the object's actual storage class differ. This signals that tier set --force is needed to rewrite the objects.actual(...) — shown for files with tier=0, displaying the object's actual storage class.In addition to storage-class, you can configure a custom object tag for a tier, in the key=value format:
juicefs config redis://localhost --tier 1 --storage-class STANDARD --tag juicefs-tier=archive -y
You can also set a tag for the default tier (tier 0) when formatting:
juicefs format --storage-class STANDARD --tag juicefs-tier=archive redis://localhost myjfs
Once set, JuiceFS automatically attaches the tag to objects when they are uploaded. You can view the tag of each tier with juicefs tier list, or view a specific file's tag with juicefs info.
Uploading objects directly with an archive storage class (such as GLACIER or DEEP_ARCHIVE) can be expensive. This is because some cloud providers charge archive-tier write/request fees, making each upload API call costly. When the goal is to move data to the archive tier, a more cost‑effective approach is:
STANDARD and set a custom tag for that tier, for example, --tag juicefs-tier=archive.This avoids the high API costs of uploading archive-class objects directly, while still using the cloud provider's lifecycle rules to gradually move the data to the archive tier.
:::note
The tag must be in the key=value format (exactly one =, and neither the key nor the value can be empty). Otherwise, it is rejected or ignored. For how to configure lifecycle rules, refer to your cloud provider's documentation.
:::
tier set only accepts file and directory paths.--tier only 0 to 3 are allowed.--writeback), tier set may fail if the file's data has not yet been uploaded to object storage. Wait for the upload to complete, then retry.--storage-class does not automatically migrate existing objects. You must run tier set ... --force manually.--tag only applies to newly uploaded objects. It does not modify the tags of existing objects in object storage.