d693 How to create a zpool.cache from livefs? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old May 22nd, 2009, 19:38
exscape exscape is offline
Junior Member
 
Join Date: May 2009
Location: Sweden
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create a zpool.cache from livefs?

I'm a bit stuck here. I'm trying to clone a computer to a VM. So, I booted from a LiveFS CD, partitioned/sliced the disk, copied the files using zfs send/recv and scp (for the UFS /boot). The kernel boots just fine, but it won't mount my ZFS root.
I get:

Code:
Trying to mount root from zfs:tank/root
Manual root filesystem specification:
<fstype>:<device> blah blah...
So, I tried
Code:
vfs.zfs.debug=1
and it turns out it's looking for the guid 203643... and/or ad0s1e (which is the case on the "real", cloned computer, I guess (and know for the slice)!), but finds da0s1d and 522839... which is the case on THIS one.
I then noticed/realized that I need to update /boot/zfs/zpool.cache. So I booted up the livefs, imported the pool (zpool import -R /alt tank) and exported it. No zpool.cache anywhere.
It seems that you MUST import it WITHOUT altroot (-R), but if I do that, the entire environment goes FUBAR when the CD / is shadowed by my ZFS root, and nothing works!

So, my question is: how am I supposed to create the file if I can't import the pool, and importing the pool is the only way?

Last edited by DutchDaemon; October 17th, 2011 at 10:46.
Reply With Quote
  #2  
Old May 22nd, 2009, 20:24
exscape exscape is offline
Junior Member
 
Join Date: May 2009
Location: Sweden
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I finally fixed this. Finally as in I've been at it constantly for like 2.5 hours. Ugh.
Anyway, this post led me on the right path. What I did was, something like:

Boot LiveFS, choose fixit mode
Code:
cd /mnt2/boot/kernel
kldload ./opensolaris.ko ; kldload ./zfs.ko
(I knew this far already, but then I did: )
Code:
zpool import -f -R /alt tank
zfs set mountpoint=none tank/root
mkdir /boot/zfs
zpool export tank; zpool import tank
export LD_LIBRARY_PATH=/mnt2/lib (I think?)
mkdir /myboot; mount /dev/da0s1a /myboot
cp /boot/zfs/zpool.cache /myboot/boot/zfs/
zfs unmount -a
zfs set mountpoint=/ tank/root
reboot
It took me a fair amount of tries until I managed to find that damn zpool.cache. I *think* it was being removed when I exported the pool, but I'm not sure.

Last edited by DutchDaemon; October 17th, 2011 at 10:46.
Reply With Quote
  #3  
Old October 17th, 2011, 10:27
Ximalas Ximalas is offline
Junior Member
 
Join Date: Oct 2011
Location: Gjøvik, Norway
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Configuring and installing ZFS from 9.x?

How would you accomplish this using the 9.0 CDs and DVDs? Gone are the MFS previously used by the CDs and DVDs, thus no place to temporary save the /boot/zfs/zpool.cache file prior to transferring it to your boot data set.

Until this minor setback is resolved, I guess you either need an existing system or you need to install from 8.2-RELEASE, prior to configuring your new zroot data pool and its associated file systems.
Reply With Quote
  #4  
Old October 17th, 2011, 12:40
gkontos's Avatar
gkontos gkontos is offline
Senior Member
 
Join Date: Dec 2009
Location: Polidendri, GR
Posts: 1,266
Thanks: 42
Thanked 218 Times in 164 Posts
Default

Quote:
Originally Posted by Ximalas View Post
How would you accomplish this using the 9.0 CDs and DVDs? Gone are the MFS previously used by the CDs and DVDs, thus no place to temporary save the /boot/zfs/zpool.cache file prior to transferring it to your boot data set.

Until this minor setback is resolved, I guess you either need an existing system or you need to install from 8.2-RELEASE, prior to configuring your new zroot data pool and its associated file systems.
You can do it using in a different method.
__________________
Powered by BareBSD
Reply With Quote
The Following User Says Thank You to gkontos For This Useful Post:
graudeejs (April 30th, 2012)
  #5  
Old October 18th, 2011, 10:04
Ximalas Ximalas is offline
Junior Member
 
Join Date: Oct 2011
Location: Gjøvik, Norway
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by gkontos View Post
You can do it using in a different method.
Thank you, I did another Google search and the link you posted came up.
Here's my write up from yesterday.
Reply With Quote
Reply

Tags
livefs, zfs, zfs root, zpool, zpool.cache

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting old kernel and zpool.cache terminus Installing & Upgrading 3 May 25th, 2011 04:59
zpool cache on CF fails nsayer Installing & Upgrading 5 December 2nd, 2010 00:21
[Solved] zpool create <pool> drives fails ServerStorm General 9 August 25th, 2010 01:01
Adding a new raidz to zpool does not give zfs create more space audunfr Installing & Upgrading 0 April 19th, 2009 12:39


All times are GMT +1. The time now is 20:11.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0