how to mark a slice bootable using command line

jonas jonas at schiebtsich.net
Fri Apr 22 10:04:47 PDT 2005


Hi again questions list,

I'm running into trouble installing a FreeBSD system from script using a 
custom FreeSBIE (sysutils/freesbie).

I'm using
`fdisk -f configfile /dev/da0`
to partition my da0 disk into four even-sized slices,
`boot0cfg -B /dev/da0`
to install the bootmanager to da0,
`disklabel -R /dev/da0s$c protofile`
to create partitions (which is called four times with $c being 1-4),
`newfs -O2 -U /dev/da0s$c$p`
to create filesystems (where $p is a, d and e - /tmp will be a memory disk, 
there is no -U for a)
and finally untar the OS onto the new filesystems.

Everything goes fine, except, I cannot boot from any slice other then the 
first (F1 entry in bootman). Any other choice will simply have the speaker 
beep. Obviously the slices are not marked bootable.

Now if I launch sysinstall and choose Configure, Fdisk, da0, I can set the 
bootable flag to those four slices. Obviously, in sysinstall this is somehow 
linked to being the active slice, since it shows an 'A' next to the slice and 
only one A can be set at a time.

So I tried to use `fdisk -a -2` to setting slice 2 bootable, without success.
Also tried to set the slice bootable by using the -B switch to disklabel, 
also, without success.

Furthermore I cannot figure out any difference to the output of fdisk and 
disklabel after using sysinstall, other than my slice of choice if now 
bootable.

So... how can I set this bootable flag by using command line tools like fdisk 
and disklabel without the need of user input. Sadly the handbook refers only 
to sysinstall...

Thanks in advance for any pointers,

-- 
br.
j.


More information about the freebsd-questions mailing list