tar-snapshot-edit.texi 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @c This is part of the paxutils manual.
  2. @c Copyright (C) 2007 Free Software Foundation, Inc.
  3. @c This file is distributed under GFDL 1.1 or any later version
  4. @c published by the Free Software Foundation.
  5. @cindex Device numbers, changing
  6. @cindex snapshot files, editing
  7. @cindex snapshot files, fixing device numbers
  8. Sometimes device numbers can change after upgrading your kernel
  9. version or recofiguring the harvare. Reportedly this is the case with
  10. some newer @i{Linux} kernels, when using @acronym{LVM}. In majority of
  11. cases this change is unnoticed by the users. However, it influences
  12. @command{tar} incremental backups: the device number is stored in tar
  13. snapshot files (@pxref{Snapshot Files}) and is used to determine whether
  14. the file has changed since the last backup. If the device numbers
  15. change for some reason, the next backup you run will be a full backup.
  16. @pindex tar-snapshot-edit
  17. To minimize the impact in these cases, GNU @command{tar} comes with
  18. the @command{tar-snapshot-edit} utility for inspecting and updating
  19. device numbers in snapshot files. The utility, written by
  20. Dustin J.@: Mitchell, is available from
  21. @uref{http://www.gnu.org/@/software/@/tar/@/utils/@/tar-snapshot-edit.html,
  22. @GNUTAR{} home page}.
  23. To obtain the device numbers used in the snapshot file, run
  24. @smallexample
  25. $ @kbd{tar-snapshot-edit @var{snapfile}}
  26. @end smallexample
  27. @noindent
  28. where @var{snapfile} is the name of the snapshot file (you can supply as many
  29. files as you wish in a single command line ).
  30. To update all occurrences of the given device number in the file, use
  31. @option{-r} option. It takes a single argument of the form
  32. @samp{@var{olddev}-@var{newdev}}, where @var{olddev} is the device number
  33. used in the snapshot file, and @var{newdev} is the corresponding new device
  34. number. Both numbers may be specified in hex (e.g., @samp{0xfe01}),
  35. decimal (e.g., @samp{65025}), or as a major:minor number pair (e.g.,
  36. @samp{254:1}). To change several device numbers at once, specify them
  37. in a single comma-separated list, as in
  38. @option{-r 0x3060-0x4500,0x307-0x4600}.
  39. Before updating the snapshot file, it is a good idea to create a backup
  40. copy of it. This is accomplished by @samp{-b} option. The name of the
  41. backup file is obtained by appending @samp{~} to the original file name.
  42. An example session:
  43. @smallexample
  44. $ @kbd{tar-snapshot-edit /var/backup/snap.a}
  45. file version 2
  46. /tmp/snap: Device 0x0306 occurs 634 times.
  47. $ @kbd{tar-snapshot-edit -b -r 0x0306-0x4500 /var/backup/snap.a}
  48. file version 2
  49. @end smallexample