Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2000 07:36:12 -0500 (CDT)
From:      Mike Meyer <mwm@mired.org>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        questions@freebsd.org
Subject:   Re: ghost prog for FreeBSD?
Message-ID:  <14780.53692.512374.948114@guru.mired.org>
In-Reply-To: <99864729@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Giorgos Keramidas writes:
> On Sat, Sep 09, 2000 at 06:28:07PM -0400, bentley wrote:
> > is there a Ghost Program for imaging a hard drive to another
> > machine or disk?
> [-- copying disks the freebsd way --]

Appendix: Alternative method.

> What I usually do, when I have to transfer an installation of BSD to
> another disk / partition is:
> 
> 1. Create the slices / labels on the second disk.
> 2. Mount them under /mnt.
> 3. Use cpio(1) to copy the files from / to /mnt.
> 4. Use boot0cfg on the new disk to set up the boot loader on it.
> 5. Reboot into the new installation.

Actually, this does quite a bit more than ghost does. Ghost backs up
partitions, not systems.

I would also call this the sysv way, not the freebsd way. cpio was an
AT&T tool that gnu copied. Historically, bsd didn't come with cpio,
but used tar for that functionality. Generally, I copy each file
system in a distinct step, because I normally deal with systems that
have multiple disks. The steps are:

1. Create the slices / labels on the second disk. (unchanged)
2. For each old partition:
    A. Mount the new one on /mnt.
    B. (cd /<top>; tar -lcf - .) | (cd /mnt; tar xf -)
    C. Unmount it.
3. Use boot0cfg on the new disk to set up the boot loader on it.
3. Reboot into the new installation.

> because find(1) might descend /mnt too, and recursively copy all the
> files in there many times.  Another directory structure that need not be
> copied is /proc, so the command I use to copy an installation to /mnt is
> usually:

The process with tar avoids all such problems by copying each file
system separately - the "l" option keeps it on one file system. If you
want to take that approach with find/cpio, you can use the "x" option
on find to keep it on one file systems.

> You might also find it useful to pass --preserve-modification-time
> option to the --extract invocation of cpio.

That's the "p" option to the second tar:

	(cd /old; tar cf - .) | (cd /new; tar xpf -)

> As you can see, there is no Ghost program in FreeBSD, but there is a
> very nice and relatively easy way to copy an installation of FreeBSD to
> some other disk.

As you can see, the problem with Unix (as opposed to alternative
operating systems) is not finding how something is done, but choosing
the most appropriate method from those available.

	<mike



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?14780.53692.512374.948114>