[Q] tar - Mode or device-type changed

Albert Cahalan albert at ccs.neu.edu
Wed Nov 13 10:17:53 EST 1996


>> The reason /tmp differs is probably because tar itself is using it.
>> There is no point to archiving /tmp or /var/tmp, which are, well,
>> temporary. There is no point to using tar on things in the /dev
>> hierarchy.  You should exclude all of /dev when creating the archive.
>
> Keep in mind that I'm trying to move/resize a partition as simply as
> possible.  What I did was to boot up on hda3, mount hda2 as /mnt/2/, and
> tarred from within there.  Since I booted from hda3 and was using was using
> it as root, /mnt/2/tmp and /mnt/var/tmp should not have been affected.
> 
> Anyways, lets move on to /dev.
> 
> Lets say I exclude /dev when I tar hda2.  Then I subsequently trash hda2. 
> If I restore hda2 from the tar archive and then try to boot from hda2, will
> Linux build all the /dev devices on the fly during startup?  If not, what
> happens?

You are dead.

You should include /dev, but not /proc. Clean out /tmp before you
do the backup, then include it in the backup.

I think you should tar directly to the device. First boot from a floppy
with mount, tar, and gzip in a ramdisk. Mount your old partition on /mnt,
then tar it like this:

        tar zcSf /dev/hda6 /mnt            # replace hda6 with your partition

Unmount the old partition, mount the new one on /mnt, and restore like this:

        tar zxSf /dev/hda6 /mnt

By operating from a floppy, it is very easy to avoid /proc and
the tar file itself. If you have more disk space than CPU power,
remove the "z" from those commands. In the opposite case, set
an environment variable to make gzip do maximum compression.



More information about the Discuss mailing list