FreeBSD/UNIX backups to DVD+RW

Ean Kingston ean at hedron.org
Fri Jun 17 14:55:29 GMT 2005


On June 17, 2005 10:34 am, James Riendeau wrote:
> What I was doing did work fine for me; I just couldn't add multiple dumps
> to the same disk.  It turns out this was the wrong way to do it.  I'm not
> sure how a 32K block size would help.  The -B4589840 I used tells dump that
> the 'tape' it will be writing to can hold 4589840 kb (4.37 Gs), the size of
> a standard dvd.
>
> Unfortunately, growisofs provides direct access to the DVD and dump does
> not use a ISO compliant file format, so growisofs cannot find the end of
> the last session (who knew? :).  I was told the way to do this properly is
> to dump a partition to a file in say /tmp/fullbackup/, gzip it, and repeat
> until I have all the partitions.  Then write /tmp/fullbackup to the dvd:
>
> (Note, I added -B10485760 to limit backups to 10 G's.  You have to give
> dump some -B value or it will attempt to write out a catalog of standard
> size tapes.  You should adjust this value to whatever meets your needs.)
>
> # dump -0 -uL -C16 -B10485760 -f /tmp/fullbackup/usr.dumpfull /usr
> # gzip /tmp/fullbackup/usr.dumpfull
> # dump -0 -uL -C16 -B10485760 -f /tmp/fullbackup/var.dumpfull /var
> # gzip /tmp/fullbackup/var.dumpfull
> # dump -0 -uL -C16 -B10485760 -f /tmp/fullbackup/home.dumpfull /home
> # gzip /tmp/fullbackup/home.dumpfull
> # dump -0 -uL -C16 -B10485760 -f /tmp/fullbackup/root.dumpfull /
> # gzip /tmp/fullbackup/root.dumpfull
> # growisofs -speed=4 -Z /dev/cd0 -J -R /tmp/fullbackup
>
> If you're pressed for space, you can do the above, but write each file to
> the dvd before removing the gzipped dump file and creating the next one.
> The first file would be written with the -Z (new session) option, then the
> rest with the -M (append) option instead.  If this still takes too much
> space, I suppose you could try to pipe the dump directly to gzip, but I
> couldn't figure out how.  If anybody knows, please reply.

dump  -0 -uL -C16 -B10485760 -f - $fs | gzip > $fs.dumpfull.gz

Of course, after you gzip the dump image, it should be smaller than it was so 
you can actually fiddle with the -B option to get the gzipped file as close 
to a full DVD as possible.

>
> To do a restore, I found the following works:
>
> - Recreate the partition (in my case this would involve playing with
> gmirror first in the event of catastrophic disk/system failure)
> - cd into the mounted partition (ex, cd /usr)
> - mount the backup dvd and restore:
>
> # cd /usr
> # mount -t cd9660 /dev/<your dvd drive> /cdrom
> # restore -rfv -P 'gunzip -c /cdrom/usrfullbackupfilename.gz'
>
> But don't take my word for it, you should always do a test restore (into
> /tmp if necessary if you haven't any blank hard drives handy) before a
> catastrophic event happens to make sure the process works smoothly.
>
> Thanks to all those who replied,
>
> - James Riendeau
>
> I'm posting this to the list for posterity's sake.  In case someone else
> has this problem, they will have full instructions at their disposal,
> provided they can find it.
>
> On 6/17/05 4:56 AM, "Wojciech Puchar" <wojtek at tensor.3miasto.net> wrote:
> >> I'm trying to setup backups to the DVD-RW drive on our new server before
> >> it goes into production.  I've got the DVD-RW drive working, and I
> >> figured out how to dump to it:
> >>
> >> # dvd+rw-format /dev/cd0
> >> # dump -0 -uL -C16 -B4589840 -P 'growisofs -speed=4 -Z
> >> /dev/cd0=/dev/fd/0' /usr
> >
> > with both DVD+RW and DVD-RW i was able to write DIRECTLY to /dev/ under
> > NetBSD if only blocks were 32k
> >
> > should be possible with FreeBSD too.
> >
> >> A test restore comes out clean:
> >>
> >> # restore -Nxvb /dev/cd0
> >>
> >> The problem is most of the partitions are tiny (< 1G) and I would like
> >> to fit more then one partition on each DVD.  I figured just passing -M
> >> (append data) instead of -Z (new session) would do it:
> >>
> >> # dump -0 -uL -C16 -a -P 'growisofs -speed=4 -M /dev/cd0=/dev/fd/0'
> >> /home
> >>
> >> But growisofs fails with :-( /dev/cd0 doesn't look like isofs..., and of
> >> course dump fails with "Broken pipe".
> >>
> >> Any clues to how to get this to work?  (Webpage link is sufficient if
> >> there is something out there.  I couldn't find one.)
> >>
> >> I'm fairly new to the FreeBSD/UNIX world, so please be gentle.
> >>
> >> Thanks,
> >>
> >> -james
> >>
> >>
> >>
> >> _______________________________________________
> >> freebsd-questions at freebsd.org mailing list
> >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> >> To unsubscribe, send any mail to
> >> "freebsd-questions-unsubscribe at freebsd.org"
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"

-- 
Ean Kingston

E-Mail: ean AT hedron DOT org
URL: http://www.hedron.org/
I am currently looking for work. If you need competent system/network 
administration please feel free to contact me directly.


More information about the freebsd-questions mailing list