Solved

Booting custom kernel from USB (flash drive)

Posted on 2008-06-16
7
736 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 61

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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 61

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 61

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Solid State Drive Performance Tips: Solid state storage technology is now a standard.  After testing and using several different brands and revisions of SSD's over the years I have put together a collection of tips,tools and suggestions that I ha…
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…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now