Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-17 Thread Eugene Grosbein
On 15.09.2015 16:31, Stefano Garzarella wrote:
> Hi all,
> I created a nanoBSD image for my gsoc project (ptnetmap on bhyve).
> 
> I would like to boot this image on USB stick or in the hypervisor as a HD.
> I have some problem because if I set NANO_DRIVE="da0" (for USB boot)
> in the nanoBSD configuration file, the boot from USB stick works well,
> but when I try to boot the same image in the hypervisor as a HD,
> I have the following mountroot error:
> 
> Trying to mount root from ufs:/dev/da0s1a [ro]...
> mountroot: waiting for device /dev/da0s1a ...
> Mounting from ufs:/dev/da0s1a failed with error 19.
> 
> Loader variables:
>vfs.root.mountfrom=ufs:/dev/da0s1a
>vfs.root.mountfrom.options=ro
> 
> mountroot>
> 
> 
> At this point I need to manually specify "ufs:/dev/ad0s1a" to properly mount
> the root.
> 
> Can you help me?
> There is some tricks to avoid this mountroot error?

Just make special image for hypervisor using NANO_DRIVE="ad0"

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-17 Thread Stefano Garzarella
Thanks to all!
as NGie says, I used the labeling through NANO_LABEL and it works very
well!

Now in the /etc/fstab I have the label and not the disk specific partition!

Maybe is better to set default label in the nanobsd.sh and not the driver
in according to NGie.

Cheers,
Stefano


Il giorno mer 16 set 2015 alle 04:26 NGie Cooper  ha
scritto:

> On Tue, Sep 15, 2015 at 7:18 PM, Ryan Stone  wrote:
> > On Tue, Sep 15, 2015 at 9:53 PM, Julian Elischer 
> wrote:
> >
> >> one possibility is to use  gpart label to describe the device.
> >> possibly it woudl hav ehte same result in both cases, but I don't know
> for
> >> sure that
> >> it works for root device.. you'd have to test.
> >>
> >>
> > I would recommend a UFS label instead.  gpart labels are kind of fragile
> > and easy to mess up.  My previous employer has been shipping systems
> where
> > the root fs is specified in fstab via a UFS label for years and it never
> > gave us a problems.
>
> +100
>
> And FWIW as Stefano discovered later, NANO_LABEL does just that (use
> UFS labels).
>
> The only unfortunate thing is that nanobsd uses a NUL string by default:
>
> grep NANO_LABEL tools/tools/nanobsd/defaults.sh
> tools/tools/nanobsd/defaults.sh:NANO_LABEL=""
> tools/tools/nanobsd/defaults.sh:   echo newfs ${NANO_NEWFS}
> ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev}
> tools/tools/nanobsd/defaults.sh:   newfs ${NANO_NEWFS}
> ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev}
> tools/tools/nanobsd/defaults.sh:   if [ ! -z ${NANO_LABEL} ];
> then
> tools/tools/nanobsd/defaults.sh:   tunefs -L
> ${NANO_LABEL}"s2a" /dev/${MD}s2a
> tools/tools/nanobsd/defaults.sh:   # Override user's NANO_DRIVE if
> they specified a NANO_LABEL
> tools/tools/nanobsd/defaults.sh:   [ ! -z "${NANO_LABEL}" ] &&
> NANO_DRIVE="ufs/${NANO_LABEL}"
>
> The default NANO_DRIVE is useless though -- the old ata(4) stack is dead:
>
>  95 # The drive name of the media at runtime
>  96 NANO_DRIVE=ad0
>
> Cheers,
> -NGie
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-15 Thread NGie Cooper
On Tue, Sep 15, 2015 at 7:18 PM, Ryan Stone  wrote:
> On Tue, Sep 15, 2015 at 9:53 PM, Julian Elischer  wrote:
>
>> one possibility is to use  gpart label to describe the device.
>> possibly it woudl hav ehte same result in both cases, but I don't know for
>> sure that
>> it works for root device.. you'd have to test.
>>
>>
> I would recommend a UFS label instead.  gpart labels are kind of fragile
> and easy to mess up.  My previous employer has been shipping systems where
> the root fs is specified in fstab via a UFS label for years and it never
> gave us a problems.

+100

And FWIW as Stefano discovered later, NANO_LABEL does just that (use
UFS labels).

The only unfortunate thing is that nanobsd uses a NUL string by default:

grep NANO_LABEL tools/tools/nanobsd/defaults.sh
tools/tools/nanobsd/defaults.sh:NANO_LABEL=""
tools/tools/nanobsd/defaults.sh:   echo newfs ${NANO_NEWFS}
${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev}
tools/tools/nanobsd/defaults.sh:   newfs ${NANO_NEWFS}
${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev}
tools/tools/nanobsd/defaults.sh:   if [ ! -z ${NANO_LABEL} ]; then
tools/tools/nanobsd/defaults.sh:   tunefs -L
${NANO_LABEL}"s2a" /dev/${MD}s2a
tools/tools/nanobsd/defaults.sh:   # Override user's NANO_DRIVE if
they specified a NANO_LABEL
tools/tools/nanobsd/defaults.sh:   [ ! -z "${NANO_LABEL}" ] &&
NANO_DRIVE="ufs/${NANO_LABEL}"

The default NANO_DRIVE is useless though -- the old ata(4) stack is dead:

 95 # The drive name of the media at runtime
 96 NANO_DRIVE=ad0

Cheers,
-NGie
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-15 Thread Ryan Stone
On Tue, Sep 15, 2015 at 9:53 PM, Julian Elischer  wrote:

> one possibility is to use  gpart label to describe the device.
> possibly it woudl hav ehte same result in both cases, but I don't know for
> sure that
> it works for root device.. you'd have to test.
>
>
I would recommend a UFS label instead.  gpart labels are kind of fragile
and easy to mess up.  My previous employer has been shipping systems where
the root fs is specified in fstab via a UFS label for years and it never
gave us a problems.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-15 Thread Julian Elischer

On 9/15/15 5:31 PM, Stefano Garzarella wrote:

Hi all,
I created a nanoBSD image for my gsoc project (ptnetmap on bhyve).

I would like to boot this image on USB stick or in the hypervisor as a HD.
I have some problem because if I set NANO_DRIVE="da0" (for USB boot)
in the nanoBSD configuration file, the boot from USB stick works well,
but when I try to boot the same image in the hypervisor as a HD,
I have the following mountroot error:


you have to override vfs.root.mountfrom in the hypervisor's loader
bhyveload. otherwise it looks at /etc/fstab in the root filesystem,
and you can't have it work both ways..

one possibility is to use  gpart label to describe the device.
possibly it woudl hav ehte same result in both cases, but I don't know 
for sure that

it works for root device.. you'd have to test.



Trying to mount root from ufs:/dev/da0s1a [ro]...
mountroot: waiting for device /dev/da0s1a ...
Mounting from ufs:/dev/da0s1a failed with error 19.

Loader variables:
vfs.root.mountfrom=ufs:/dev/da0s1a
vfs.root.mountfrom.options=ro

mountroot>


At this point I need to manually specify "ufs:/dev/ad0s1a" to properly mount
the root.

Can you help me?
There is some tricks to avoid this mountroot error?

Thanks,
Stefano Garzarella
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"



___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-15 Thread Stefano Garzarella
Hi Oliver,
Thank you very much!
I solved it setting NANO_LABEL="mylabel".

Cheers,
Stefano

Il giorno mar 15 set 2015 alle 12:05 O. Hartmann <
ohart...@zedat.fu-berlin.de> ha scritto:

> On Tue, 15 Sep 2015 11:31:36 +0200
> Stefano Garzarella  wrote:
>
> > Hi all,
> > I created a nanoBSD image for my gsoc project (ptnetmap on bhyve).
> >
> > I would like to boot this image on USB stick or in the hypervisor as a
> HD.
> > I have some problem because if I set NANO_DRIVE="da0" (for USB boot)
> > in the nanoBSD configuration file, the boot from USB stick works well,
> > but when I try to boot the same image in the hypervisor as a HD,
> > I have the following mountroot error:
> >
> > Trying to mount root from ufs:/dev/da0s1a [ro]...
> > mountroot: waiting for device /dev/da0s1a ...
> > Mounting from ufs:/dev/da0s1a failed with error 19.
> >
> > Loader variables:
> >vfs.root.mountfrom=ufs:/dev/da0s1a
> >vfs.root.mountfrom.options=ro
> >
> > mountroot>
> >
> >
> > At this point I need to manually specify "ufs:/dev/ad0s1a" to properly
> mount
> > the root.
> >
> > Can you help me?
> > There is some tricks to avoid this mountroot error?
> >
> > Thanks,
> > Stefano Garzarella
> > ___
> > freebsd-current@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "
> freebsd-current-unsubscr...@freebsd.org"
>
>
> Check your /etc/fstab. I guess the device for "/" is still /dev/da0s1a. I
> had
> to patch the nanoBSD scripts to target that issue and booting from UEFI
> systems,
> but my solution is not very transparent.
>
> Using labels would be more convenient and would be much more GPT/UEFI
> friendly.
>
> regards,
>
> Oliver
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: nanoBSD boot problem (on USB stick or as a HD)

2015-09-15 Thread O. Hartmann
On Tue, 15 Sep 2015 11:31:36 +0200
Stefano Garzarella  wrote:

> Hi all,
> I created a nanoBSD image for my gsoc project (ptnetmap on bhyve).
> 
> I would like to boot this image on USB stick or in the hypervisor as a HD.
> I have some problem because if I set NANO_DRIVE="da0" (for USB boot)
> in the nanoBSD configuration file, the boot from USB stick works well,
> but when I try to boot the same image in the hypervisor as a HD,
> I have the following mountroot error:
> 
> Trying to mount root from ufs:/dev/da0s1a [ro]...
> mountroot: waiting for device /dev/da0s1a ...
> Mounting from ufs:/dev/da0s1a failed with error 19.
> 
> Loader variables:
>vfs.root.mountfrom=ufs:/dev/da0s1a
>vfs.root.mountfrom.options=ro
> 
> mountroot>
> 
> 
> At this point I need to manually specify "ufs:/dev/ad0s1a" to properly mount
> the root.
> 
> Can you help me?
> There is some tricks to avoid this mountroot error?
> 
> Thanks,
> Stefano Garzarella
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Check your /etc/fstab. I guess the device for "/" is still /dev/da0s1a. I had
to patch the nanoBSD scripts to target that issue and booting from UEFI systems,
but my solution is not very transparent.

Using labels would be more convenient and would be much more GPT/UEFI friendly.

regards,

Oliver
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


nanoBSD boot problem (on USB stick or as a HD)

2015-09-15 Thread Stefano Garzarella
Hi all,
I created a nanoBSD image for my gsoc project (ptnetmap on bhyve).

I would like to boot this image on USB stick or in the hypervisor as a HD.
I have some problem because if I set NANO_DRIVE="da0" (for USB boot)
in the nanoBSD configuration file, the boot from USB stick works well,
but when I try to boot the same image in the hypervisor as a HD,
I have the following mountroot error:

Trying to mount root from ufs:/dev/da0s1a [ro]...
mountroot: waiting for device /dev/da0s1a ...
Mounting from ufs:/dev/da0s1a failed with error 19.

Loader variables:
   vfs.root.mountfrom=ufs:/dev/da0s1a
   vfs.root.mountfrom.options=ro

mountroot>


At this point I need to manually specify "ufs:/dev/ad0s1a" to properly mount
the root.

Can you help me?
There is some tricks to avoid this mountroot error?

Thanks,
Stefano Garzarella
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"