multi tape option in tar cmd

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat multi tape option in tar cmd
# 1  
Old 10-20-2011
multi tape option in tar cmd

Dear experts,

I have to take back up of 1.8TB data in single cmd. I have tape which has the capasity of 600 GB. Hence i want to use multiple tapes to take the backup using tar cmd.

Kindly help.

-Anand
# 2  
Old 10-20-2011
Hi,
Unfortunately tar does not support splitting of archive.
You have to do this by hand, using split (man 1 split)

Code:
split -b600GB in out.

This produces volumes of 600GB.
Notice that with "GB" we mean decimal GB (10^9), while -b600G would mean binary GB (GiB, 2^30).

Alternatively:
Code:
split -n3 in out.

Chops file to three pieces.

Then, at restore, join them with:
Code:
cat out.*>restored

ps: Never used a tape. I assume that with backup software you can put the out.aa out.ab etc each of them to one tape. Don't try to untar them while chopped!!
# 3  
Old 10-20-2011
If your version of tar can read from stdin, you can do something like this to avoid storing hundreds upon hundreds of gigabytes of temporary files:

Code:
# create tapes
mkfifo tarfifo
tar -vcf tarfifo /path/to/files &
PID=$!
N=0
while [ -d /proc/${PID} ]
do
        printf "Insert tape and hit enter " >&2
        read < /dev/tty # Read from terminal, not tarfifo
        dd of=/dev/tape bs=<tape_blocksize> count=<tape_blocks>
        eject_tape
        N=`expr $N + 1`
done <tarfifo

Code:
# extract tapes
mkfifo tarfifo
N=0
while [ -z "$INPUT" ]
do
        dd if=/dev/tape bs=<tape_blocksize> count=<tape_blocks>

        eject_tape

        # Print to stderr, so we don't feed this message into tar!
        printf "Insert tape and hit enter " >&2
        read INPUT
        N=`expr $N + 1`
done | tar -C /path/to/dest/ -xvf -

You could test this with local files instead of tapes by replacing /dev/tape with /path/to/file$N and using a small blocksize and blockcount.

Last edited by Corona688; 10-20-2011 at 11:40 AM..
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 10-20-2011
Haven't thought of using dd to tell the truth.
But that's really tough to understand.

Can I propose
Code:
dd if=bigfile of=/dev/tape bs=600GB count=1 skip=0

and increase skip by one each iteration...

While restore:

Code:
dd if=/dev/tape of=restore bs=600GB count=1 seek=0

and increase seek by one

Of course instead of bs=600GB you can simply bs=1MB but then seek or skip will be by n*600000
This User Gave Thanks to galanom For This Post:
# 5  
Old 10-20-2011
You only get to do bs=...G if you have GNU dd.

Advertised tape sizes are very often inflated. We don't know his tapes actually are 600GB, i.e. whether that means real gigabytes or drivemaker's gigabytes, uncompressed or with theoretical max compression, etc. The only way to be sure of that is to use the capacity in blocks as defined by the manufacturer.

Blocks versus bytes is grade-school math, 1024 bytes is two 512-byte blocks...
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 10-20-2011
Quote:
Originally Posted by Corona688
You only get to do bs=...G if you have GNU dd.

Advertised tape sizes are very often inflated. We don't know his tapes actually are 600GB, i.e. whether that means real gigabytes or drivemaker's gigabytes, uncompressed or with theoretical max compression, etc. The only way to be sure of that is to use the capacity in blocks as defined by the manufacturer.

Blocks versus bytes is grade-school math, 1024 bytes is two 512-byte blocks...
You are correct. I googled it and it's SDLT II 300GB real (2:1).
And of course it's drivemakers GB Smilie Only RAM chips is "real"
# 7  
Old 10-20-2011
Hard drives, cdroms, dvd's, and other media still come in units of powers of two -- they have to talk to computers, they could scarcely be anything else! They have sector sizes of 512, 2048, or 4096 bytes, not 500, 2000, and 4000. They're just advertised in powers of ten to make the number bigger.

I dread the days when they figure out how to make arbitrary sizes of RAM. They've already done it for flash media, somehow. Then RAM'll start shrinking too, no doubt.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with tar cmd for directories

Hi, I'm working on HP-UX B.11.23 64bit. I tried to tar couple of directories but failed to do so. $ tar -cvf tar_file_name -C /dir1 /dir2 the -C is for directories as mentioned in the man pages. But still unable to create a tar file having directories and sub-directories. Requesting help in... (1 Reply)
Discussion started by: sam_bd
1 Replies

2. UNIX for Dummies Questions & Answers

cmd find: exclude directory when using option -depth

hello, i want to use "-depth" in command "find" and want to exclude a directory. the find command should work in HP-UX and Linux. i see in the find man page: -prune If -depth is not given, true; do not descend the current directory. If -depth is given, false; no effect. -depth... (3 Replies)
Discussion started by: bora99
3 Replies

3. UNIX for Advanced & Expert Users

Multi-Volume tar archives. [solved]

Hi, The only off-line storage medium I have is DVD. I am trying to back up around 10G of data and if I can achieve a practical solution I will use it more generally. I am currently considering something along the lines of: tar --create --multi-volume --tape-length=nnnn <pathspec> |... (0 Replies)
Discussion started by: MikeGM
0 Replies

4. Red Hat

Multi OS option

Hi, We will purchase redhat enterprise WS. We want to use Windows and Redhat in same machine. For this purpose , should we buy Redhat with Multi OS option? Or Is it just for virtualization..? (I couldnt be sure) Regards... (3 Replies)
Discussion started by: titanic
3 Replies

5. Shell Programming and Scripting

tar cmd how many arguments into parameters of filenames

Hi I would like to use tar cmd in my script. I have a variable with filenames, e.g. 1000 records and I would like to paste its values into tar cmd. For this example I used three elements variable strings. strings="file1.txt file2.txt file3.txt" `tar cf file1.tar $strings` Whether... (1 Reply)
Discussion started by: presul
1 Replies

6. Shell Programming and Scripting

tar: unable to specify archive name with -p option

Hi, When I use -p option(preserve permissions) while creating tar archives, it throws error and creates archive in the name of 'p'. But without -p option I am able to create archive name as I mentioned. how do I work it out with --preserve-permissions? Any help is much appreciated. ... (3 Replies)
Discussion started by: learn more
3 Replies

7. UNIX for Dummies Questions & Answers

Is there nobody who's sucessfully used tar -G option???

Has anyone you know ever used the -G --incremental option successfully with the tar command? I'm not talking about the little -g --listed-incremental option. I don't want incremental backups. Just one differential backup which is what the -G is for. The -G command is supposed to make a single... (1 Reply)
Discussion started by: protienplant
1 Replies

8. UNIX for Advanced & Expert Users

Does tar do crc checking on a tape or tar file?

Trying to answer a question about whether tar table-of-contents is a good tool for verifying tape data. (1 Reply)
Discussion started by: tjlst15
1 Replies

9. UNIX for Dummies Questions & Answers

tar command with compress option...

Hi ! i have to write a script that archivs homes not used since 3 years. First, my script gathers the users that are concerned, using the following command : ll -lt /home/*/.sh_history | egrep '2000|1999|1998|1997' | awk '{print $3}' i obtain a list like this : user_1 user_2 ...... (3 Replies)
Discussion started by: tomapam
3 Replies

10. UNIX for Dummies Questions & Answers

tar to tape and back

Howdy, I'm trying to tar some directories to tape and then extract them from tape on another machine. I was hoping someone could help me with the syntax of the tar commands. Both machines are running Solaris 8. Need to get all files and directories under the following: ... (6 Replies)
Discussion started by: pmetal
6 Replies
Login or Register to Ask a Question