[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tar -c -G -N <date> query
From: |
Tom Crane |
Subject: |
Re: tar -c -G -N <date> query |
Date: |
Fri, 18 Jul 2003 21:50:12 +0100 |
> Hello Tom.
Hi,
>
> On Wed, Jul 16, 2003 at 07:00:47PM +0100, Tom Crane wrote:
> > One question: Can I fabricate a snapshotfile? The format appear to be
>
> though I don't have experiences with it myself, I think I heard it's
> possible.
>
> > time_t format timestamp
> > device_number directory-inode-number directory-spec
> > device_number directory-inode-number directory-spec
> > device_number directory-inode-number directory-spec
> > etc.
>
> > If I were to invent dummy device_numbers (or obtain the device-->numbers
> > mapping??), read the directory inode numbers and directory names out of my
> > *full.tar.bz2 tarfiles, and write them to a file with the above format,
> > would this do?
>
> I think it should work. You can try the method on a smaller test tree.
>
> But it's not enough to invent device numbers. These numbers are unique
> for each device listed when you run ``mount''.
> (They are probably calculated from major and minor device numbers, as
> listed by eg. ``ls -l /dev/hda1''.)
I did wonder about that... but it seemed too nasty to be true -- I mean
to tie the tarfile to the H/W-particulars rather than the mount-point for
example. I've not tried it but I wonder if this means that a tarfile
created with listed-incremental could not be extracted on to a different
IDE HD partition, or a device on a different bus altogether. Surely this
can't be true...? ;-|
>
> I'd suggest that you run tar with ``-g'' on a small portion of each
> tree mounted by ``mount'' to get the mapping. Then you can fabricate
> the file.
Just checked it. It does work, the mapping is device_number = major_id*256 +
minor_id
> (BTW: if the device is a nfs device, the device numbers are not significant
> and you can use any dummy number.)
Agreed.
>
> Good luck,
> Stepan Kasal
Cheers
Tom.
Ps. CCed: address@hidden