From: Leigh W. <le...@pd...> - 2006-03-16 21:54:58
|
Hi, I'm trying to come up with a backup scheme for my gumstix work. I need to back it up to a Win XP machine. A long time ago, I thought I would tar and zip the gumstix-buildroot dir, move it to Windows and be fine. However, I need to use a backup lately, and I was in for surprise. I had used tar -cvf buildroot.tar gumstix-buildroot, and when I untarred, none of the symbolic links worked. After a little looking around, I see that tar doesn't deal with links in the way I thought it might. =20 Now I'm trying to figure out how to use tar correctly, so everything is linked properly when I recover from a backup. I'm trying the -h switch, but that seems to produce strange results. If I use: tar -h -c -v -f buildroot.tar gumstix-buildroot It chugs on indefinitely. The buildroot is around 1GB, and my tar file was around 5GB before I stopped the process. It seems to complain about too many levels of symbolic links at some point.=20 If I just move the buildroot over to a Win machine, it doesn't know what to do with the linked files and thinks they are files of length 0. =20 If I just use zip on Linux (Suse 10) am I going to run into similar issues with links?=20 Any suggestions for backup to a Win machine (and being able to use those backups)? Leigh W. Wells |
From: Michael P. <mk...@in...> - 2006-03-17 00:54:49
|
Hi Leigh, On Thu, 2006-03-16 at 13:55 -0800, Leigh Wells wrote: > I had used tar -cvf buildroot.tar gumstix-buildroot, and when I > untarred, none of the symbolic links worked. After a little looking > around, I see that tar doesn't deal with links in the way I thought it > might. Where did you untar the archive? I ask because I had a similar problem. I didn't tar my buildroot, just burned a copy to cdrom then some time later after a hard disk died copied the backup to my new machine. It was unusable because all the symlinks were broken. Turns out the symlinks all had absolute paths ie pointed to things like /data/michael/gumstix/gumstix-buildroot/.../whatever whereas on the new machine the directory structure was quite different eg /home/michael/Desktop/gumstix/... I guess the answer for me would be to recreate the old dir structure on the new machine but I gave up in favour of a new buildroot. ls -l will show you where the symlinks think they should point. I think tar -cvf should preserve the symlinks and file permissions etc should come back as they were originally if you untar as root (tho' as you say not on a windows filesystem). Yes the -h option will make tar go crazy, it trys to replace symlinks with the actual file pointed to so duplicates lots of stuff and you get recursion problems. So my suggestion, untar into an identical directory structure if you can. Use ls -l to see where the original symlinks pointed to. There's probably a cleverer way to backup, I haven't figured it out but at least you can be reassured someone else had a similar nasty surprise when his buildroot 'backup' was needed :) cheers Michael. > Now I'm trying to figure out how to use tar correctly, so everything is > linked properly when I recover from a backup. I'm trying the -h switch, > but that seems to produce strange results. If I use: > > tar -h -c -v -f buildroot.tar gumstix-buildroot > > It chugs on indefinitely. The buildroot is around 1GB, and my tar file > was around 5GB before I stopped the process. It seems to complain about > too many levels of symbolic links at some point. > > If I just move the buildroot over to a Win machine, it doesn't know what > to do with the linked files and thinks they are files of length 0. > > If I just use zip on Linux (Suse 10) am I going to run into similar > issues with links? > > Any suggestions for backup to a Win machine (and being able to use those > backups)? > > > Leigh W. Wells |
From: Dave H. <dhy...@gm...> - 2006-03-17 02:21:39
|
Hi Leigh, > I'm trying to come up with a backup scheme for my gumstix work. I need > to back it up to a Win XP machine. A long time ago, I thought I would > tar and zip the gumstix-buildroot dir, move it to Windows and be fine. > However, I need to use a backup lately, and I was in for surprise. Hmm. You definitely don't want to use the -h option. You want symlinks to be stored in the tar file as symlinks. I use: tar czf buildroot.tar.gz gumstix-buildroot and it chugs away for a while and I get a 340 Mb compressed tarball. You can do something like: find gumstix-buildroot -type l -ls to print out all of the symlinks. In my buildroot, I only had two symlinks that go outside of the buildroot tree: and those were: ./toolchain_build_arm_nofpu/uClibc_dev/usr/lib/libthread_db.so -> ../../home/dhylands/gumstix/gumstix-buildroot/toolchain_build_arm_nofpu/uCl= ibc_dev/lib/libthread_db.so.1 and ./toolchain_build_arm_nofpu/binutils-2.16.1-build/intl/libintl.h -> /home/dhylands/gumstix/gumstix-buildroot/toolchain_build_arm_nofpu/binutils= -2.16.1/intl/libgettext.h > I had used tar -cvf buildroot.tar gumstix-buildroot, and when I > untarred, none of the symbolic links worked. After a little looking > around, I see that tar doesn't deal with links in the way I thought it > might. How was it dealing with them? Where did you untar? > Now I'm trying to figure out how to use tar correctly, so everything is > linked properly when I recover from a backup. I'm trying the -h switch, > but that seems to produce strange results. If I use: > > tar -h -c -v -f buildroot.tar gumstix-buildroot > > It chugs on indefinitely. The buildroot is around 1GB, and my tar file > was around 5GB before I stopped the process. It seems to complain about > too many levels of symbolic links at some point. -h includes copies of the files. There are probably recursive symlinks in some of the directories which would cause what you're seeing. > If I just move the buildroot over to a Win machine, it doesn't know what > to do with the linked files and thinks they are files of length 0. If you untar using cygwin, it should preserve symlinks properly > If I just use zip on Linux (Suse 10) am I going to run into similar > issues with links? zip won't store symlinks properly. > Any suggestions for backup to a Win machine (and being able to use those > backups)? Use cygwin. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Craig H. <cr...@gu...> - 2006-03-17 17:08:33
|
On Mar 16, 2006, at 6:21 PM, Dave Hylands wrote: >> Any suggestions for backup to a Win machine (and being able to use >> those >> backups)? > > Use cygwin. If you have cygwin installed, then I'd highly recommend using rsync to mirror your buildroot instead of creating a full tarball every time. rsync will essentially do an incremental backup instead of a full backup. When you're dealing with a few hundred megs, that can be pretty significant. If on the other hand you're using tar because you want then to compress the archive to save space (and you want maybe to keep multiple tarball versions around for different datestamps or something), then I'd highly recommend looking at using rzip to compress those tarballs, rather than gzip. gzip is generally terrible at compressing anything over about 1MB; bzip2 is generally pretty bad at compressing anything over about 10MB. rzip rules when you're compressing large files. The only really big downside to rzip is that it needs to skip back and forth over the data being compressed, so you can't use rzip in a pipe. But with a tarball, that's not really a problem; you can just tar then compress instead of streaming the compression. C |