UNIX admin <[email protected]>
writes:

>> You get a 60GB mirror.
>
> I suspected as much, hence my question.
>
>> Then, when you remove the 60G disk and your reboot or
>> export/import the
>> pool, then it will reevaluate the size of the vdev.
>> 
>> It tried and it worked (and "zpool history" remembers
>> how I did it)

And now I can vouch for it too.  I followed Caspers' recipe.  The
second one with two steps (with some tiny typographical corrections):
(Others have suggested similar scenarios too).

In my case the olddev was an fdisk partitioned 60 gb disk with rpool
on partition 1 of 25gb.  So at first the attached mirror was also
a 25 gb mirror.

Casper wrote:

   "If it's a bootable pool, then there might be a problem; you can do
    it in two steps:

        zpool attach pool olddevice newdevice (make a mirror)

    and later, after a reboot from the new mirror (and after
    installing grub)

        zpool detach pool olddevice "

There are a couple of things I found:
  I'd make it a bit bigger point about when to do the grub part and
  although the info is available in many places..  Anyone looking to
  do this would find it handy if included here:

  Right after attaching new drive and after resilvering is complete.
  Before any reboot:

`installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/newdev'

 Also I'd add something about preparing the new disk.  Maybe there are
 better ways but I was operating under the assumption from advice I've
 seen on opensolaris pages that all that was really necessary was to
 to fdisk a partition of opensolaris2 for the full disk.

 format/ select newdev number/fdisk/choose opensolaris2 (1) as
 filesystem/for size say %100. Save with number 5.

 That's it... but I found that wasn't enough.

 (With fdisking done) I hit two errors if I tried attaching using
 slice names, with `s0' at the end:
  
 `zpool attach mypool c3d0s0 c3d1s0' (where olddev=c3d0 newdev=c3d1)

 zpool would complain the last one (newdev) didn't exist.  Even though
 I could see the link in /dev directory.

 If I tried the actual disk name:

  zpool attach mypool c3d0 c3d1

  zpool complained that c3d1 was an EFI labeled device.  Even though
  fdisk clearly showed it was opensolaris2.

Finally I went the whole hog and did `format/partition/label'

Selecting `0' end expanding it from cylinder 3 to within one cylinder
 of the count shown for `2' (whole disk).

 Otherwise zpool would complain that the slice `s0' overlapped `s2'

 I admit I didn't really have much of an idea what I was doing so I
 fumbled around extensively.  It had been at least 6-7 yrs since I'd
 had any occasion to work with `partition'.

 There are no doubt better ways of doing it, but once I'd created the
 slice and let `partition' label it, then the zpool attach command
 went off without a hitch.
  
=====     *     =====     *     =====     *     =====

In fact, I'd love to hear some detailed comments about how to prepare
the newdev from someone with experience.

=====     *     =====     *     =====     *     =====
 
Finishing up on Caspers recommendations:

Unix admin asked:
>But what happens when you attempt to mirror a 60GB disk to a 500GB
>disk?  How does that work?

Casper replied:
  You get a 60GB mirror.

  Then, when you remove the 60G disk and your reboot or export/import
  the pool, then it will reevaluate the size of the vdev.

  It tried and it worked (and "zpool history" remembers how I did it)

And that is exactly how it happened in my case.
  




_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to