diff options
author | Nathan Stratton Treadway <nathanst+bugtar@ontko.com> | 2011-09-19 15:29:00 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-09-19 15:29:00 +0300 |
commit | 51b272f5723b782fb079b1cd55daf934331596b6 (patch) | |
tree | 4f6ccf13d0cba6a52d1bd3f46fb17838a7bfd6d7 /doc | |
parent | 1f9b376c90f50836b1ca2517cda0bfcab75ad8ae (diff) | |
download | tar-51b272f5723b782fb079b1cd55daf934331596b6.tar.gz |
Upgrade tar-snapshot-edit script.
* scripts/tar-snapshot-edit: Update Perl syntax to work
correctly with more recent versions of Perl. (The original
code worked with in the v5.8 timeframe but not with
Perl v5.10.1 and later.)
Add a "-c" option to check the snapshot file for invalid
field values.
Handle NFS indicator character ("+") in version 0 and 1 files.
Preserve the original header/version line when editing version 1
or 2 files.
Tweak output formatting.
* doc/tar-snapshot-edit.texi: Update documentation.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/tar-snapshot-edit.texi | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/doc/tar-snapshot-edit.texi b/doc/tar-snapshot-edit.texi index ed9640c5..697a409d 100644 --- a/doc/tar-snapshot-edit.texi +++ b/doc/tar-snapshot-edit.texi @@ -6,24 +6,28 @@ @cindex Device numbers, changing @cindex snapshot files, editing @cindex snapshot files, fixing device numbers - Sometimes device numbers can change after upgrading your kernel -version or reconfiguring the hardware. Reportedly this is the case with -some newer @i{Linux} kernels, when using @acronym{LVM}. In majority of + Various situations can cause device numbers to change: upgrading your +kernel version, reconfiguring your hardware, loading kernel modules in a +different order, using virtual volumes that are assembled dynamically +(such as with @acronym{LVM} or @acronym{RAID}), hot-plugging drives +(e.g. external USB or Firewire drives), etc. In the majority of cases this change is unnoticed by the users. However, it influences @command{tar} incremental backups: the device number is stored in tar snapshot files (@pxref{Snapshot Files}) and is used to determine whether the file has changed since the last backup. If the device numbers -change for some reason, the next backup you run will be a full backup. +change for some reason, by default the next backup you run will be a +full backup. + @pindex tar-snapshot-edit To minimize the impact in these cases, GNU @command{tar} comes with the @command{tar-snapshot-edit} utility for inspecting and updating -device numbers in snapshot files. The utility, written by -Dustin J.@: Mitchell, is available from +device numbers in snapshot files. (The utility, written by +Dustin J.@: Mitchell, is also available from the @uref{http://www.gnu.org/@/software/@/tar/@/utils/@/tar-snapshot-edit.html, -@GNUTAR{} home page}. +@GNUTAR{} home page}.) - To obtain the device numbers used in the snapshot file, run + To obtain a summary of the device numbers found in the snapshot file, run @smallexample $ @kbd{tar-snapshot-edit @var{snapfile}} @@ -31,10 +35,19 @@ $ @kbd{tar-snapshot-edit @var{snapfile}} @noindent where @var{snapfile} is the name of the snapshot file (you can supply as many -files as you wish in a single command line). +files as you wish in a single command line). You can then compare the +numbers across snapshot files, or against those currently in use on the +live filesystem (using @command{ls -l} or @command{stat}). + + Assuming the device numbers have indeed changed, it's often possible +to simply tell @GNUTAR{} to ignore the device number when processing the +incremental snapshot files for these backups, using the +@option{--no-check-device} option (@pxref{device numbers}). -To update all occurrences of the given device number in the file, use -@option{-r} option. It takes a single argument of the form + Alternatively, you can use the @command{tar-edit-snapshot} script's +@option{-r} option to update all occurrences of the given device +number in the snapshot file(s). It takes a single argument +of the form @samp{@var{olddev}-@var{newdev}}, where @var{olddev} is the device number used in the snapshot file, and @var{newdev} is the corresponding new device number. Both numbers may be specified in hex (e.g., @samp{0xfe01}), @@ -49,9 +62,30 @@ backup file is obtained by appending @samp{~} to the original file name. An example session: @smallexample -$ @kbd{tar-snapshot-edit /var/backup/snap.a} -file version 2 -/tmp/snap: Device 0x0306 occurs 634 times. -$ @kbd{tar-snapshot-edit -b -r 0x0306-0x4500 /var/backup/snap.a} -file version 2 +$ @kbd{tar-snapshot-edit root_snap.0 boot_snap.0} +File: root_snap.0 + Detected snapshot file version: 2 + + Device 0x0000 occurs 1 times. + Device 0x0003 occurs 1 times. + Device 0x0005 occurs 1 times. + Device 0x0013 occurs 1 times. + Device 0x6801 occurs 1 times. + Device 0x6803 occurs 6626 times. + Device 0xfb00 occurs 1 times. + +File: boot_snap.0 + Detected snapshot file version: 2 + + Device 0x6801 occurs 3 times. +$ @kbd{tar-snapshot-edit -b -r 0x6801-0x6901,0x6803-0x6903 root_snap.0 boot_snap.0} +File: root_snap.0 + Detected snapshot file version: 2 + + Updated 6627 records. + +File: boot_snap.0 + Detected snapshot file version: 2 + + Updated 3 records. @end smallexample |