OpenSolaris

Discussions Communities Projects Download Source Browser

Home » OpenSolaris Forums » zfs » discuss

Thread: [zfs-discuss] how to add a partition to a zpool?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 5 - Last Post: Nov 4, 2009 9:31 AM by: A Darren Dunham Threads: [ Previous | Next ]
tthtlc

Posts: 44
From: SG

Registered: 10/29/05
[zfs-discuss] how to add a partition to a zpool?
Posted: Nov 4, 2009 12:17 AM

  Click to reply to this thread Reply


I have used fdisk to partition the harddisk:

             Total disk size is 60800 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1       Active    Solaris2          1  2623    2623      4
          2                 Solaris2       2624  9623    7000     12


and the zpool status:

/root>zpool status
  pool: rpool
 state: ONLINE
 scrub: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
      c7d0s0    ONLINE       0     0     0

errors: No known data errors


question is:

a.   how to use "zpool add" to add the 2nd partition to rpool - which should be c7d0p2, right?

when I did this:

zpool add rpool c7d0p2
cannot add to 'rpool': root pool can not have multiple vdevs or separate logs

what do u mean by "separate logs"?

b.   assuming that it is NOT possible to add the 2nd partition to the zpool rpool, then how do I used fdisk (or whatever) to modify the partition table, so that the entire disk belong to the zpool rpool - instead of just c7d0p1 now allocated to zpool rpool?

Thanks for the help :).


--
Regards,
Peter Teoh
_______________________________________________ zfs-discuss mailing list zfs-discuss at opensolaris dot org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Andrew Gabriel
agabriel@opensolaris...
Re: [zfs-discuss] how to add a partition to a zpool?
Posted: Nov 4, 2009 1:59 AM   in response to: tthtlc

  Click to reply to this thread Reply

Peter Teoh wrote:
>
> I have used fdisk to partition the harddisk:
>
> Total disk size is 60800 cylinders
> Cylinder size is 16065 (512 byte) blocks
>
> Cylinders
> Partition Status Type Start End Length %
> ========= ====== ============ ===== === ====== ===
> 1 Active Solaris2 1 2623 2623 4
> 2 Solaris2 2624 9623 7000 12
>
>
> and the zpool status:
>
> /root>zpool status
> pool: rpool
> state: ONLINE
> scrub: none requested
> config:
>
> NAME STATE READ WRITE CKSUM
> rpool ONLINE 0 0 0
> c7d0s0 ONLINE 0 0 0
>
> errors: No known data errors
>
>
> question is:
>
> a. how to use "zpool add" to add the 2nd partition to rpool - which
> should be c7d0p2, right?
>
> when I did this:
>
> zpool add rpool c7d0p2
> cannot add to 'rpool': root pool can not have multiple vdevs or
> separate logs
>
> what do u mean by "separate logs"?

That is the right command.

However, the rpool as a special case is not permitted to be RAID 0
(multiple vdevs) as you were attempting, only RAID 1 (mirrors).

>
> b. assuming that it is NOT possible to add the 2nd partition to the
> zpool rpool, then how do I used fdisk (or whatever) to modify the
> partition table, so that the entire disk belong to the zpool rpool -
> instead of just c7d0p1 now allocated to zpool rpool?

It can be done by careful use of fdisk (with some risk of blowing away
the data if you get it wrong), but I've seen other email threads here
that indicate ZFS then won't mount the pool, because the two labels at
the end of the partition can't be found anymore (having moved where the
end of the partition is).

You could create a separate zpool in the spare fdisk partition. Not good
for performance, but probably fine for infrequently accessed data.

--
Andrew
_______________________________________________
zfs-discuss mailing list
zfs-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


tthtlc

Posts: 44
From: SG

Registered: 10/29/05
Re: [zfs-discuss] how to add a partition to a zpool?
Posted: Nov 4, 2009 7:44 AM   in response to: Andrew Gabriel

  Click to reply to this thread Reply



On Wed, Nov 4, 2009 at 4:59 AM, Andrew Gabriel <agabriel at opensolaris dot org> wrote:
Peter Teoh wrote:

I have used fdisk to partition the harddisk:

            Total disk size is 60800 cylinders
            Cylinder size is 16065 (512 byte) blocks

                                              Cylinders
     Partition   Status    Type          Start   End   Length    %
     =========   ======    ============  =====   ===   ======   ===
         1       Active    Solaris2          1  2623    2623      4
         2                 Solaris2       2624  9623    7000     12


and the zpool status:

/root>zpool status
 pool: rpool
 state: ONLINE
 scrub: none requested
config:

   NAME        STATE     READ WRITE CKSUM
   rpool       ONLINE       0     0     0
     c7d0s0    ONLINE       0     0     0

errors: No known data errors


question is:

a.   how to use "zpool add" to add the 2nd partition to rpool - which should be c7d0p2, right?

when I did this:

zpool add rpool c7d0p2
cannot add to 'rpool': root pool can not have multiple vdevs or separate logs

what do u mean by "separate logs"?

That is the right command.

However, the rpool as a special case is not permitted to be RAID 0 (multiple vdevs) as you were attempting, only RAID 1 (mirrors).



b.   assuming that it is NOT possible to add the 2nd partition to the zpool rpool, then how do I used fdisk (or whatever) to modify the partition table, so that the entire disk belong to the zpool rpool - instead of just c7d0p1 now allocated to zpool rpool?

It can be done by careful use of fdisk (with some risk of blowing away the data if you get it wrong), but I've seen other email threads here that indicate ZFS then won't mount the pool, because the two labels at the end of the partition can't be found anymore (having moved where the end of the partition is).

You could create a separate zpool in the spare fdisk partition. Not good for performance, but probably fine for infrequently accessed data.

I created a separate zpool via "zpool create mypool" (after being unsuccessful with "zpool create mypool c7d0s1", gave some error message, then I tried c7d0s2, and it indicate being identical to c7d0s0 (??? confused me), and then c7d0s3, c7d0s4 etc....all gave error messages.   my assumption: so long as there is error message, nothing harmful/persistent is done.) and it has no error.

zpool status indicated two pool of 20G identically ---> confused me completey.   why 20G, as I had not specified anything in the command line.

and "zpool create mypool -m /mountpoint c7d0s1" was not successful as well.  

anyway....after i reboot.....the MBR is corrupted, and only the symbol "GRUB" appeared on the left hand side of screen.

Booting up with a livecd, and then "zpool create mypool c7d0" gives error like "/dev/dsk/c7d0s0 is part of exported or potentially active ZFS pool rpool" and repeated two more times for c7d0s2 and c7d0s8.

what are all these different slices???  i used fdisk to create the first s0: 20G, and then fdisk 2nd partition as 100G (approx) but cannot use this partition at all throughout.

Bottomline is that the rpool have about 16G of data which I badly need to retained/retreved.....hopefully it is not all gone.   so how to retrieve back the data??????

thank you very much :-).



 

--
Andrew



--
Regards,
Peter Teoh
<input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden">
_______________________________________________ zfs-discuss mailing list zfs-discuss at opensolaris dot org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


A Darren Dunham
ddunham@taos.com
Re: [zfs-discuss] how to add a partition to a zpool?
Posted: Nov 4, 2009 8:27 AM   in response to: Andrew Gabriel

  Click to reply to this thread Reply

On Wed, Nov 04, 2009 at 09:59:05AM +0000, Andrew Gabriel wrote:
> It can be done by careful use of fdisk (with some risk of blowing away
> the data if you get it wrong), but I've seen other email threads here
> that indicate ZFS then won't mount the pool, because the two labels at
> the end of the partition can't be found anymore (having moved where the
> end of the partition is).

I don't think that would be a problem. When I've tried it, as long as
the first two labels are found, it creates the labels at the end of the
disk. Admittedly, I've never tried it with a root pool.

> You could create a separate zpool in the spare fdisk partition. Not good
> for performance, but probably fine for infrequently accessed data.

I don't think the second fdisk partition can be used. The system
doesn't like to have multiple "Solaris" partitions.

--
Darren
_______________________________________________
zfs-discuss mailing list
zfs-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Andrew Gabriel
agabriel@opensolaris...
Re: [zfs-discuss] how to add a partition to a zpool?
Posted: Nov 4, 2009 8:41 AM   in response to: A Darren Dunham

  Click to reply to this thread Reply

A Darren Dunham wrote:
> On Wed, Nov 04, 2009 at 09:59:05AM +0000, Andrew Gabriel wrote:
>
>> It can be done by careful use of fdisk (with some risk of blowing away
>> the data if you get it wrong), but I've seen other email threads here
>> that indicate ZFS then won't mount the pool, because the two labels at
>> the end of the partition can't be found anymore (having moved where the
>> end of the partition is).
>>
>
> I don't think that would be a problem. When I've tried it, as long as
> the first two labels are found, it creates the labels at the end of the
> disk. Admittedly, I've never tried it with a root pool.
>
>
>> You could create a separate zpool in the spare fdisk partition. Not good
>> for performance, but probably fine for infrequently accessed data.
>>
>
> I don't think the second fdisk partition can be used. The system
> doesn't like to have multiple "Solaris" partitions.
>

Make sure it isn't a Solaris partition (pick some partition type which
is going to be meaningless to all the OS's installed on the system, so
they don't try to access it). Then you can use it as above.

--
Andrew

_______________________________________________
zfs-discuss mailing list
zfs-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


A Darren Dunham
ddunham@taos.com
Re: [zfs-discuss] how to add a partition to a zpool?
Posted: Nov 4, 2009 9:31 AM   in response to: Andrew Gabriel

  Click to reply to this thread Reply

On Wed, Nov 04, 2009 at 04:41:34PM +0000, Andrew Gabriel wrote:
> A Darren Dunham wrote:

> >I don't think the second fdisk partition can be used. The system
> >doesn't like to have multiple "Solaris" partitions.
> >
>
> Make sure it isn't a Solaris partition (pick some partition type which
> is going to be meaningless to all the OS's installed on the system, so
> they don't try to access it). Then you can use it as above.

Yes, I think that would be fine. But I was referencing the OP who had
in fact used a second Solaris partition.

>>>I have used fdisk to partition the harddisk:
>>>
>>> Total disk size is 60800 cylinders
>>> Cylinder size is 16065 (512 byte) blocks
>>>
>>> Cylinders
>>> Partition Status Type Start End Length %
>>> ========= ====== ============ ===== === ====== ===
>>> 1 Active Solaris2 1 2623 2623 4
>>> 2 Solaris2 2624 9623 7000 12

That should be changed.

--
Darren
_______________________________________________
zfs-discuss mailing list
zfs-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss





Terms of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
Copyright © 1995-2005 Sun Microsystems, Inc.