Active slice, only for a next boot

Warner Losh imp at bsdimp.com
Fri May 27 18:40:52 UTC 2011


On May 27, 2011, at 11:21 AM, Chris Rees wrote:

> On 27 May 2011 17:47, <rank1seeker at gmail.com> wrote:
>> 
>> ----- Original Message -----
>> From: Alexander Best <arundel at freebsd.org>
>> To: rank1seeker at gmail.com
>> Cc: hackers at freebsd.org
>> Date: Fri, 27 May 2011 13:47:54 +0000
>> Subject: Re: Active slice, only for a next boot
>> 
>>> On Fri May 27 11, rank1seeker at gmail.com wrote:
>>>> Idea is ...
>>>> I have i.e; 3 slices, of which first is active.
>>>> Now I wana set slice 2 active, but only for a one/next boot.
>>>> Once slice 2 is booted and system is shutdown or rebooted, once again,
>> first slice is active and booted, without user's intervention.
>>>> 
>>>> Is this possible or should be implemented?
>>> 
>>> take a look at the gpart(8) manual, expecially the ATTRIBUTES section.
> if
>> you
>>> are running with a GPT scheme you can use the "bootonce" attribute to do
>>> exactly what you asked for.
>>> 
>>> cheers.
>>> alex
>>> 
>> 
>> Thanls, but I need it for MBR.
>> 
>> Domagoj S.
> 
> MBR has only a one-bit wide field for active status. You'll need logic in
> the first boot to change the flag, perhaps an fdisk statement.

I should have said

You can create scripts that keeps state in /, or unconditionally switches back.  gpart works with mbr partitions, but it would have to be cooperative with the thing booted...

Warner


More information about the freebsd-hackers mailing list