From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 25 12:36:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0367216A410 for ; Mon, 25 Feb 2008 12:36:25 +0000 (UTC) (envelope-from martin.laabs@mailbox.tu-dresden.de) Received: from mailout1.zih.tu-dresden.de (mailout1.zih.tu-dresden.de [141.30.67.72]) by mx1.freebsd.org (Postfix) with ESMTP id BCCBB13C46B for ; Mon, 25 Feb 2008 12:36:24 +0000 (UTC) (envelope-from martin.laabs@mailbox.tu-dresden.de) Received: from rmc67-31.zih.tu-dresden.de ([141.30.67.31] helo=server-n) by mailout1.zih.tu-dresden.de with esmtp (Exim 4.63) (envelope-from ) id 1JTcZ8-0005qu-Uz for freebsd-hackers@freebsd.org; Mon, 25 Feb 2008 13:36:23 +0100 Received: from martin (p5B0EF940.dip.t-dialin.net [91.14.249.64]) by server-n (Postfix) with ESMTP id 80565100A091 for ; Mon, 25 Feb 2008 13:36:18 +0100 (CET) Date: Mon, 25 Feb 2008 13:36:17 +0100 To: freebsd-hackers@freebsd.org From: "Martin Laabs" Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Message-ID: User-Agent: Opera Mail/9.25 (Linux) X-TUD-Virus-Scanned: mailout1.zih.tu-dresden.de Subject: emulate an end-of-media X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 12:36:25 -0000 Hi, I'll write a script that back up my data on dvd-r and dvd-rams. (And some incremental backups also at some internet storage services.) Therefore I'd like to use dump. It is not too hard to create dump-volumes with fixed size through the -B option. But now I'd like to use some sort of compression. (bzip2 seems far to be to slow. Maybe I'll use gzip or compress) However - with compression I can't use the -B switch of dump because I can't be sure about the compression ratio. This means I have to use the '-a' switch. With that switch enabled, dump starts a new volume after it detects an EOM signal. Because dump itself does not support compression I have to build a pipe like that: dump -aL0 -f - /MYFILESYSTEM|compress -c|aespipe ...|cdrecord dev=3D... = - This obvisouly does not work. I tried to wrote a script that close the pipe after the amount of compressed data reached 4.6GB. But if I close the pipe in that script dump aborts (because of the broken pipe) at all instead of just starting a new volume. What I'd need is a magaic pipe device that converts a ordenary close at the one side to an EOM at the other. Then I could do something like this: dump -aL0 -f /dev/MyMagicDevice & dd if=3D/dev/MyMagicDevice bs=3D1M count=3D4600|./compress -c|cdrecord d= ev=3D... - Before I try to write a kernel module that will do the job (I never wrote a freebsd kernel module before but I think it is some fun to learn that.) I want to ask if anyone see another solution for that problem. (Maybe patching dump - but I don't want to fudge in the CORE source.) Thank you in advance, Martin L. PS: Splitting up the huge (maybe compressed) dump file (also in stream operation) is not a good idea beacause I'd need to insert all the media - even if I resore only a single file.