Re: SPAM: Re: ZFS root, error 2 when mounting root

2013-02-26 Thread Chad M Stewart

I've been down this road recently with 9.1-release.  I ended up adding these 
lines to end of my script


## The next two are hacks in my book, without the last line, on reboot
## it gets stuck trying to find zfs:zroot/ROOT, but somehow the -f or reboot 
fixes
# this quirk
zpool export zroot
zpool import -f zroot
reboot

Without the altroot it replaces the live CD mounts, and basically renders the 
system pointless, except that it works on reboot.  :)   I tried all sorts of 
other ways to make it work, mounting zroot and specifying a cache file, then cp 
the file over, etc., nothing I did worked except the above.  There is probably 
a cleaner/better way but I was not able to find it.


-Chad
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: SPAM: Re: ZFS root, error 2 when mounting root

2013-02-26 Thread bw.mail.lists

On 02/26/2013 04:31 PM, Chad M Stewart wrote:


I've been down this road recently with 9.1-release.  I ended up adding these 
lines to end of my script


## The next two are hacks in my book, without the last line, on reboot
## it gets stuck trying to find zfs:zroot/ROOT, but somehow the -f or reboot 
fixes
# this quirk
zpool export zroot
zpool import -f zroot
reboot

Without the altroot it replaces the live CD mounts, and basically renders the 
system pointless, except that it works on reboot.  :)   I tried all sorts of 
other ways to make it work, mounting zroot and specifying a cache file, then cp 
the file over, etc., nothing I did worked except the above.  There is probably 
a cleaner/better way but I was not able to find it.



I seem to remember trying that too, forced import, but after an 
unsuccessful reboot, not at the end of the script. It didn't work for 
me. Anyway, thanks for the answers, it's a bit more clear now.


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


Re: SPAM: Re: ZFS root, error 2 when mounting root

2013-02-25 Thread dweimer

On 02/25/2013 10:00 am, bw wrote:


That was my understanding, too, but the instructions on the wiki say 
there's no need to copy the cache file. In fact, there is no cache 
file to copy, since the pool is created with


zpool create -o altroot=/mnt -O canmount=off zroot mirror 
/dev/gpt/g0zfs /dev/gpt/g1zfs


No cache file. The wiki article was changed recently to eliminate 
that part, the message on the wiki is: Fix so that the default 
instructions does not install data directly to the zroot pool. 
Simplify instructions regarding cache files, they are no longer 
needed. Fixes and cleanups.


Either the instructions are wrong, or something in my script is. I 
assume it's my script.


	The instructions noted above are now INCORRECT for 9.0 (I have not 
tried this with 9.1 yet) as you MUST manually put the zpool.cache file 
in place for it to work correctly (I tried a couple different 
variations when I first setup my systems a few months ago and learned 
this the hard way :-) I have *lost* of experience with ZFS under 
Solaris 10 but am relatively new (about a year) to FreeBSD.


I tried it on 9.1, failed to specify.


There is a change coming down through the stable or current channel, 
that doesn't require the zpool.cache file.  But I don't believe that it 
has made it's to any of the releases.  I haven't been able to track down 
the original message yet, but here is some of the relevant text from a 
reply on the freebsd-stable mailing list, the subject of the thread is 
[HEADSUP] zfs root pool mounting, if you chose to search for it on 
your own.



on 28/11/2012 20:35 Andriy Gapon said the following:


Recently some changes were made to how a root pool is opened for 
root filesystem
mounting.  Previously the root pool had to be present in 
zpool.cache.  Now it is

automatically discovered by probing available GEOM providers.
The new scheme is believed to be more flexible.  For example, it 
allows to prepare
a new root pool at one system, then export it and then boot from it 
on a new
system without doing any extra/magical steps with zpool.cache.  It 
could also be

convenient after zpool split and in some other situations.

The change was introduced via multiple commits, the latest relevant 
revision in
head is r243502.  The changes are partially MFC-ed, the remaining 
parts are

scheduled to be MFC-ed soon.


--
Thanks,
   Dean E. Weimer
   http://www.dweimer.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org