Handling large chunks of data spread across multiple files

7 views
Skip to first unread message

Maxim Vexler

unread,
May 11, 2006, 5:36:45 PM5/11/06
to bash...@googlegroups.com
To backup your hard drive onto DVDs use split(1),dd(1),gzip(1) just pipe them.

To restore you can use the following code, by Ehud Karni

(
FLAG=any
while [ $FLAG ]
do
cat /DVD-MOUNT-DIR/backup.img.gz.*
echo "Please put next DVD and press Y + Enter" > /dev/tty
echo "If there is none, press Enter only" > /dev/tty
read FLAG < /dev/tty
done
) | gunzip -c | dd of=/dev/hda1

You can do any other needed operation in the loop (like unmounting
and mounting the new DVD).

Ehud.


A rather less elegent but still workable solution by Amos Shapira :

. "mkfifo fifo"
2. do "cat fifo fifo fifo... | gzip...". repeat "fifo" on the cat
command line to the
number of input DVD's.
3. dd from the dvd's into "fifo", one at at time.

The repating of "fifo" is required because every time "dd" closes the fifo cat
gets an EOF. You overcome this by telling cat that its next file to read is
(tararam...): fifo.

.
EOF


--
Cheers,
Maxim Vexler

"Free as in Freedom" - Do u GNU ?

Reply all
Reply to author
Forward
0 new messages