cut up a big tar file
I need to know : How can cut up (fragment) a large tar file in the bset way (without data corruption) with my redhat 7.3 commands. For example I have a 3.2GB tar file and I want to cut up in 2 pieces smaller than
2GB and not equal size.thanks p.s I read for split(not supported by my OS),cat command but how can I? |
You can use the split program to do that. I imagine you will be saving the slices on an external drive with the fat32 file system. You can restore files from a split archive be cat'ing the pieces together and piping the output to the input of tar:
example: cat /media/usbdrive/archive.tar.* | tar xvf - /home/username/Documents/docfile.pdf |
you may be able to accomplish this with 'dd'.
myfile.tar == 688MB to break it, first part 400MB, second part remaining (288MB) Code:
dd if=myfile.tar of=myfile.tar.dd.1 bs=4096 count=102400 Code:
dd if=myfile.tar.dd.2 of=myfile.tar.dd.1 bs=4096 seek=102400 in my example (and test) it did Code:
sha1sum myfile.tar myfile-from-dd.tar you can look at the man page for more options and see what is happening but i think it may be do-able like this. You'll just want to take care not to lose or forget the values you used or it could get ugly... also, for bs= i used the filesystem block-size as reported by dumpe2fs for the partition i was working with the files on; not sure if it will actually matter or not but was used for consistency. hope this helps. |
Kinda weird that you don't have split, no?
In any case, I made a dd example like rayfordj, except I put the pieces back together with cat. I created a 200MB file using random data, then broke it into 50MB chunks. Code:
win32sux@candystore:/tmp$ dd if=/dev/urandom of=example.img bs=1024 count=200000 |
The split & dd commands are both supplied by the coreutils package. RH 7.3 is so old you might consider a fresh install of a newer distro. You are 10 major versions behind.
|
Quote:
|
All times are GMT -5. The time now is 09:46 PM. |