原帖:http://linux.m2osw.com/tar-record-size-blocks
http://archives.linuxfromscratch.org/mail-archives/lfs-support/2009-November/036933.html
The tar utility has changed over time and older versions would generate what is viewed as incompatible files. Although most tar utilities will still support older version (before 1988), the may generate this one warning:
tar: Record size = 8 blocks
I tried, a couple times, to create tar files and they worked just fine but I would get this warning... This is rather annoying so I looked in a way to avoid the warning. Why do you think we get it?
The answer is in the newest versions of POSIX the block size of a tar file was decided to be 10Kb. Internally, the block sizes are still 512 bytes, but when you generate a tar file, you must make sure that the final file is a multiple of 10Kb or you get this warning.
The warning is safe for disk files, however, it lets you know that your tar file may not be compatible with all tape drives available, so of which may even require larger blocks (i.e. 20Kb, 32Kb, etc.)
So... all you have to do is add a bunch of zeroes at the end of the file. If you file system is setup to have sparse files, it shouldn't be wasting any space on your hard drive. Although, you should keep the tarball compressed with gzip or bz2. That way the zeroes more or less disappear.
The only harm this will cause is that perl's testsuite will fail because of this warning, and in order to stop that warning from appearing on disks, we can backport that patch to 1.22, or just wait till 1.23.
本文解释了tar文件生成过程中出现的“Record size=8 blocks”警告的原因,并提供了解决方案。这种警告源于新版本POSIX标准中规定的tar文件块大小为10KB,而非旧版的默认设置。文章建议通过在文件末尾添加零来确保文件大小为10KB的倍数,以消除警告。
2916

被折叠的 条评论
为什么被折叠?



