"tar" command has error messages.
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > "tar" command has error messages.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    "tar" command has error messages.  
Pom


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

Dear sir,

I used Solaris 2.5.1. I used command "tar" below.
tar cvf /backup/home.tar /export/home

I can backup about 10 minutes but can"t finish backup.
And then it has error messages below.

tar: write error: Invalid argument

Please let me know how to solve this problem.

Thank you very much.
regards,
Pom.





[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Anthony Mandick


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

In comp.unix.solaris Pom <pom2001@my-deja.com> wrote:
quote:
> Dear sir,
Hi! Binky!
quote:
> > I used Solaris 2.5.1. I used command "tar" below. > tar cvf /backup/home.tar /export/home > > I can backup about 10 minutes but can"t finish backup. > And then it has error messages below. > > tar: write error: Invalid argument > > Please let me know how to solve this problem.
Show us: du -ks /export/home df -k -am © 2003




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Brad


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM


"Pom" <pom2001@my-deja.com> wrote in message
news:7c0bff59.0310082316.4aff9c17@posting.google.com...
quote:
> Dear sir, > > I used Solaris 2.5.1. I used command "tar" below. > tar cvf /backup/home.tar /export/home > > I can backup about 10 minutes but can"t finish backup. > And then it has error messages below. > > tar: write error: Invalid argument > > Please let me know how to solve this problem. > > Thank you very much. > regards, > Pom.
While I don't recall the exact error messages out of 2.5.1 tar I would suspect that you have either run out of space on the /backup partition or the tar file could not fit within 2 GB. How big is the tar file when the error happens? How much space is available on the /backup partition? Brad




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Pom


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

> 	Show us:
quote:
> > du -ks /export/home > df -k >
# du -ks /export/home 2339697 /export/home # df -k (before backup) Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t0d0s0 95965 25028 61347 29% / /dev/dsk/c0t0d0s3 962751 609477 257004 71% /usr /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd /dev/dsk/c0t0d0s4 481067 275921 157046 64% /var /dev/dsk/c0t0d0s6 95965 51247 35128 60% /download /dev/dsk/c0t0d0s7 6022995 2339704 3081001 44% /export/home /dev/dsk/c0t1d0s1 7949730 1859091 5295669 26% /backup /dev/dsk/c0t1d0s0 481067 283053 149914 66% /misc /dev/dsk/c0t0d0s5 481067 217502 215465 51% /opt # df -k (after backup and can"t finish backup) Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t0d0s0 95965 25028 61347 29% / /dev/dsk/c0t0d0s3 962751 609493 256988 71% /usr /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd /dev/dsk/c0t0d0s4 481067 276201 156766 64% /var /dev/dsk/c0t0d0s6 95965 51247 35128 60% /download /dev/dsk/c0t0d0s7 6022995 2337984 3082721 44% /export/home /dev/dsk/c0t1d0s1 7949730 3958394 3196366 56% /backup /dev/dsk/c0t1d0s0 481067 283053 149914 66% /misc /dev/dsk/c0t0d0s5 481067 217502 215465 51% /opt And size of tar file that can"t finish backup. # ls -l /backup/home.tar -rw------- 1 root other 2147481600 Oct 10 10:56 /backup/home.tar regards, Pom.




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Pom


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

> While I don't recall the exact error messages out of 2.5.1 tar I would
quote:
> suspect that you have either run out of space on the /backup partition or > the tar file could not fit within 2 GB. > > How big is the tar file when the error happens? How much space is availab le > on the /backup partition? > > Brad
# df -k /backup (before) Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t1d0s1 7949730 1859091 5295669 26% /backup # df -k /backup (after) Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t1d0s1 7949730 3956874 3197886 56% /backup And size of tar file when the error happens. # ls -l /backup/home.tar -rw------- 1 root other 2147481600 Oct 10 10:56 /backup/home.tar regards, Pom.




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Logan Shaw


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

Pom wrote:
quote:
> And size of tar file that can"t finish backup. > > # ls -l /backup/home.tar > -rw------- 1 root other 2147481600 Oct 10 10:56 /backup/home.tar
That's really, really close to the largest file you can have that uses 32-bit offsets: $ echo '2^31 - 2147481600' | bc -l 2048 $ I would say it's highly likely you're running into that issue. Unfortunately, you are running 2.5.1, which is something like 6 or 7 years old. I can't recall whether it has support for 64-bit files (large files). Here are some things you could try: (1) "man mount_ufs" and see if describes a "largefiles" mount option. If so, remount with that option. You can add it to /etc/vfstab, or do "mount" to see the current options, then do "mount -o remount,largefiles,(otheroptions) /backup" to remount it with large files. (2) In case tar isn't largefile aware but the shell is, you could try this command instead: tar cf - export/home > /backup/home.tar If this works, it will be because it has the shell open the file (and pass the special flags to open() to allow large files) and then allows tar to write to standard output as if it's a stream, in which case size doesn't matter. Of course, #2 requires that you have mounted your filesystem so that it can handle large files. If neither of those works, you could of course upgrade. Or, another way of dealing with backups would be to write the backup to several smaller files. Here's a little shell script I call "breakup" that will let you do that: #! /bin/sh prefix="$1" piece=0 filename="$prefix"."$piece" filelist="$prefix".list
quote:
> "$filelist"
while : do echo 1>&2 "writing to '$filename'" dd obs=128k count=8192 of="$filename" if [ `ls -l "$filename" | awk '{print $5}'` -eq 0 ] then rm "$filename" break fi echo "$filename" >> "$filelist" piece=`expr $piece + 1` filename="$prefix"."$piece" done All you'd have to do is something like this: cd / && tar cf - export/home | breakup /backup/home.tar This should create /backup/home.tar.0 up through /backup/home.tar.1, each with as size of 1 GB or less. You can then use "cat" to put them back together again, or at least I think you can. (Presumably "cat" can handle several separate 1 GB files when writing to stdout.) Anyway, the command should look like this: cat `cat /backup/home.tar.list` | tar tvf - Naturally, this is not something I've tried before. The best solution would be to upgrade, and I make no guarantee that my code won't trash your backups. (In particular, there's one way that it could -- if any of those commands reads from stdin when you're not expecting it, it will absorb some of the input that should be going to an output file!) But anyway, maybe it will make it possible to do backups until you get the chance to upgrade, which would be valuable... - Logan




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Centurion


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

Pom wrote:
quote:
> Dear sir, > > I used Solaris 2.5.1. I used command "tar" below. > tar cvf /backup/home.tar /export/home > > I can backup about 10 minutes but can"t finish backup. > And then it has error messages below. > > tar: write error: Invalid argument > > Please let me know how to solve this problem. > > Thank you very much. > regards, > Pom.
As others have pointed out, it looks like you're running into the 2GB limit. Here's apossible solution: tar cvf - /export/home | gzip - > /backup/home.tar.gz or tar cvf - /export/home | compress - > /backup/home.tar.Z gzip has slightly better compression than compress but is not part of the standard 2.5.1 codebase so you might want to grab it from http://www.sunfreeware.com/ (asuming it's available for 2.5.1...otherwise it's either "compress" or compile gzip from source). HTH. Cheers, --James __________________________________ A random quote of nothing: Department chairmen never die, they just lose their faculties.




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Robert.Frank@unibas.ch


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

Not just really, really close, I'd say. Considering the amount of bytes
beeing backed up (2339697Kbytes or 2395849728bytes > 2^31!)then it is
clear that he has the problem of file size limitation. The fact that it
stops 2048 bytes short of the maximum allowed is due to the tar command
and the buffering (it uses buffers >= 2Kbytes) so the last buffer cannot
be written before the 2G limit is crossed.
With 2.5.1 Logan will have to find another solution.

Robert

Logan Shaw <lshaw-usenet@austin.rr.com> wrote:
quote:
> Pom wrote: > > That's really, really close to the largest file you can have that > uses 32-bit offsets: > > $ echo '2^31 - 2147481600' | bc -l > 2048 > $ > > I would say it's highly likely you're running into that issue. > > Unfortunately, you are running 2.5.1, which is something like 6 or 7 > years old. I can't recall whether it has support for 64-bit files > (large files). Here are some things you could try: > > (1) "man mount_ufs" and see if describes a "largefiles" mount option. > If so, remount with that option. You can add it to /etc/vfstab, > or do "mount" to see the current options, then do > "mount -o remount,largefiles,(otheroptions) /backup" to > remount it with large files. > > (2) In case tar isn't largefile aware but the shell is, you could > try this command instead: > > tar cf - export/home > /backup/home.tar > > If this works, it will be because it has the shell open the > file (and pass the special flags to open() to allow large > files) and then allows tar to write to standard output as > if it's a stream, in which case size doesn't matter. > > Of course, #2 requires that you have mounted your filesystem > so that it can handle large files. > > If neither of those works, you could of course upgrade. Or, > another way of dealing with backups would be to write the > backup to several smaller files. Here's a little shell script > I call "breakup" that will let you do that: > > #! /bin/sh > > prefix="$1" > piece=0 > filename="$prefix"."$piece" > filelist="$prefix".list > > while : > do > echo 1>&2 "writing to '$filename'" > dd obs=128k count=8192 of="$filename" > if [ `ls -l "$filename" | awk '{print $5}'` -eq 0 ] > then > rm "$filename" > break > fi > echo "$filename" >> "$filelist" > > piece=`expr $piece + 1` > filename="$prefix"."$piece" > done > > All you'd have to do is something like this: > > cd / && tar cf - export/home | breakup /backup/home.tar > > This should create /backup/home.tar.0 up through /backup/home.tar.1, > each with as size of 1 GB or less. You can then use "cat" to put > them back together again, or at least I think you can. (Presumably > "cat" can handle several separate 1 GB files when writing to stdout.) > Anyway, the command should look like this: > > cat `cat /backup/home.tar.list` | tar tvf - > > Naturally, this is not something I've tried before. The best solution > would be to upgrade, and I make no guarantee that my code won't > trash your backups. (In particular, there's one way that it could -- > if any of those commands reads from stdin when you're not expecting > it, it will absorb some of the input that should be going to an > output file!) But anyway, maybe it will make it possible to do > backups until you get the chance to upgrade, which would be valuable... > > - Logan >
-- Departement Informatik tel +41 (0)61 267 14 66 Universitaet Basel fax. +41 (0)61 267 14 61 Robert Frank Klingelbergstrasse 50 Robert.Frank@unibas.ch (NeXT,MIME mail ok) CH-4056 Basel (remove any no_spam_ from my return address) Switzerland [url]http://www.informatik.unibas.ch/personen/frank_r.html[/url ]




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
Joerg Schilling


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

In article <nsrhb.9746$X66.3506@twister.austin.rr.com>,
Logan Shaw  <lshaw-usenet@austin.rr.com> wrote:
quote:
>Pom wrote: > >That's really, really close to the largest file you can have that >uses 32-bit offsets: > > $ echo '2^31 - 2147481600' | bc -l > 2048 > $ > >I would say it's highly likely you're running into that issue. > >Unfortunately, you are running 2.5.1, which is something like 6 or 7 >years old. I can't recall whether it has support for 64-bit files
Large file support has ben aded with 2.6 If he cannot upgrade to a recent OS release, he should wait 'till monday and use star-1.5a30: star -cPM -dump -multivol tsize=2000m f=/ba/1.tar f=/ba/2.tar ... -C /export /home . ... == add enough file arguments so the sum will be > the size of the FS to backup. If you add also "new-volume-script=/bin/true", then there will be no "tape change" prompt. star-1.5a30 will add reliable multi-volume support with split files. star releases before 1.5a30 could be used in the same environment with: star -cPM -dump tsize=2000m f=/ba/1.tar f=/ba/2.tar ... -C /export/home . (no -multivol). Then the archive "n" will be terminated if the next file wwon't fit in the "tape size" and archive "n+1" will be used. The only problem with this method is that you cannot forsee how many f= parameters will be needed. -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) If you don't have iso-8859-1 schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily




[ Post a follow-up to this message ]



    Re: "tar" command has error messages.  
hymie!


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

In our last episode, the evil Dr. Lacto had captured our hero,
pom2001@my-deja.com (Pom), who said:
quote:
> Brad said: [QUOTE] [QUOTE] ># ls -l /backup/home.tar >-rw------- 1 root other 2147481600 Oct 10 10:56 /backup/home.tar
2 * 1024 * 1024 * 1024 2147483648 Break up your data into smaller chunks and tar them up separately. Also, I recommend against using absolute paths in tar. cd /export/home for i in * ; do tar cfv /backup/home$i.tar $i ; done hymie! http://www.smart.net/~hymowitz [email]hymie@lactose.smart.net[/ema il] ======================================== ==================================== ===




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:19 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register