SERIOUS CONCERNS ABOUT TAR

SERIOUS CONCERNS ABOUT TAR

Post by rob » Sun, 21 Jun 1998 04:00:00





> Hello everyone.

[snip]
> The Long version:

> I recently bought a new hard drive.  Of course I wanted to copy my old
> linux system to the new drive.

[snip]

Howdy Dan,
You might find using cpio in pass through mode (-p) a better
alternative. Do a man cpio for the  correct options There was a good
Linux Jounal article on using cpio (check out the Linux Journal site for
previous issues?). If you are not a subscriber I will give them a
plug--great mag.
Good Luck,
Rob
--
***************************Powered by Linux*****************************
Rob St. John    

Scripture: Eccl.12:13 "Let us hear the conclusion of the whole matter:
Fear God, and keep his commandments; for this is the whole duty of man."
**********************Powered by the Holy Ghost*************************

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Daniel Lowe » Mon, 22 Jun 1998 04:00:00


Hello everyone.

The Short version

Tars defaults options no longer copy everything exactly as it was with
the correct permissions. Various switches do not provide the old
behaviour. Tar is version 1.11.8 from RedHat 4.2

The Long version:

I recently bought a new hard drive.  Of course I wanted to copy my old
linux system to the new drive.
So I tried the old trick from Running Linux tar cf - . | (cd /mnt; tar
xvf -) which is SUPPOSED to copy everything exactly as it was to the new
place.

I did the trick doing a ctrl-z once it got to /mnt otherwise would have
a recursive copy.  I rebooted using my boot floppy to rerun lilo. I then
ran X-windows everything seemed fine. Then I ran netscape it told me my
permissions were wrong. Went to a shell ouch my directory was owned by
root. My files bar a few were owned by root.  Atrun was also complaining
it didn't have permission to write to a directory.

Thank heaven I didn't delete my original partition.

So far tried. The following#
# c to create
# -o to keep original V copy features
# l to stay on same file system i.e. not read other device
# f to create a file
# - to send to standard out
# | to pipe
# cd $1 to the $1 directory
# o to keep original spec
# x to xtract
# v twice to engage more verbose
# f file
# - to extract from standard in
tar -colf - . | (cd $1; tar oxvvf -)

This works for the permissions but when it got to the device directory
it said unrecognised file type
for all the device files and a few others floating around my file
system. At first I thought perhaps it was just the double verbose
running the files through file to provide additiional comments. But in
fact it hadn't copied them at all.

My question is now how do I get tar to work correctly and copy
everything exactly as is to my new hard disc.

--

Smail: 61 Viscount Road, Waldronville, Dunedin, New Zealand.
      Use LINUX! the choice of a GNU generation.  (GNU = GNUs not Unix).

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Mike Hollan » Mon, 22 Jun 1998 04:00:00


Daniel,
its good to see so many details. You should get some good answers.

Quote:> I did the trick doing a ctrl-z once it got to /mnt otherwise would have
> a recursive copy.

I suspect you killed it before it could fix the permissions etc. Use '-l'.

Quote:> Thank heaven I didn't delete my original partition.

That would be just silly :)

Quote:> So far tried. The following#
> # c to create
> # -o to keep original V copy features

Uh-huh - I think this is for backward compatibility with ancient versions
of tar,
 and may be your problem. It would turn off new features.

Quote:> My question is now how do I get tar to work correctly and copy
> everything exactly as is to my new hard disc.

Dont use '-o' and remember to set umask=0 (thats my usual mistake.)

Another way, these days, is "cp -a", which should have been done years ago.

I hope that helps. Regards,

--

You can pick your friends, and you can pick your nose, but you can't
pick your friend's nose.

PGP ID 8B3D0765. FP: 30 07 BF 6C 9B 45 E8 C8  EA 30 4F 01 DC A2 91 88

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Robert Nicho » Mon, 22 Jun 1998 04:00:00




:
:I recently bought a new hard drive.  Of course I wanted to copy my old
:linux system to the new drive.
:So I tried the old trick from Running Linux tar cf - . | (cd /mnt; tar
:xvf -) which is SUPPOSED to copy everything exactly as it was to the new
:place.
:
:I did the trick doing a ctrl-z once it got to /mnt otherwise would have
:a recursive copy. [SNIP]

Some recent versions of 'tar' delay setting final ownership and
permissions until the entire archive has been processed.  This avoids
some problems when files and directories in the archive have restrictive
permissions, but it means you have to let 'tar' run to completion to get
everything set properly.  You'll need to find another way to exclude
/mnt.  You can include the name "/mnt" in a "--exclude" file or perhaps
use the "--one-file-system" option.

Yes it's a PITA, especially when I'm just extracting a few files from
the beginning of a lengthy archive that really _is_ on a (slow) tape
drive.

--


PGP public key 1024/9A9C7955
Key fingerprint = 2F E5 82 F8 5D 06 A2 59  20 65 44 68 87 EC A7 D7

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Fred Smi » Mon, 22 Jun 1998 04:00:00


: Hello everyone.

: The Short version

: Tars defaults options no longer copy everything exactly as it was with
: the correct permissions. Various switches do not provide the old
: behaviour. Tar is version 1.11.8 from RedHat 4.2

: The Long version:

: I recently bought a new hard drive.  Of course I wanted to copy my old
: linux system to the new drive.

I just transferred my entire system to a new hard drive yesterday, the
system consisted of three partitions. I transferred them using 'cp -a'.
Boot from a recovery floppy, mount the partition you want to copy from
(I suggest doing it by booting a system that does not depend on mounting
your hard drive at boot time, so that you will not have trouble with
traversing mount points during the copy... the -x option on my version
of cp does not seem to prevent crossing mount points as I would expect
it to), mount the one you want to copy to, then use 'cp -a (source/*)
(destination)' to do the deed. That does NOT copy any files or
directories in the source directory top level that begin with a '.', so
you should go back and explicitly copy them, also with 'cp -a' once the
copy has completed. Then do the same for any other partitions.

Having done that, it is necessary to fix up a few places that point to
the old partitions (unless the partition names have not changed across
drives): /etc/fstab, /etc/lilo.conf.

so, make a bootable floppy (use dd to copy your booting kernel to a
diskette, then use rdev to tell it the name of root partition on the new
drive AFTER you finish moving drives around. Shut down, move around the
drives to their new configuration then boot it, run lilo to update the
boot loader (based on your newly-revised /etc/lilo.conf). Shut it back
down, remove the diskette and reboot. Voila!
--

                       I can do all things through Christ
                              who strengthens me.
------------------------------ Philippians 4:13 -------------------------------

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Rob Rya » Mon, 22 Jun 1998 04:00:00



> Tars defaults options no longer copy everything exactly as it was with
> the correct permissions. Various switches do not provide the old
> behaviour. Tar is version 1.11.8 from RedHat 4.2

(I doubt anything has changed in this area, but for the record I tried
with tar 1.12 from RedHat 5.0.)

(Just curious: Old behavior from where?)

I didn't see in your post any mention of having tried:

-p, --same-permissions, --preserve-permissions
              extract all protection information

Without this flag the permissions on the extracted files will be passed
through your current umask setting, the default on my system is 022
which denies write access to 'other' and 'group'.  You should also
extract as root if any of the files are not owned by you.

So I tried:

tar cvf - .|(cd foo;tar xvvfp -)

And it preserved ownership and permissions correctly.  (But, I also
didn't try the ^Z trick, which has also been noted as a potential
problem.)  When I tried without the 'p' flag, permissions were modified
as noted above.

I also don't know why you would want to use -o in this situation.
Admittedly I don't know the differences between a " V7 format archive"
and a "ANSI format archive", but as long as both tars use the same
format it seems unlikely to make a difference.

-Rob

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by friedhelm.mehner » Tue, 23 Jun 1998 04:00:00


: The Short version

: Tars defaults options no longer copy everything exactly as it was with
: the correct permissions. Various switches do not provide the old
: behaviour. Tar is version 1.11.8 from RedHat 4.2

Well...
that's actualy nothing new.

The problem is: There does not exist such a thing as a "Default
Configuration" for tar in Linux!

Everybody, who puts together a distribution has a different oppinion,
how things should be.

Get the source, configure it to your liking and compile it yourself!

The other "workaround" would be to put *all* options at the comandline,
so the compiled in "defaults" don't matter.

Regards,
Friedhelm

--
Microsoft is NOT the answer. Microsoft is the Question.
The answer is: "NO!"
-------------------------------------------------------------------
Friedhelm Mehnert,  Berliner Allee 42,  22850 Norderstedt,  Germany

-------------------------------------------------------------------

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Sid Boyc » Thu, 25 Jun 1998 04:00:00





> :
> :I recently bought a new hard drive.  Of course I wanted to copy my old
> :linux system to the new drive.
> :So I tried the old trick from Running Linux tar cf - . | (cd /mnt; tar
> :xvf -) which is SUPPOSED to copy everything exactly as it was to the new
> :place.
> :
> :I did the trick doing a ctrl-z once it got to /mnt otherwise would have
> :a recursive copy. [SNIP]

> Some recent versions of 'tar' delay setting final ownership and
> permissions until the entire archive has been processed.  This avoids
> some problems when files and directories in the archive have restrictive
> permissions, but it means you have to let 'tar' run to completion to get
> everything set properly.  You'll need to find another way to exclude
> /mnt.  You can include the name "/mnt" in a "--exclude" file or perhaps
> use the "--one-file-system" option.

> Yes it's a PITA, especially when I'm just extracting a few files from
> the beginning of a lengthy archive that really _is_ on a (slow) tape
> drive.

> --


        I have a script that I run, used it many times and it preserves everything as
it should, you mount the new drive as /mnt and mount it as /mnt. After the
script is done, you can make directories /mnt/proc and /mnt/mnt, boot off a
floppy made by "dd if=<your_kernel> of=/dev/fd0H1440 bs=16k", run lilo on the
new hda, then reboot on it.
[barrabas:~]# less /usr/local/mybin/hdcopy
umask 000
(cd /; tar -cf - . --atime-preserve -p --exclude=proc --exclude=mnt) | tar -xvf
- --atime-preserve -p
umask 002
        The - --atime-preserve -p is all part of the line above it.
Regards
--
... Sid Boyce...Amdahl(Europe)...44-121 422 0375
                   -----------------------------------
Any opinions expressed above are mine and do not necessarily represent
 the opinions or policies of Amdahl Corporation.
 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Eric Lee Gre » Thu, 25 Jun 1998 04:00:00



>Tars defaults options no longer copy everything exactly as it was with
>the correct permissions. Various switches do not provide the old
>behaviour. Tar is version 1.11.8 from RedHat 4.2

GNU Tar has always behaved this way. Believe me. I've been using it
since Slackware 95 days (August 1995). Never changed in all that time.

Quote:>So I tried the old trick from Running Linux tar cf - . | (cd /mnt; tar
>xvf -) which is SUPPOSED to copy everything exactly as it was to the new

Nope. Read the tar 'info' file. It will tell you two things:

   1) File ownership and permissions are not set until tar has successfully
completed, meaning that your CTRL-C trick barfs it,
   2) File permissions will have the owner's umask applied to them unless
you explicitly provide the "-p" option to 'tar'.
   3) --exclude can be used to exclude particular files.

So:
  tar --exclude /proc --exclude /mnt -cf - / |  ( cd /mnt ; tar xvpf - )

will do what you are wanting to do.

Or you can use 'cpio', like some other person suggested :-).

--

Systems Specialist               Educational Administration Solutions
             See http://members.tripod.com/~latrails

 
 
 

SERIOUS CONCERNS ABOUT TAR

Post by Kevin Lindsa » Thu, 25 Jun 1998 04:00:00


I use to use tar this way to copy files from one place to another, but tar
lacks file hole checking and other features that I wanted. So I wrote a
Backup Copy program...  You may have seen my previous post to this list
about it.

You can download it at:

ftp://mocha.mkintraweb.com/pub/linux/cpbk/

It has great backup features for copying mass files from one place to
another and retainign their perms, mode and device types.  It will also
maintain your backup by removing deleted files from your previous back
that were deleted from the source, aswell as keeping a trash bin for those
delted files.  It also has an exclude option.  All options can be
specified on the command line or from a specified configuration file. Its
faster than cp as well. :)

I currently use it to backup 10 Linux server via NFS on to a Raid device.
Works great so far.

_____________________________________________________________________
  _   _ _   _
 | \ | | \ | | Kevin Lindsay                  | Powered By Linux!
 |  \| |  \| | NetNation Communications Inc.  | Web Hosting Services
 | |\  | |\  | http://www.netnation.com/      | Linux Development



> >Tars defaults options no longer copy everything exactly as it was with
> >the correct permissions. Various switches do not provide the old
> >behaviour. Tar is version 1.11.8 from RedHat 4.2

> GNU Tar has always behaved this way. Believe me. I've been using it
> since Slackware 95 days (August 1995). Never changed in all that time.

> >So I tried the old trick from Running Linux tar cf - . | (cd /mnt; tar
> >xvf -) which is SUPPOSED to copy everything exactly as it was to the new

> Nope. Read the tar 'info' file. It will tell you two things:

>    1) File ownership and permissions are not set until tar has successfully
> completed, meaning that your CTRL-C trick barfs it,
>    2) File permissions will have the owner's umask applied to them unless
> you explicitly provide the "-p" option to 'tar'.
>    3) --exclude can be used to exclude particular files.

> So:
>   tar --exclude /proc --exclude /mnt -cf - / |  ( cd /mnt ; tar xvpf - )

> will do what you are wanting to do.

> Or you can use 'cpio', like some other person suggested :-).

> --

> Systems Specialist               Educational Administration Solutions
>              See http://members.tripod.com/~latrails

 
 
 

1. Serious question concerning SCSI...

  I have a BusLogic 948 SCSI controller and an IBM HD...  I created a set of
  installation disks as follows:
          boot: scsi
          root: color

  durring all of the init stuff, it says SCSI hosts: 0...   and when I go to
  run fdisk and setup a Linux native ana swap, it cones back and says:
          unable to open /dev/sda

  Help, I'm confused???  If anyone can help, I would appriciate it...

From the README.BusLogic available at http://www.dandelion.com/Linux and in
the latest Linux kernels:

                      BT-948/958/958D INSTALLATION NOTES

The BT-948/958/958D PCI Ultra SCSI Host Adapters have some features which may
require attention in some circumstances when installing Linux.

o PCI I/O Port Assignments

  When configured to factory default settings, the BT-948/958/958D will only
  recognize the PCI I/O port assignments made by the motherboard's PCI BIOS.
  The BT-948/958/958D will not respond to any of the ISA compatible I/O ports
  that previous BusLogic SCSI Host Adapters respond to.  This driver supports
  the PCI I/O port assignments, so this is the preferred configuration.
  However, if the obsolete BusLogic driver must be used for any reason, such as
  a Linux distribution that does not yet use this driver in its boot kernel,
  BusLogic has provided an AutoSCSI configuration option to enable a legacy ISA
  compatible I/O port.

  To enable this backward compatibility option, invoke the AutoSCSI utility via
  Ctrl-B at system startup and select "Adapter Configuration", "View/Modify
  Configuration", and then change the "ISA Compatible Port" setting from
  "Disable" to "Primary" or "Alternate".  Once this driver has been installed,
  the "ISA Compatible Port" option should be set back to "Disable" to avoid
  possible future I/O port conflicts.  The older BT-946C/956C/956CD also have
  this configuration option, but the factory default setting is "Primary".

2. reading file values into an array

3. Extreme newbie question concerning tar

4. login no longer asks for password

5. Question concerning tar & mt and 8mm tapes...

6. Anybody know anything about linux?

7. Serious bug in Sun's tar

8. 3 button mice _do_ work

9. Serious people for a serious solution

10. Is Linux serious -- or just a serious toy?

11. Serious Serious problem

12. tar -xvf mozilla.tar = tar: directory checksum error

13. Wanted: rcmd host tar x_?_vqf file.tar file1 ... fileN | tar xvf -