How can I change the blocksize in tar command?
tar cvf test.tar backup.sh
a backup.sh 1K
If we need to set the blocksize to 20, how to do that?
Please advise.
Thank you.
How can I change the blocksize in tar command?
tar cvf test.tar backup.sh
a backup.sh 1K
If we need to set the blocksize to 20, how to do that?
Please advise.
Thank you.
man tar
to create archive
tar cvfb <filenm.tar> 20 <files to archive >
to check block size
tar tvf <filenm.tar>
OR
tar tvf <filenm.tar> 30
anybode please correct me if wrong
samsam
Hi,
Thanks for your quick response.
I managed to do the tar now. By the way, the blocksize show 4,
# tar cvfb test.tar 20 backup.sh
a backup.sh 1K
# tar tvf test.tar
tar: blocksize = 4
-rwxr-xr-x 0/1 76 Jul 20 16:21 2005 backup.sh
# tar tvf test.tar 30
tar: blocksize = 4
Please advise.
Thank you.
The blocksize shows 4, but we need set it to 20.
How can we do that?
It might depend on which tar you're using.
Linux/tar:
tar -c -b 20 -f test.tar -v backup.sh
OpenBSD/tar:
tar -c -b 20 -f test.tar -v backup.sh
By the way, the default (per the two man pages) is 20 blocks. POSIX max is 63 and max under OpenBSD is 126. The man page on linux doesn't show the maximums. I brought up info tar but it's pages and pages of stuff. Feel free to run that if you have a few minutes to spare 
Carl
In Tru64,
> tar cvfb test.tar 20 abc
a abc 0 Blocks
> tar tvf test.tar
blocksize = 20
-rw-r--r-- 0/15 0 Oct 12 11:19:14 2006 abc
In Solaris,
# ls -al abc
-rw-r--r-- 1 root other 0 Oct 12 11:20 abc
# tar cvfb test.tar 20 abc
a abc 0K
# tar tvf test.tar
tar: blocksize = 3
-rw-r--r-- 0/1 0 Oct 12 11:20 2006 abc
How can we get the blocksize in solaris to set as tru64 blockszie?
My sun box (solaris 8) I have here says (via man) that 20 is the default. I ran the same command you did but the test option doesn't show the blocking factor. I tried it with a blocking factor of 30 but it still didn't show it.
Carl
FTP the file from tru64, the one that can show the blocksize=20 to solaris and tar tvf filename. It can't show the blocksize as in tru64.
But the one that created in solaris, can... really don't know why 
We need to set 20 for the blocksize.. pls help.
Can anyone give me a solution?
Please help.
Thank you.
We use gtar command to overcome this problem. 
Does blocksize matter in tar?
Why do you wanna use the non-default?