Ghost for FreeBSD

James C. Durham durham at jcdurham.com
Sat Aug 30 11:15:52 PDT 2003


On Saturday 30 August 2003 01:02 pm, Stefan Malte Schumacher wrote:
> Hi
>
> Well, just like the subject says I am for a program or a backup approach
> simillar to the one I am currently using. I boot with a Dos-Bootdisk and
> use Ghost to backup my Linux-Partitions to a FAT-Partition and then
> distribute the images around different computers on the network. I would
> like to be able to something like this with FreeBSD. I have had a look at
> Ghost 4 Unix but this is mainly oriented towards deploying images via the
> network while I just want to store the files locally. The advantage of
> Ghost and Ghost4Unix is that is is very easy to restore the system even if
> it so messed up that it wont boot. How can I do this ?
>
>

If you use the tools you have on FreeBSD already installed , you can do most 
of what you want. 

For an image backup, you can use 'dd'.

To back up the whole drive, which is better because you don't have
to recreate partitons when you restore, just use the device name of the entire 
drive, which in this example we'll call ad0 .

Let's say you have a machine called 'server1' with lots of disk space at 
/usr/backups out on your network somewhere.

dd if=/dev/ad0 bs=16384  | ssh server1 "cat > /usr/backups/ad0_backup" 

In this example, dd outputs to standard out because you didn't tell it 
otherwise and inputs from /dev/ad0  and that is piped to ssh, which fires up 
'cat' on server1 and sends the file to it's local disk as ad0_backup.

I usually use block size 16384, but you can vary this and pick what works best 
for you.

To restore the file, you need a working system with ssh and a new drive 
connected. I use drive trays that you can get for 6 dollars US on the 'net so 
I can connect a new drive easily. (I have an old P90 system that I use for 
stuff like this with 3 drive trays).

So, let's say you put the drive on a working system with ssh and it is 
discovered by FreeBSD as ad2. The drive has to be the same size as the 
original (or larger, but that's a waste with dd). 

ssh server1 "cat /usr/backups/ad0_backup" |  dd of=/dev/ad2 bs=16384

Now, move the new drive to the failed system as ad0 and boot it.

You can also use tar and ssh to move a partition to a larger drive.

cd /usr
tar czf - . | ssh server1 "cat > /usr/backups/usr.tar"

To restore, you need to create a same-size or larger partition on a new drive 
and mount it, let's say on /mnt..

cd /mnt
ssh server1 "cat /usr/backups/usr.tar" | tar xzf - 


-Jim








More information about the freebsd-questions mailing list