Making a bootable backup (hard)disk... how?

Ronald F. Guilmette rfg at tristatelogic.com
Sun Jun 10 02:30:54 UTC 2012


In message <4FD38B9A.4010400 at qeng-ho.org>,
Arthur Chance <freebsd at qeng-ho.org> wrote:

>There's a BFI (brute force and ignorance) way of doing it in the base 
>system - dd. Provided your system disk is quiescent (ideally when 
>running from a live CD or all partitions mounted read-only, otherwise 
>pray to the deity of your choice) and the backup disk is a) at least as 
>large as the system disk, and b) has the same sector size, then a simple 
>dd from the system disk to the backup should work.

Thank you Arthur, and yes, trying to back up a partition that's currently
mounted r/w using dd will almost certainly not produce the desired results.

And of course, as you correctly note also, the target partition had best be
at least as big as the source (and perhaps even identical in size).

I don't care to take own my system to make backups... and don't believe
that I should have to do so, and thus, this is one of the reasons why I
would prefer to use something like cpio.

Also, I don't like backups taking longer than absolutely necessary, and
this is why I am specifically _not_ attracted to either the dd solution
or to dump/restore, because as I understand it, with either of these methods
you end up copying perhaps a metric buttload worth of unallocated free
disk space.  (I would prefer not to do that.  It just seems wasteful...
of time, if nothing else.)

Also, in one case, one of my partitions has one directory that contains
a really massive amount of stuff, and I specifically _don't_ need any of
that particular stuff (in that one directory) backed up.  So again, I'm
looking at tar or cpio or perhaps pax.  (Of course cpio is more full-featured
than tar, and I don't really know anything about pax, so that leaves me
with cpio.)

>[Greybeard war story:] Going back about 25-30 years, a friend of mine 
>was responsible for running the Unix systems in an EE department of a UK 
>university. He used to back up the disks (probably around 10 MB in those 
>days) to 1/2" tape every night. Eventually he got sick of undergraduates 
>asking him to restore files they'd accidentally deleted, and hit upon 
>the idea of dd'ing the disk to tape, and then if a student wanted a 
>restore, he'd mount the tape as a r/o file system (these were the days 
>of tape block devices and trusting all users) and tell them to use 
>restore to get the files themselves. It took forever, but it was the 
>student's time that was wasted, not his. Most of them learned not to 
>delete wanted files after one or two times of doing this.

My own greybeard story:  Back in the late 70s I was in college and had
just switched major to CS.  My college had a mainframe, but also a PDP-11
to which were connected a number of ASR-33s (Who could ever forget THOSE!)
Students who asked could get an account on the PDP-11/RSTS-E system.
I did, and started experimenting.

I remember one day I really pissed off the specific Computer Center
staff member who was assigned to the care & feeding of the RSTS-E system
when her backup tape started whizzing back and forth for no apparent
reason.  At least it seemed that way to her, since she had only just
mounted the tape and _she_ had not issued any console commands yet which
would have caused the tape drive to do anything.
:-)

Needless to say RSTS-E was, apparently, not quite as sophisticated at that
time as, say, UNIX, in terms of protecting physical I/O devices from general
Joe-Schmo users.

I never became friends with that specific Computer Center staff member,
but I did end up as the only CS undergraduate who got a job in the
campus Computer Center.

Sorry.  You talking about tapes just reminded of that incident, way back
when.  (Sigh.  The good old daze.... when men were men, and the bits ran
scared!)

Moral of the story is that sometimes it actually does pay to be a smartass.


Regards,
rfg


P.S.  It really is a Damn Shame[tm] that nobody ever hacked FreeBSD cpio
to make it be able to copy (a) the extra file flag/mode bits and/or (b)
file ACLs and/or (c) file attributes.

I guess I have found a new project for myself... when/if I ever find some
free time.


More information about the freebsd-questions mailing list