dump/restore don't work, handbook lies

Jerry McAllister jerrymc at msu.edu
Tue Sep 2 17:04:06 UTC 2008


On Sun, Aug 31, 2008 at 05:03:53PM -0600, Lloyd M Caldwell wrote:

> Hello,
> 
> this all on a 7.0 freebsd system.

There are a couple of things missing here.   You may have done them
and just not mentioned them, but...

> Dump/Restore do NOT work as indicated in the handbook (or man pages). It 
> would be better to remove information from the handbook rather then have 
> information that doesn't work.

I have used dump/restore hundreds or thousands of times, and
it works just as described although sometimes the media (tape
other disk, whatever) fails.  But that is a separate issue.
Dump was still working.

> I needed to increase the size of my freebsd root (/).  I booted, single 
> user, attached a large usb freebsd formatted file system to receive the 
> backup image.  I ran:
> 
>    dump -0af /mnt/d201gly-0.dump /

Did you mount the large USB file system to /mnt?
   mount /dev/-whatever_the_device_name /mnt
Otherwise it wrote the dump to /mnt on the old disk which you wiped.

> it ran with no complaints and an image was left on the large usb file 
> system (d201gly-0.dump).

OK.  Probably must have done the mount (maybe)
doing a df -k would have told you if /mnt had the USB mounted on it.

Did you really look at and verify that image?

Before rebooting and starting up the cdrom and fixit, do a
  mkdir /junk
  cd /junk
  restore -ivf /mnt/d201gly-0.dump  
and use it to look around and maybe even restore a file or two in
that scratch directory /junk (or any name you prefer) to make sure 
it is really there.    I always check dumps I must depend on because
tape media and occasionally others can be very unreliable - especially
DDS (DAT) and I have had to use a lot of that in the past.   So, it
has become a regular habit.   Checking it with one or two files is
no absolute guarantee that the whole dump is readable, but it sure
reveals the ones where I screwed up while making the dump and if the
whole media is bad.

> 
> I then booted off the livefs cdrom, went to the "Fix-it" from livefs.
> 
> I ran fdisk to setup a pc partition for freebsd owning the entire disk.

I presume you mean that you created a single FreeBSD slice on the disk.
Something like:

         fdisk -BI da0

> I ran disklabel to setup and define the swap and 'a' root partition.
> I ran disklabel to install boot blocks.

That is backwards of what I usually do.
I usually do the bsdlabel that writes a new label and put
on a boot block first - as in:

         bsdlabel -w -B da0s1

And then edit the label using bsdlabel to create the 'a' partition.

         bsdlabel -e da0s1

And edit it (with vi or whatever editor you have specified, I use vi)) so 
it has everything in an 'a' partition.   That usually consists of 
copying the 'c' line and changing the partition name ('c' to 'a') and
making it a '4.2BSD type instead of 'unused'

> I ran newfs on this new 'a' partition.

This should be straightforward.   Just:

         newfs /dev/da0s1a

Note, of course, if the disk is SATA or IDE, it is ad0 instead of da0.

> I ran fsck and mount on the new 'a' partition placing it at /mnt/root.
> I turned on the large usb drive, fsck'ed it and mounted it on /mnt/restore.

> I cd into /mnt/root and run:
> 
>    restore -rf /mnt/restore/d201gly-0.dump
> 

This looks all right if you got the mounts right.

> it complains about '/' issues
> it complains about 'expecting YYYYYY got ZZZZZZ'

This is common and normally inconsequential on a dump of a live
file system - and a dump of root from a running system, even in
single user is a live filesystem.   It just means that something
changed from the time the dump directory was created and the
actual files were written out.

> after an hour it completes and NO data file were restored.  It did 
> recreate the directory structure but NOT A SINGLE FILE came back.  I've 
> studied the man pages and have no clue how to rectify this.  after 
> re-reading the handbook on backup basics, I'm sure that anyone using 
> them will loose everything.  They are simply useless.  take them offline.
> 
> This is not something a user can "practice", as most (I) don't have 
> duplicate hardware of everything to try dump/restore methods and find 
> out they don't work.
> 
> what went wrong?  how do i get my system back?

The most likely thing is getting the mounts wrong somewhere along
the line.  

Try looking at that dump file on the USB unit using  'restore -vf'
Use the fixit and see what is really on it.    Go beyond the
directory index and try to restore a file or two.

eg, boot the fixit, make some space to write - maybe using /tmp
    cd in to that space
    mount that USB device/filesystem
    do  restore -vf USB_FILE_SYSTEM      (whatever the dive name is)
    cd all over and pick a couple of small files to restore.
    If stuff is there, you should be able to restore -rf if the
      mounts are right.
    If not, then you will need to use another backup - you do  
      make regular backups, of course.

> 
> lmc at xmission.com
> 
> I've been running freebsd since 2.1 and am beginning to see that unix 
> and freebsd are at the end of their life.  they are just tooo arcane for 
> day-to-day use, which was why i  used them in the last place.  all the 
> gui glue won't fix the broken 'flag' ridden ancient (like me) beast.

Most people find the direct command line operation to be an
major advantage over the gui - can't do anything unless the gui
writer thought of it first trap.

Yup, I started with FreeBSD 2.1 as well and, as I mentioned above, I have 
used dump/restore hundreds, maybe thousands of times to rebuild disks, 
recover losses and build installs that were done for many machines and 
the only problem I have ever had that could be called a failure was when 
media went bad.  I have made occasional mistakes such as mis-mounting
something, but that was always caught because I use a reasonable amount 
of double checking of my work, knowing that I am capable of making mistakes.

> 
> this is like the 5th thing that I've followed in the handbook that no 
> longer works, takes weeks to figure out why and get done.  things that 
> should take minutes take hours, weeks, days, months, years.  we have 
> made NO progress in computing environments. it's so discouraging that 
> there is zero innovation in an industry that had such high expectations 
> and potential.

You have had a unique series of experiences and possibly are discovering 
an area in which you might choose not to endeavor, but might want, instead 
to concentrate on other activities and consign to a person or some persons
who are more in tune with the nature of the field, these activities, thus
maintaining the happy condition in which individuals are able to work
at tasks that are more closely in line with their own propensities
and talents.
 
////jerry    
    
> 
> lmc at xmission.com
> _______________________________________________
> 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