dump, tar or pax?

Jerry McAllister jerrymc at clunix.cl.msu.edu
Sat Sep 27 06:52:41 PDT 2003


> 
> Up 'till now I used dump/restore to make a backup of my system.
> Someone pointed out to me however that this was not the wisest thing to
> do, given the fact that is is a level-0 dump so it needs to be restored
> onto a clean (newfs) filesystem.

Somebody is confused or confusing you.
The man page is also misleading on this.

You can restore a level 0 dump anywhere - preferably an empty
directory.    Just go where there is room.  
  - do a mkdir
  - cd in to the new directory
  - do restore -xf restore_device  where restore_device is wherever
                                    you will read your level 0 dump from.
  - answer no when it asks to set ownership of ..

Or you can selectively restore any individual file directory
or group of files or directories from a leval 0 dump.  
   - cd to the base of the filesystem that was dumped
        such as 'cd /usr' for a /usr dump
   - do  restore ivf restore_device
   - cd around to find the files and/or directories you want to restore
   - type add file_name for each file or directory you want restored
     NOTE:  restores of directories are recursive and get the directory
            and all its contents
   - Answer appropriately when it asks which tape to start on - 
            probably 1   Although with multiple tape sets it can be 
                         faster to start with the last tape in the set
    
It is only if you are trying to recreate a whole file system that you
should create a new file system and newfs it before doing the restore.

So, dump/restore is generally the best way to do backups and
restores.   Other utilities have quirks.

The only problem with dump is that it must act on a whole file system.
So, if you want to copy only one directory or a few files on to some
media to transfer somewhere, then tar can be more useful.   But, once
the dump has been made, you can restore any combination of files
and directories anywhere from that dump.  No problem.

The only other reason to resort to tar is if you are going from
one OS to another.   In many cases dump/restore gets picky going
from one OS to another - and I don't mean FreeBSD 3.4 to FreeBSD 4.8.
That works fine.  I mean from SunOS to AIX or something like that.   
Tar seems more forgiving in those circumstances.

> 
> ## dump -h0 -0f - /usr | ssh host "cat > /usr3/pooh/fbsd-usr.dump" 

I generally use dd instead of cat, but essentially right.

////jerry

> 
> I always thought having this backup was safe. Just make a minimal
> install of FreeBSD ans restore the backup would be fine.
> As I understand now, this is not the case, because the filesystem has to
> be new for a restore (level-0) to work.
> 
> I'm told that instead of the dump/restore option it's better to use TAR
> with a rule like:
> 
> ## tar cvzfl - /usr | ssh host cat > destination
> 
> I understand that there will be problems with named pipes and device
> nodes that are handled correctly by dump/restore and not by tar.
> This should not be a problem, I'm told. Is this true?

A good reason to stick with dump/restore.

> 
> Is dump/restore for a level-0 (system backup) not the wisest thing to
> use and should I really consider using TAR? Is the calling argument
> above the right one? Or should I use PAX? If so, with which options?

No, stick with dump/restore.

////jerry

> 
> -- 
> dick -- http://www.nagual.st/ -- PGP/GnuPG key: F86289CE
> ++ Running FreeBSD 4.8 ++ Debian GNU/Linux (Woody)
> + Nai tiruvantel ar vayuvantel i Valar tielyanna nu vilja
> _______________________________________________
> 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"
> 



More information about the freebsd-questions mailing list