Professional Web Applications Themes

"tar" command has error messages. - Sun Solaris

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....

  1. #1

    Default "tar" command has error messages.

    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.
    Pom Guest

  2. #2

    Default Re: "tar" command has error messages.

    In comp.unix.solaris Pom <com> wrote: 

    Hi! Binky!
     

    Show us:

    du -ks /export/home
    df -k

    -am © 2003
    Anthony Guest

  3. #3

    Default Re: "tar" command has error messages.


    "Pom" <com> wrote in message
    news:google.com... 

    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



    Brad Guest

  4. #4

    Default Re: "tar" command has error messages.

    > Show us: 

    # 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.
    Pom Guest

  5. #5

    Default Re: "tar" command has error messages.

    > While I don't recall the exact error messages out of 2.5.1 tar I would 

    # 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.
    Pom Guest

  6. #6

    Default Re: "tar" command has error messages.

    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

    Logan Guest

  7. #7

    Default Re: "tar" command has error messages.

    Logan Shaw 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:[/ref]


    2.5.1 is not largefile aware. 2.6 was where that appeared.

    Kelly

    Kelly Guest

  8. #8

    Default Re: "tar" command has error messages.

    Pom wrote:
     

    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.

    Centurion Guest

  9. #9

    Default Re: "tar" command has error messages.

    Centurion wrote: 

    Wasn't someone pointing out here on comp.unix.solaris a few weeks
    ago that older versions of gzip had problems with streams greater
    than 2 GB, even if its input and output are both pipes?

    I seem to recall that it was the type of bug where it would
    work sometimes, and sometimes would not, which sound exactly
    like the type of bug I would NOT want to encounter when
    doing backups. :-)

    - Logan

    Logan Guest

  10. #10

    Default Re: "tar" command has error messages.

    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 <rr.com> 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
    >[/ref]

    --
    Departement Informatik tel +41 (0)61 267 14 66
    Universitaet Basel fax. +41 (0)61 267 14 61
    Robert Frank
    Klingelbergstrasse 50 ch (NeXT,MIME mail ok)
    CH-4056 Basel (remove any no_spam_ from my return address)
    Switzerland http://www.informatik.unibas.ch/personen/frank_r.html
    Robert.Frank@unibas.ch Guest

  11. #11

    Default Re: "tar" command has error messages.

    In article <nsrhb.9746$austin.rr.com>,
    Logan Shaw <rr.com> 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[/ref]

    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:isdn.cs.tu-berlin.de (home) Jrg Schilling D-13353 Berlin
    tu-berlin.de (uni) If you don't have iso-8859-1
    fraunhofer.de (work) chars I am J"org Schilling
    URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
    Joerg Guest

  12. #12

    Default Re: "tar" command has error messages.

    At Fri, 10 Oct 2003 07:58:02 GMT, Logan Shaw writes:
     

    Yes, they do, but gzip didn't come standard with Solaris 2.5.1, so
    he'll have to install his own gzip anyway, and he might as well
    install gzip 1.3.5 rather than install an older, buggier gzip.
    Paul Guest

  13. Moderated Post

    Default Re: "tar" command has error messages.

    Removed by Administrator
    Lon Guest
    Moderated Post

Similar Threads

  1. photomerge "command" error
    By Beth Haney in forum Adobe Photoshop Elements
    Replies: 4
    Last Post: April 19th, 04:41 PM
  2. Error "Command Import is not current available"
    By Daniel_Resende@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 0
    Last Post: April 14th, 12:58 PM
  3. Source code for "syslog()" and "open" command shell
    By Alain in forum Mac Programming
    Replies: 3
    Last Post: January 2nd, 03:03 AM
  4. "tar" command has error messages.
    By Pom in forum Linux / Unix Administration
    Replies: 10
    Last Post: October 14th, 02:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139