FATBACKUP

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
NOTE
BUGS
SEE ALSO

NAME

fatbackup − copy the essential parts of a FAT12/16/32 filesystem

SYNOPSIS

fatbackup [-i] [-u] [-a] source destination

DESCRIPTION

Copy the reserved sectors, the file allocation tables and the directory clusters of a FAT12/16/32 filesystem to another. This data is the structure of the filesystem, everything except the actual content of the files.

If the destination is a regular file (an image), it is created sparse if the operating system supports it where the file is. For example, running "fatbackup /dev/sdb1 /home/sgerwk/image.fat" on Linux, if /home is an ext2 filesystem then image.fat will be sparse. Even if its size may look large, only the actual structure of the original filesystem takes space. This can be checked with ls -ls image.fat.

If the filesystem in /dev/sdb1 later becomes corrupted, it can be restored by copying its structure back: fatbackup /home/sgerwk/image.fat /dev/sdb1. Only the structure of the filesystem is restored; if the content of a file is corrupted or changed, it is not. This may be a problem when deleting old files and creating new ones, especially on a FAT12 or FAT16.

OPTIONS

-i

if the destination file exists, overwrite without asking; the default is to ask

-u

copy only the sectors of the file allocation tables that are actually used for the existing files and directories

-a

write sectors and clusters without checking whether they are already the same in the sources and in the destination; this is implicit if the destination file does not exists, otherwise the default is that sectors and clusters are written only if they do not coincide

NOTE

This program only saves the skeleton of the filesystem, but if the media is partitioned also the master boot record is essential. To save it:

	dd if=/dev/sdb of=image.mbr bs=512 count=1
	fatbackup /dev/sdb1 image.fat

BUGS

No check is done on the destination: if a backup is copied to a filesystem that was not where the backup comes from, its content is likely irreparably corrupted.

SEE ALSO

fattool(1), fat_lib(3)