Tar error: Unexpected EOF in archive

前端 未结 5 1484
挽巷
挽巷 2021-02-13 01:49

I tar a directory full of JPEG images:

tar cvfz myarchive.tar.gz mydirectory

When I untar the archive:

tar xvfz myarchive.tar         


        
5条回答
  •  时光说笑
    2021-02-13 02:02

    Interesting. I have a few questions which may point out the problem.

    1/ Are you untarring on the same platform as you're tarring on? They may be different versions of tar (e.g., GNU and old-unix)? If they're different, can you untar on the same box you tarred on?

    2/ What happens when you simply gunzip myarchive.tar.gz? Does that work? Maybe your file is being corrupted/truncated. I'm assuming you would notice if the compression generated errors, yes?

    Based on the GNU tar source, it will only print that message if find_next_block() returns 0 prematurely which is usually caused by truncated archive.

提交回复
热议问题