logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

fsarchiver - filesystem archiver

Author

       fsarchiver  was  written  by  Francois  Dupoux. It is released under the GPL2 (GNU General Public License
       version 2). This manpage was written by Ilya Barygin and Francois Dupoux.

                                                30 December 2009                                   FSARCHIVER(8)

Commands

savefs Save device filesystem to archive.

       restfs Restore filesystems from archive.  This overwrites the existing data on device.  Zero-based  index
              n  indicates  the  part  of  the archive to restore.  Optionally, a filesystem may be converted to
              fstype and extra mkfs options specified.  newlabel and  newuuid  override  values  stored  in  the
              archive.

       savedir
              Save directories to archive (similar to a compressed tarball).

       restdir
              Restore data from archive which is not based on a filesystem to destination.

       archinfo
              Show information about an existing archive file and its contents.

       probe  Show list of filesystems detected on the disks.

Description

       fsarchiver  is a system tool that allows you to save the contents of a filesystem to a compressed archive
       file. The filesystem contents can be restored on a device which has  a  different  size  and  it  can  be
       restored  on  a  different  filesystem.  Unlike  tar/dar,  fsarchiver also creates the filesystem when it
       extracts the data to devices. Everything is checksummed in the archive in order to protect the  data.  If
       the archive is corrupt, you just lose the current file, not the whole archive.

Examples

saveonlyonefilesystem(/dev/sda1)toanarchive:
       fsarchiver savefs /data/myarchive1.fsa /dev/sda1

   savetwofilesystems(/dev/sda1and/dev/sdb1)toanarchive:
       fsarchiver savefs /data/myarchive2.fsa /dev/sda1 /dev/sdb1

   restorethefirstfilesystemfromanarchive(first=number0):
       fsarchiver restfs /data/myarchive2.fsa id=0,dest=/dev/sda1

   restorethesecondfilesystemfromanarchive(second=number1):
       fsarchiver restfs /data/myarchive2.fsa id=1,dest=/dev/sdb1

   restoretwofilesystemsfromanarchive(number0and1):
       fsarchiver restfs /data/arch2.fsa id=0,dest=/dev/sda1 id=1,dest=/dev/sdb1

   restoreafilesystemfromanarchiveandconvertittoreiserfs:
       fsarchiver restfs /data/myarchive1.fsa id=0,dest=/dev/sda1,mkfs=reiserfs

   restoreafilesystemfromanarchiveandspecifyextramkfsoptions:
       fsarchiver restfs /data/myarchive1.fsa id=0,dest=/dev/sda1,mkfs=ext4,mkfsopt="-I 256"

   restoreafilesystemfromanarchiveandspecifyanewfilesystemlabel:
       fsarchiver restfs /data/myarchive1.fsa id=0,dest=/dev/sda1,label=root

   restoreafilesystemfromanarchiveandspecifyanewfilesystemUUID:
       fsarchiver restfs /data/myarchive1.fsa id=0,dest=/dev/sda1,uuid=5f6e5f4f-dc2a-4dbd-a6ea-9ca997cde75e

   savethecontentsof/usr/src/linuxtoanarchive(similartotar):
       fsarchiver savedir /data/linux-sources.fsa /usr/src/linux

   saveafilesystem(/dev/sda1)toanarchivesplitintovolumesof680MB:
       fsarchiver savefs -s 680 /data/myarchive1.fsa /dev/sda1

   saveafilesystemandexcludeallfiles/dirscalled'pagefile.*':
       fsarchiver savefs /data/myarchive.fsa /dev/sda1 --exclude='pagefile.*'

   genericexcludefor'share'suchas'/usr/share'and'/usr/local/share':
       fsarchiver savefs /data/myarchive.fsa --exclude=share

   absoluteexcludevalidfor'/usr/share'butnotfor'/usr/local/share':
       fsarchiver savefs /data/myarchive.fsa --exclude=/usr/sharesaveafilesystem(/dev/sda1)toanencryptedarchive:
       fsarchiver savefs -c mypassword /data/myarchive1.fsa /dev/sda1

   sameasbeforebutpromptforpasswordintheterminal:
       fsarchiver savefs -c - /data/myarchive1.fsa /dev/sda1

   extractanarchivemadeofsimplefilesto/tmp/extract:
       fsarchiver restdir /data/linux-sources.fsa /tmp/extract

   showinformationaboutanarchiveanditsfilesystems:
       fsarchiver archinfo /data/myarchive2.fsa

Name

       fsarchiver - filesystem archiver

Options

-h,--help
              Show help and information about how to use fsarchiver with examples.

       -V,--version
              Show program version and exit.

       -v,--verbose
              Verbose  mode  (can  be used several times to increase the level of details).  The details will be
              printed to the console.

       -o,--overwrite
              Overwrite the archive if it already exists instead of failing.

       -d,--debug
              Debug mode (can be used several times to increase the level of  details).   The  details  will  be
              written in /var/log/fsarchiver.log.

       -x,--experimental
              Allow to save filesystems which support is considered experimental in fsarchiver.

       -A,--allow-rw-mounted
              Allow  to  save  a  filesystem which is mounted in read-write (live backup). By default fsarchiver
              fails with an error if the device is mounted in read-write mode which allows modifications  to  be
              done  on  the  filesystem  during  the  backup.  Modifications can drive to inconsistencies in the
              backup. Using LVM snapshots is  the  recommended  way  to  make  backups  since  it  will  provide
              consistency,  but  it  is only available for filesystems which are on LVM logical volumes. Deleted
              files during the backup process are ignored when this option is used.

       -a,--allow-no-acl-xattr
              Allow to save a filesystem when ACLs and extended attributes are not supported (or  are  disabled)
              by  the  kernel.  By  default fsarchiver fails with an error if it cannot access ACLs and extended
              attributes, since they would not be saved. If  you  do  not  need  ACLs  and  extended  attributes
              preserved then it is safe to use this option.

       -epattern,--exclude=pattern
              Exclude  files  and  directories  that  match  specified  pattern.  The  pattern can contain shell
              wildcards such as * and ? or may be either a simple file/dir name or an  absolute  file/dir  path.
              You  must  use quotes around the pattern each time you use wildcards, else it would be interpreted
              by the shell. The wildcards must be interpreted by fsarchiver. See examples below for more details
              about this option.

       -Llabel,--label=label
              Set the label of the archive: it is just a comment about its contents. It can be used to  remember
              a particular thing about the archive or the state of the filesystem for instance.

       -zlevel,--compress=level
              Legacy  compression  levels  are  between  0 (very fast) and 9 (very good). The memory requirement
              increases a lot with the  best  compression  levels,  and  it  is  multiplied  by  the  number  of
              compression  threads  (option  -j).  Level  9  is  considered  as an extreme compression level and
              requires  an  huge  amount  of  memory  to  run.  For  more  details  please   read   this   page:
              http://www.fsarchiver.org/compression/-Zlevel,--zstd=level
              Zstd  compression  levels  are  between  1  (very fast) and 22 (very good). The memory requirement
              increases a lot with the  best  compression  levels,  and  it  is  multiplied  by  the  number  of
              compression  threads (option -j). Levels above 20 are considered as extreme compression levels and
              requires  an  huge  amount  of  memory  to  run.  For  more  details  please   read   this   page:
              http://www.fsarchiver.org/compression/-smbsize,--split=mbsize
              Split the archive into several files of mbsize megabytes each.

       -jcount,--jobs=count
              Create more than one (de)compression thread. Useful on multi-core CPUs. By default fsarchiver will
              only  use  one  (de)compression thread (-j 1) and then only one logical processor will be used for
              the task. You should use this option if you have a multi-core CPU or more than one physical CPU on
              your computer. The typical way to use it is to specify the number of logical processors  available
              so  that  all  the processing power is used to (de)compress the archive very quickly. You may also
              want to use all logical processors but  one  so  that  your  system  stays  responsive  for  other
              applications.

       -cpassword,--cryptpass=password
              Encrypt/decrypt  data  in  archive.  Password length: 6 to 64 characters. You can either provide a
              real password or a dash (-c -). Use the dash if you do not want to provide  the  password  in  the
              command line. It will be prompted in the terminal instead.

Synopsis

fsarchiver[options]savefsarchivedevice...fsarchiver[options]restfsarchiveid=n,dest=device[,mkfs=fstype,mkfsopt=options,label=newlabel,uuid=newuuid]...fsarchiver[options]savedirarchivedirectory...fsarchiver[options]restdirarchivedestinationfsarchiver[options]archinfoarchivefsarchiver[options]probe[detailed]

Warning

fsarchiver is considered stable for Linux filesystems such as EXT4 and XFS but unstable for NTFS.

See Also