# boot2 issue with "/" on partition other than "a"



## Nezmer (Mar 30, 2010)

Hi,

Installing bootstrap via bsdlabel will default to "0:ad(0,a)/boot/kernel/kernel". You can override this with "/boot.config" but that would only work If "/" is on partition "a" of the slice.

What If "/" is not on partition "a" and I don't want to hardcode values in /boot/boot2 binary?


----------



## jalla (Mar 30, 2010)

I've done this in the past, but my memory of this is scetchy. I think you would do something like this at the boot prompt

```
boot: 0:ad(0,d)/boot/loader
```

At the loader prompt `set currdev=disk0s1d` and `boot`
Check out boot(8) and loader(8) for more details.


----------



## Nezmer (Mar 30, 2010)

jalla said:
			
		

> I've done this in the past, but my memory of this is scetchy. I think you would do something like this at the boot prompt
> 
> ```
> boot: 0:ad(0,d)/boot/loader
> ...



Thank you for replying.

I already know how to get in(from the boot prompt). My question is how to save for next boots.

I just looked at loader man. If I understand correctly, currdev will be used by loader so It wouldn't help here.


----------



## aragon (Mar 31, 2010)

Nezmer said:
			
		

> I just looked at loader man. If I understand correctly, currdev will be used by loader so It wouldn't help here.


Are you saying you've added that to /boot/loader.conf and it didn't work?  It ought to...


----------



## Nezmer (Mar 31, 2010)

aragon said:
			
		

> Are you saying you've added that to /boot/loader.conf and it didn't work?  It ought to...



How is loader.conf going to be read If I can't go to the loader in the 1st place?

I have no issues when I type manually [CMD="Boot:"]0:ad(1,b)/boot/loader[/CMD] . As the loader will start and I can proceed from there. The question is, how to save that value? If / was on partition a then using /boot.config will do. But how to do this If / is not on partition a ?


----------



## jalla (Mar 31, 2010)

Nezmer said:
			
		

> How is loader.conf going to be read If I can't go to the loader in the 1st place?
> 
> I have no issues when I type manually [CMD="Boot:"]0:ad(1,b)/boot/loader[/CMD] . As the loader will start and I can proceed from there. The question is, how to save that value? If / was on partition a then using /boot.config will do. But how to do this If / is not on partition a ?



According to boot.config(5) you can't



> When the FreeBSD boot loader runs, it searches the ``a'' slice of the
> boot partition for a boot.config file (as a result, slices which are
> missing an ``a'' partition require user intervention during the boot
> process).


----------



## Nezmer (Mar 31, 2010)

jalla said:
			
		

> According to boot.config(5) you can't



That's what I thought. 

I wanted to use swap on ad<n>s1a (to shorten seek times). But I just found out that bsdlabel doesn't care about the order of the letters when It comes to offset(cool).

Thank you for all the feedback.


----------



## hermes (Mar 31, 2010)

Are you absolutely sure that writing

```
0:ad(1,b)/boot/loader
```
into /boot.config (on the Â»aÂ« partition!) will not work? I have a similar setup working (although with GPT partitions), and Iâ€™m not only booting off a different slice, but off a different disk.


----------



## Nezmer (Mar 31, 2010)

hermes said:
			
		

> Are you absolutely sure that writing
> 
> ```
> 0:ad(1,b)/boot/loader
> ...



You keep files in swap ?


----------

