Linux command
fsarchiver 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Save filesystem to archive
sudo fsarchiver savefs [archive.fsa] [/dev/sda1]
Restore filesystem from archive
sudo fsarchiver restfs [archive.fsa] id=0,dest=[/dev/sda1]
Save multiple filesystems
sudo fsarchiver savefs [archive.fsa] [/dev/sda1] [/dev/sda2]
List archive contents
fsarchiver archinfo [archive.fsa]
Save with compression
sudo fsarchiver savefs -z9 [archive.fsa] [/dev/sda1]
Save with encryption
sudo fsarchiver savefs -c [password] [archive.fsa] [/dev/sda1]
说明
fsarchiver saves and restores filesystems to/from archive files. Unlike tar, it preserves filesystem attributes, ACLs, extended attributes, and can restore to different sized partitions. The tool works at the filesystem level, saving used blocks only. It supports ext2/3/4, XFS, Btrfs, NTFS, and other filesystems, with optional compression and encryption.
参数
- savefs
- Save filesystem(s) to archive.
- restfs
- Restore filesystem from archive.
- archinfo
- Show archive information.
- probe
- Show detected filesystems.
- -z _level_
- Compression level (0-9).
- -j _jobs_
- Parallel compression jobs.
- -c _password_
- Encrypt archive.
- -v
- Verbose output.
- -A
- Allow restoring to smaller filesystem.
FAQ
What is the fsarchiver command used for?
fsarchiver saves and restores filesystems to/from archive files. Unlike tar, it preserves filesystem attributes, ACLs, extended attributes, and can restore to different sized partitions. The tool works at the filesystem level, saving used blocks only. It supports ext2/3/4, XFS, Btrfs, NTFS, and other filesystems, with optional compression and encryption.
How do I run a basic fsarchiver example?
Run `sudo fsarchiver savefs [archive.fsa] [/dev/sda1]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does savefs do in fsarchiver?
Save filesystem(s) to archive.