Solved

Booting custom kernel from USB (flash drive)

Posted on 2008-06-16
7
743 Views
Last Modified: 2013-11-22
I'm trying to create a dual boot boot flash drive. The system supports booting from USB. I'm using a 2GB drive. No problem partitioning the USB into two equal 1GB slices and mounting at /mnt, Seem to be having a problem doing the installworld and getting it on the USB.

What I'm try to do is:
1) have a two bootable versions of Freebsd on a 2GB USB flash drive
2) Each bootable version is a custom kernel
3) As an extra bonus I'd like to use ZFS exclusively for the hard disk (e.g. boots from USB, and /usr, /home, etc. on the hard disk)

I've seen various fragments scattered around the net but so far I'm not having any luck. Any suggestions?
0
Comment
Question by:1gtx
  • 3
  • 3
7 Comments
 
LVL 10

Expert Comment

by:srgilani
ID: 21828275
you want to use two different version or two different kernels ?
0
 

Author Comment

by:1gtx
ID: 21828559
Two separate kernels.

One kernel is the normal booting kernel for that machine. The second kernel is for updates. In other words any new kernel is built and placed on the second slice.

When ready to update, system is rebooted using new updated kernel (second slice). Now original kernel (slice one) becomes the backup. If something goes wrong or the newly built slice/kernel is defective, you can rollback to the the original kernel/slice with just a reboot using the the original slice.

Makes updates to a large number of duplicate computers fast and easy. No CPU cycles used doing make world etc. For updates select slice, reboot--Fast.

That's the idea anyway.

Any ideas?
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 21842537
You cannot boot from two slices, you need two slices (aka DOS partitions) and disklabel-ed partitions inside
http://wiki.freebsd.org/ZFSOnRoot

It is not Cisco, you can create filesystem snapshot and rollback using UFS.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:1gtx
ID: 21852599
Actually you can boot from two slices, just not at the same time. That's the idea. One slice is active and the other is inactive. When upgrading the kernel you update the inactive kernel and then change it to be the active slice and the original slice becomes the inactive slice:

e.g. boot0cfg -s 2 da0 vs. the normal boot0cfg -s 1 da0

The ZFSOnRoot approach (using partition a of a slice on a usb and then booting the zfs for the harddrive with a small clone of the same slice mounted at the beginning of the zfs drive) is an interesting approach. I'm looking it over to see if it can be used as a framework for solving part of my problem.

Zfs is definitely useful for the rollback feature, but does not appear to give the same advantages as the multiple slice usb boot.

I appreciate the link. It has some unique ideas that I may be able to use.

Any other suggestions?
0
 
LVL 62

Expert Comment

by:gheist
ID: 21853077
I am pretty sure that ZFS has no improvements over UFS that exhibit on 1GB flash filesystem.

BootMgr is able to select active partition at boot from keyboard.
0
 

Author Comment

by:1gtx
ID: 21889645
You are correct on both counts.

Unfortunately I don't seem to be able to communicate what I'm trying to accomplish so I guess that this question will go unanswered.

I appreciate the attempts to help.
0
 
LVL 62

Expert Comment

by:gheist
ID: 21891928
BootMgr is FreeBSD's boot selector. Easiest to install from sysinstall. If you have two (ZFS, UFS) partitions that can be alternated at boot time your setup quite resembles cisco's flash construct and lets you alternate to old system in case update fails.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having issues meeting security compliance criteria because of those pesky USB drives? Then I can help you! This article will explain how to disable USB Mass Storage devices in Windows Server 2008 R2.
Lets start to have a small explanation what is VAAI(vStorage API for Array Integration ) and what are the benefits using it. VAAI is an API framework in VMware that enable some Storage tasks. It first presented in ESXi 4.1, but only after 5.x sup…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question