bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Changing 'dev' in snapshot files?


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] Changing 'dev' in snapshot files?
Date: Thu, 26 Apr 2007 11:07:17 +0300

Hi Dustin,

I have finished testing, everything works fine.  It appeared to
me that it would be useful to be able to change several device
numbers at once, so I have modified the script to make this possible.
Attached is a modified script and a short piece of documentation for it.
Please take a look at it and correct me if something is wrong.

Regards,
Sergey

Attachment: tar-snapshot-edit
Description: Perl program

  Note for the Linux kernel users: starting from version @FIXME{number},
the kernel changes major device numbers for @acronym{LVM}.  In 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.  Once you upgrade to the new
Linux kernel, all device numbers change and the next backup you run will
be a full backup.

  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 is written by Dustin J.
Mitchell.

  To obtain the device numbers used in the snapshot file, run 

@smallexample
$ @kbd{tar-snapshot-edit @var{snapfile}}
@end smallexample

@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 ).

To update all occurrences of the given device number in the file, use
@option{-r} option.  It takes a single argument of the form
@address@hidden@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}),
decimal (e.g., @samp{65025}), or as a major:minor number pair (e.g.,
@samp{254:1}).  To change several device numbers at once, specify them
in a single comma-separated list, as in
@option{-r 0x3060-0x4500,0x307-0x4600}.

Before updating the snapshot file, it is a good idea to create a backup
copy of it.  This is accomplished by @samp{-b} option.  The name of the
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
@end smallexample


reply via email to

[Prev in Thread] Current Thread [Next in Thread]