how to mark a slice bootable using command line

jonas jonas at schiebtsich.net
Mon Apr 25 08:49:46 PDT 2005


I'm still stuck with this.. C'mon folks, there must be someone who knows how 
to do sysinstalls 'Set Bootable' command using command line.

It all comes down to:
I got four slices containing a FreeBSD installation. I can only boot the 
first. Hitting F2, F3 or F4 in the bootmanager gives me a beep, nothing more. 
If I run sysinstall, choose Configure, Fdisk, da0, hit the 'S' key (Set 
Bootable) once for every slice and write those "Changes" I can boot into any 
of those installations.

Now I have read the man pages for fdisk and bsdlabel a couple of times, still 
I cannot figure out how to set this bootable flag using those tools (not that 
I didn't try all kinds of things like writing bootstrap code, setting active 
partitions, etc...). There must be a way to do this without sysinstall!?

Sadly my knowledge in C is more than limited... I can see that sysinstall does 
'chunk_info[current_chunk]->flags |= CHUNK_ACTIVE;' when I hit the S key but 
that's about it.

Any pointer would be very much appreciated.

Thanks in advance, first mail follows,

On Friday 22 April 2005 19:04, jonas wrote:
> 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