Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Aug 2002 08:48:40 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jonas Fornander <jonas@netwood.net>
Cc:        "'freebsd-questions@FreeBSD.org'" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Dump questions
Message-ID:  <20020802074840.GB51805@happy-idiot-talk.infracaninophi>
In-Reply-To: <00ef01c239f2$f4333260$0800a8c0@master>
References:  <20020715221757.GB32811@happy-idiot-talk.infracaninophi> <00ef01c239f2$f4333260$0800a8c0@master>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 02, 2002 at 12:05:15AM -0700, Jonas Fornander wrote:
 
> If you dump a 50GB /usr file system that has only 2GB of files in it to
> a second drive, does the second drive need to be 50GB too or can dump to
> a 20GB drive?

That should work fine --- dump doesn't create huge images of empty
space, just the files, directories and metadata sufficient to recreate
the filesystem.
 
> Do I need to create directories on the second drive (i.e. dump_of_root,
> dump_of_home etc..) or does dump create those automatically?

It looks like you're trying to write out a dump archive as a file into
a second filesystem -- so the normal rules for output to files apply.
The path to the directory where you want to write your dump archive
must exist.

If what you're trying to do is replicate the filesystem to another
drive, then you need to pipe the output of dump(1) into restore(1).  I
wrote quite a long piece about doing that in
http://www.freebsd.org/cgi/getmsg.cgi?fetch=3471062+3475577+/usr/local/www/db/text/2002/freebsd-questions/20020630.freebsd-questions

> When I try to dump / to a second drive, I get the following error:
> #dump -0u -f /dev/ad2s1e /
>   DUMP: Date of this level 0 dump: Thu Aug  1 23:48:19 2002
>   DUMP: Date of last level 0 dump: the epoch
>   DUMP: Dumping /dev/ad0s1a (/) to /dev/ad2s1e
>   DUMP: mapping (Pass I) [regular files]
>   DUMP: mapping (Pass II) [directories]
>   DUMP: estimated 61792 tape blocks on 1.59 tape(s).
>   DUMP: Cannot open output "/dev/ad2s1e".
>   DUMP: Do you want to retry the open?: ("yes" or "no") y
>   DUMP: Cannot open output "/dev/ad2s1e". 
> 
> I get the same error if I try to dump into a folder:
> dump -0u -f /dev/ad2s1e/dump_of_root /
> 
> Why can't dump write to the second drive?

You seem to be getting the source and destination mixed up in the dump
command.  The file you output the dump to is the argument immediately
following the '-f' flag: that should be a standard system filename in
your case.  (Other entries you may see commonly are '-' meaning write
to the standard output or '/dev/nrst0' or the like, meaning write to a
tape device.)  The last entry on the dump command line is the
filesystem to dump.  That can either be a directory from a mounted
file system, or the device file containing the filesystem you want to
dump.

In your case, you want to dump the root filesystem, which seems to be
living on /dev/ad0s1a, onto a partition on your ad2 drive.  Which
means you need to create a filesystem on /dev/ad2s1e and mount it:

    newfs /dev/ad2s1e
    mount /mnt /dev/ad2s1e
    mkdir /mnt/dump_of_root
    dump -0u -f /mnt/dump_of_root/root.dump /
    umount /mnt

This creates a file 'root.dump' containing an image of your root
filesystem.  Note that this sequence of commands will destroy anything
previously existing on the /dev/ad2s1e partition.  If you want to keep
a regular series of backups on your other drive, omit the 'newfs'
step, and label your output files by date:

    dump -0u -f /mnt/dump_of_root/root-`date +%Y%m%d`.dump /

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
Tel: +44 1628 476614                                  Marlow
Fax: +44 0870 0522645                                 Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020802074840.GB51805>