The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Tar blockSize problem scriptingmani SUN Solaris 2 09-26-2007 01:10 AM
tar: blocksize = 0 - Error message? Tlogine UNIX for Dummies Questions & Answers 3 08-11-2007 03:32 PM
tar: blocksize melanie_pfefer UNIX for Dummies Questions & Answers 0 07-17-2007 04:43 AM
tar: tape blocksize error big123456 UNIX for Advanced & Expert Users 1 03-26-2007 03:57 AM
Tar: tape blocksize error ramkumar UNIX for Advanced & Expert Users 1 08-09-2005 09:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2006
Registered User
 

Join Date: May 2003
Posts: 28
How to change blocksize for in tar command

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.
Reply With Quote
Forum Sponsor
  #2  
Old 10-11-2006
Registered User
 

Join Date: Oct 2006
Posts: 13
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
Reply With Quote
  #3  
Old 10-11-2006
Registered User
 

Join Date: May 2003
Posts: 28
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.
Reply With Quote
  #4  
Old 10-11-2006
Registered User
 

Join Date: May 2003
Posts: 28
The blocksize shows 4, but we need set it to 20.
How can we do that?
Reply With Quote
  #5  
Old 10-11-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 401
It might depend on which tar you're using.

Linux/tar:
Code:
tar -c -b 20 -f test.tar -v backup.sh
OpenBSD/tar:
Code:
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
Reply With Quote
  #6  
Old 10-11-2006
Registered User
 

Join Date: May 2003
Posts: 28
Smile

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?
Reply With Quote
  #7  
Old 10-11-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 401
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0