Many small edits.
1 parent 066e960 commit 3dd12eae337bdbad6829968169619b30a47e7b97
@tundra tundra authored on 17 Mar 2008
Showing 1 changed file
View
82
Imaging-FreeBSD-With-tbku.txt
(re)provision machines. The general idea here is to take advantage of
the tools already present on the FreeBSD installation CD. However,
instead of actually installing an operating system, we'll just use the
paritioning and disk labeling tools to prepare the target disk to
receive our FreeBSD image. Then, we'll jump into the "Fixit" shell
receive our FreeBSD image. Then, we'll jump into the ``Fixit`` shell
and actually do the restore from there.
 
Provisioning Machines With A Master Image
 
1. Boot the FreeBSD installation disk.
 
2. Now we have to prepare the disk to receive a FreeBSD
filesystem::
2. Prepare the disk to receive a FreeBSD filesystem::
 
Custom
 
Partition
 
Partition as desired
 
Select the partition that will boot
S - To make it bootable)
S - To make it bootable
 
Quit
 
Select the boot manager you want
ready to be loaded, by doing this::
 
mount
 
You see your newly created filesystems mounted under
``/mnt``. Now, we need to create the top level
directories that are typically not backed up in
an image (some of these may already be present)::
You should see your newly created filesystems mounted under
``/mnt``. Now, we need to create the top level directories
that are typically not backed up in an image (some of these
may already be present)::
 
cd /mnt
mkdir cdrom dev dist proc tmp
 
the drive in and take a look at ``/var/log/messages`` where
you are informed that the drive has been recognized as
``/dev/da1``. So, you try this::
 
mount -t msdosfs /devda1s1 /mnt/mnt
mount -t msdosfs /dev/da1s1 /mnt/mnt
 
Oops ... the ``Fixit`` shell complains - it doesn't know how
to mount filesystems of type ``msdosfs`` because the
necessary file ``/sbin/mount_msdosfs`` file is not present
in the ``Fixit`` operating environment.
 
Fortunately, there's a very simple way to work around this.
The CD from which you booted is itself mounted under
``dist``. That CD has a more-or-less full "live" FreeBSD
system on it, that *does* have the files you need there.
In this case, the "fix" is to do something like this::
``/dist``. That CD has a more-or-less full "live" FreeBSD
system on it, that *does* have the files you need there. In
this case, the "fix" is to do something like this::
 
mkdir -p /sbin # Make sure the directory exists in Fixit
cp -pv /dist/sbin/mount_msdosfs /sbin
 
 
cd /mnt # This is the logical root of our disk
tar -xzvf mnt/my-fine-image.tar.gz
 
When untarring is complete, unmount your newly
imaged drive, exit the ``Fixit`` shell, and then
exit the FreeBSD installation menus to reboot the
system.
4. Finally, we need to make sure that our newly imaged
filesystems will be mounted properly at boot time. This is
controlled by the contents of: ``/mnt/etc/fstab`` Suppose,
after we image the drive, that file looks like this::
 
/dev/ad4s1b none swap sw 0 0
/dev/ad4s1a / ufs rw 1 1
/dev/ad4s1d /var ufs rw 2 2
/dev/ad4s1e /usr ufs rw 2 2
/dev/acd0 /cdrom cd9660 ro,noauto 0 0
 
This would indicate the image was taken from a system with
FreeBSD installed on the first SATA drive. Now, lets
assume we're going to use the same partitioning, but our
newly imaged drive is the first *SCSI* drive on the system.
``/mnt/etc/fstab`` needs to be edited to look like this::
 
/dev/da0s1b none swap sw 0 0
/dev/da0s1a / ufs rw 1 1
/dev/da0s1d /var ufs rw 2 2
/dev/da0s1e /usr ufs rw 2 2
/dev/acd0 /cdrom cd9660 ro,noauto 0 0
 
It may also be necessary to edit the ``/mnt/etc/rc.conf``
file to adjust IP address assignments or other system
configuration parameters.
 
 
We're DONE! Well ... maybe. If the environment or hardware of your
target machine is similar/same as the machine from which you took the
original image OR if the kernel you plan to boot has support for your
disseminate this document without charge, so long as you do so without
modifying it in any way.
 
 
$Id: Imaging-FreeBSD-With-tbku.txt,v 1.104 2008/03/17 21:36:04 tundra Exp $
$Id: Imaging-FreeBSD-With-tbku.txt,v 1.105 2008/03/17 22:12:28 tundra Exp $