Solved

Booting custom kernel from USB (flash drive)

Posted on 2008-06-16
7
746 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

763 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