5 1 0:Support for Sparse Files
Overview
As of v. 5.0.0 Jaglion, SEP sesam provides support for Linux sparse files.
A sparse file is a file that allows optimization of disk usage – efficient storage allocation for large data where much of the data is zeros (empty data). These zeros are not stored as zeros on disk, instead brief information (metadata) is written representing the empty blocks to disk rather than the actual "empty" space. With sparse files, the logical file size is larger than the physical file size as the zeros are not physically stored on a storage device.
Handling sparse files
With SEP sesam support for sparse files, these files are marked as sparse in the cpio stream and backed up completely. When restoring, the file marked as sparse is created as a sparse by default, with zero ranges created as sparse ranges and no additional option required for this. The file is processed in 512-byte blocks and only if such a block consists entirely of zero bytes (0x00) is that block created sparse (hole).
In this way, SEP sesam ensures that when restoring a sparse file that contains large zero ranges, the physical disk space occupied is not significantly different from that of the original file, often even less. The concern that the disk may not be large enough to restore a sparse file and that the restore process will consequently fail, is thus unneeded. Especially when restoring a complete volume, support for sparse files prevents running out of disk space.
Sparse options
Sparse files are backed up completely by default, but marked as sparse in the cpio stream. When restoring, the zero ranges (>= 512 bytes) are created as sparse areas.
Note that some file systems create sparse files only with larger blocks, e.g. only with 4KByte, i.e. only contiguous areas with at least 4KByte are created sparse.
You can use additional options to ignore the sparse property during backup and restore. Note that the behaviour of the -o sparse=no is different for backup and restore.
Backup
- -o sparse=no
- The 'sparse' flag in the cpio stream is not set for sparse files, so when restoring with the default option (==: -o sparse=origin) zero ranges of sparse files are written completely.
Restore
- -o sparse=no
- The 'sparse' flag in the cpio stream is ignored, zero ranges are written completely to the file.
- -o sparse=zero
- In the case of a file with zero ranges, these ranges are created as sparse ranges, regardless of whether the file was already 'sparse' before.
Note | |
The option '-o sparse=origin' sets the default behaviour, so it must not be set explicitly. |
See also
SBC CLI – Backup – Advanced Backup and Restore Options