Discussion:
small point about mirroring rpool
Harry Putnam
2014-04-02 02:45:49 UTC
Permalink
There are numerous sites online explaining how to mirror rpool, but
after looking at a few I've noticed they all seem to have what appears
(to me) to be a common shortcomming.

In each case extraneous suffixes start to appear at the end of the
disk names with no explanation about where they come from.

They all tell you to use format to find the disk names but then
proceed names that are different than those shown with format.

At least the docs at openindiana wiki explain one of the suffixes
('p0').

(http://wiki.openindiana.org/oi/2.1+Post-installation)

So at the point we are shown how to streamline fdisking a partition
with:

pfexec fdisk -B c3t1d0p0 (p0 is the whole disk starting from
the MBR)
They explain where p0 came from

But then in the very next step where they start to tell you how to
label the disk suddenly the disc name has grown an 's2' on the end.

Now we set up an SMI label with same partitioning as disk 0 on disk 1.
# pfexec prtvtoc /dev/rdsk/c3t0d0s2 |
pfexec fmthard -s - /dev/rdsk/c3t1d0s2

No mention at all where s2 comes from, certainly not from looking at
the output of format.

Next step has the discs growing yet a different suffix (s0):

Now we add the 2nd drive to our rpool by issuing:
# pfexec zpool attach -f rpool c3t0d0s0 c3t1d0s0

Again no explanation at all about where 's0' comes from.

When I try these steps I get errors about not finding such discs or
not being able to use an efi labeled disk...

I'm not sure if the suffix is to blame or what.

I'm guessing it might be something like s2 for solaris2 and s0
indicating the whole disk is for solaris but that is just guess work.

1) So what is going with those changing names?

2) Should I be able to use the steps shown there just as they are
(including unexplained suffixes) if I insert the basename of the
discs I'm using?

( I asked the second part above because some of the solaris type
documentation is very old, this is less than 3 yrs old so I guess it
should still be accurate but I'm not really sure).
Toomas Soome
2014-04-03 14:23:08 UTC
Permalink
Post by Harry Putnam
There are numerous sites online explaining how to mirror rpool, but
after looking at a few I've noticed they all seem to have what appears
(to me) to be a common shortcomming.
In each case extraneous suffixes start to appear at the end of the
disk names with no explanation about where they come from.
They all tell you to use format to find the disk names but then
proceed names that are different than those shown with format.
At least the docs at openindiana wiki explain one of the suffixes
('p0').
(http://wiki.openindiana.org/oi/2.1+Post-installation)
So at the point we are shown how to streamline fdisking a partition
pfexec fdisk -B c3t1d0p0 (p0 is the whole disk starting from
the MBR)
They explain where p0 came from
But then in the very next step where they start to tell you how to
label the disk suddenly the disc name has grown an 's2' on the end.
Now we set up an SMI label with same partitioning as disk 0 on disk 1.
# pfexec prtvtoc /dev/rdsk/c3t0d0s2 |
pfexec fmthard -s - /dev/rdsk/c3t1d0s2
No mention at all where s2 comes from, certainly not from looking at
the output of format.
# pfexec zpool attach -f rpool c3t0d0s0 c3t1d0s0
Again no explanation at all about where 's0' comes from.
When I try these steps I get errors about not finding such discs or
not being able to use an efi labeled disk...
I'm not sure if the suffix is to blame or what.
I'm guessing it might be something like s2 for solaris2 and s0
indicating the whole disk is for solaris but that is just guess work.
1) So what is going with those changing names?
2) Should I be able to use the steps shown there just as they are
(including unexplained suffixes) if I insert the basename of the
discs I'm using?
( I asked the second part above because some of the solaris type
documentation is very old, this is less than 3 yrs old so I guess it
should still be accurate but I'm not really sure).
it is an mess, and really not well explained, and more complicated as it should be (but hopefully there is some light;)

what you need to understand first, on x86 you actually have 2 different types of partitioning to work with in case of boot disk.

the boot disk(s) have fdisk partitions to support boot, and on install you get special fdisk partition labeled as "solaris2" (there is/was also "solaris", but linux stole it and using for linux swap). fdisk partitions have names suffixed as pX, where X has values from 1-4 for primary partitions, p0 is special case to indicate whole physical disk.

inside solaris2 fdisk partition you have SMI label with slices - on x86 there are total 10 slices (0-9), device names are suffixed as sX, X with values from 0-9. for historical reasons, slice 2 is "special", labeled as "backup". it's defined to cover all the available space seen by SMI label (full disk in case of sparc, fdisk partition in case of x86). today slice 8 is to mark space for partition boot block and slice 9 is not usable.

so, today, if you get fresh install, you see slice 0 starting from cylinder 1, and slice 8 defined to start from cylinder 0. this is needed to make sure the rpool wont overwrite partition boot block (grub).

now, there is new kid in this game, called GPT label. whenever you create pool by using disk name ending with dX (X is 0 for physical disks and lun number for raid luns) and skipping the sX or pX, the zpool command will label the disk for you with using GPT (or EFI) label. current opensolaris based systems cant boot from such disks, only solaris 11.1 can boot from GPT labeled disks. so, to use such disk for booting, you need to remove GPT label and replace it with "normal" fdisk + SMI. to do that, you start format -e (expert mode), select your disk, run fdisk from it to delete fdisk partitions if needed, and from format prompt use label command to write down new label. you will be asked to select from SMI or EFI label type, select SMI. after that you can create correct fdisk partitioning f
irst and then create SMI slices using format - partition menu (or prtvtoc | fmthard ).

once we get to the point we have boot loader capable of using GPT labels, we can forget all this fdisk madness, but till that time, its the way you have to deal with it.

rgds,
toomas
Harry Putnam
2014-04-04 03:08:38 UTC
Permalink
Post by Toomas Soome
once we get to the point we have boot loader capable of using GPT
labels, we can forget all this fdisk madness, but till that time, its
the way you have to deal with it.
Good job. Good input. Thanks for all the explaining.

And this time when I went thru the steps at:

http://wiki.openindiana.org/oi/2.1+Post-installation

It came off smooth as silk.

I must have made some kind of blunder when I tried it before.... then
tried to blame my pilot error on someone besides me....

Loading...