On 12/07/2015 10:08 AM, Avi Deitcher wrote:
Hey Nahum,
Thanks for jumping in again to help. Below...
This is imprecise. It needs to find its "zones" ZFS pool. Unless
explicitly instructed otherwise SmartOS imports all ZFS pools it
can find. It does this via the mechanism implemented by "zpool
import".
1. How does it go about finding the zpools? Does it scan all disks?
All partitions? The first hard disk?
"zpool import", see below.
2. "unless explicitly instructed otherwise": how do I control that
process? (and, yes, once I understand it, happy to write up another
wiki page....)
Kernel command line, see below.
If it can't find the "zones" pool it will run the setup script
unless you've booted in a way that indicated that you don't
want to (see the menu.lst file shipped on the ISO)
I will look at it. Not documented anywhere?
A quick perusal didn't turn up the code path I was looking for, I'm not
sure where it is without investing more time to find it.
Where can I find a clear step by step description of the boot
process from live media, so I can understand how it works and
where I can customize? E.g.
In the code? I'm not sure if there's a single place with the whole
boot process documented outside the codebase.
The process is pretty simple for the most part:
https://github.com/joyent/smartos-live/blob/master/overlay/generic/lib/svc/method/fs-joyent#L79-L180
Looking now. It looks like it looks for explicit list of zpools to
import on the command-line?
Yes.
If provided a list of zpools to import, import those with "zpool
import <poolname>", otherwise, run "zpool import" and then import
all found pools (again with "zpool import <poolname>". All
intelligence on scanning the disks for pools is delegated to the
ZFS tools.
This is really important to understand.
Sure. The short answer from the zpool man page is that under illumos
(and SmartOS) "zpool import" scans all devices under /dev/dsk to see if
they are part of a zpool or not. There will be device nodes in there for
both whole drives and for partitions.
Once it's done that, it mounts up the filesystems that store
critical configuration and finishes booting.
How does it know which to mount?
Let me clarify, it mounts up ZFS filesystems from within the "zones"
pool that store critical configuration.
The short answer is that it's mostly hard-coded.
When you import a ZFS pool, most filesystems get mounted automatically.
There are a few that SmartOS mounts differently, and the code that does
it is here:
https://github.com/joyent/smartos-live/blob/master/overlay/generic/lib/svc/method/fs-joyent#L124-L126
If you have a specific question about your use case, perhaps you
might want to ask that as well...
Heh, probably should. In my case, just continuing the previous grub2
question. Booting up on servers that have multiple disks and
partitions. Only some are configured for SmartOS, so need to ensure
that it loads in the right way.
I have a few suggestions:
1. Learn more about ZFS and get comfortable with ZFS pools and filesystems.
2. Boot your system in noinstall/rescue mode (replace "smartos=true"
with "standalone=true,noimport=true") and run "zpool import" just to see
what it returns.
3. If your system has other zpools you don't want SmartOS to touch, the
safest thing to do is change "smartos=true" to
"smartos=true,zpools=zones" so that you can be confident that SmartOS
won't touch your other zpools.
-Nahum
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com