| Home | About Emuadmin | Hosting | FAQ | Quote | Site Map | Contact | ||||||
![]() |
||||||
|
||||||
|
Working as a remote admin I've often met situations
The following steps require strong knowledge of your OS of choice
it is not intended to be a step by step tutorial. Prerequisites - the installed OS must have a bootloader that can boot from a tftp server - your OS of choice must have the ability to boot with a memory resident file system - you must have access to a tftp server - you must have access to a system with your OS of choice installed RedHat to FreeBSD The following steps are for a FreeBSD install over RedHat
default 1
timeout 10 title RedHat root (hd0,0) kernel /vmlinuz ro root=/dev/hda1 initrd /initrd.img savedefault
Consult grub's documentation for a proper configuration of your OS's boot
entry
- reboot- edit grub's config again and add the entry for tftp boot
default saved
- reboot againtimeout 10 title RedHat savedefault 2 root (hd0,0) kernel /vmlinuz ro root=/dev/hda1 initrd /initrd.img title TFTP BOOT savedefault 1 ifconfig --address=192.168.0.3 --server=192.168.0.1 --gateway=192.168.0.1 root (nd) kernel /tftpboot/kernel.gz - At this point your next reboot will boot using the TFTP BOOT entry, and in case of failure you will need an external reboot to boot it back using the installed OS
Booting the TFTP BOOT entry can be done without the alternative patch
and without the two extra reboots, the downside of this method is that you won't have a way to boot the installed OS in case of a failure 2. Compiling your kernel On a FreeBSD system compile a kernel with minimal options Be sure to include support for your network card Include the following options: options MFS options MD_ROOT options MD_ROOT_SIZE=34000 (this must be bigger or equal with the size of your root image) built your kernel:
cd /usr/src
For more information about building custom kernels on freebsdmake buildkernel KERNCONF=YOUR_CONFIG NO_MODULES=yes Please see the handbook and the related man pages http://www.FreeBSD.org 3. Create the root image - creating the new file system
dd if=/dev/zero of=rootfs bs=4k count=5k #(20MB, adjust the values to your
needs)
- install a minimal freebsd distribution in /mnt/rootfsvnconfig -s labels -c vn0 rootfs disklabel -r -w vn0 auto newfs vn0c mount /dev/vn0c /mnt/rootfs For tips & tricks : http://neon1.net/misc/minibsd.html - Be sure to include sshd - Configure the network with the details of the server where this is going to be used - Add yourself an account to be able to login with ssh and su to root 4. Insert the root image into kernel For this you can use the write_mfs_in_kernel program which comes with freebsd. You can find it at /usr/src/release/write_mfs_in_kernel.c
write_mfs_in_kernel kernel rootfs
Copy kernel.gz to your tftp servergzip kernel 5. Booting minibsd - Reboot the RedHat server which will boot the kernel from the tftp server If everything went ok you should be able to ssh to the old redhat server running now your minibsd. Once logged in you can format the harddisk and install freebsd using your preferred method. Enjoy. Emilian M. Ursu emu@emuadmin.com |