Hi All,
I had a slice with zfs file system which I want to mirror, I
followed the procedure mentioned in the amin guide I am getting this
error. Can you tell me what I did wrong?
root # zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
export 254G 230K 254G 0% ONLINE -
root # echo |format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c2t0d0 <DEFAULT cyl 35497 alt 2 hd 255 sec 63>
/pci at 7b,0/pci1022,7458 at 11/pci1000,3060 at 2/sd at 0,0
1. c2t2d0 <DEFAULT cyl 35497 alt 2 hd 255 sec 63>
/pci at 7b,0/pci1022,7458 at 11/pci1000,3060 at 2/sd at 2,0
Specify disk (enter its number): Specify disk (enter its number):
:root # zpool create export mirror c2t0d0s5 c2t2d0s5
invalid vdev specification
use ''-f'' to override the following errors:
/dev/dsk/c2t0d0s5 is part of active ZFS pool export. Please see
zpool(1M).
Thanks,
Srini
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20080617/c7506057/attachment.html>
On Jun 17, 2008, at 12:23 PM, Srinivas Chadalavada wrote:> :root # zpool create export mirror c2t0d0s5 c2t0d0s5 > invalid vdev specification > use ''-f'' to override the following errors: > /dev/dsk/c2t0d0s5 is part of active ZFS pool export. Please see > zpool(1M).(I presume that you meant to use c2t2d0s5 as the second slice) You''ve already created your pool, so all you want to do is attach the new slice to be a mirror of one that is already in the pool: zpool attach export c2t0d0s5 c2t2d0s5 This will create a mirror between c2t0d0s5 and c2t2d0s5 First be sure that slice 5 on c2t2d0 is at least the same size as c2t0d0s5. If c2t2d0 is unused, you can copy the vtoc from the first disk to the second one with a simple command: prtvtoc /dev/rdsk/c2t0d0s2 | fmthard -s - /dev/rdsk/c2t2d0s2 Since you''re on x86, you may need to run fdisk against c2t2d0 if it is a virgin drive. /dale
Enda O''Connor ( Sun Micro Systems Ireland)
2008-Jun-17 16:36 UTC
[zfs-discuss] mirroring zfs slice
Hi
Use zpool attach
from
http://docs.sun.com/app/docs/doc/819-2240/zpool-1m
zpool attach [-f] pool device new_device
Attaches new_device to an existing zpool device. The existing device cannot
be part
of a raidz configuration. If device is not currently part of a mirrored
configuration,
device automatically transforms into a two-way mirror of device and new_device.
If device
is part of a two-way mirror, attaching new_device creates a three-way mirror,
and so on.
In either case, new_device begins to resilver immediately.
Enda
Srinivas Chadalavada wrote:> Hi All,
>
> I had a slice with zfs file system which I want to mirror, I
> followed the procedure mentioned in the amin guide I am getting this
> error. Can you tell me what I did wrong?
>
>
>
> root # zpool list
>
> NAME SIZE USED AVAIL CAP HEALTH ALTROOT
>
> export 254G 230K 254G 0% ONLINE -
>
> root # echo |format
>
> Searching for disks...done
>
>
>
>
>
> AVAILABLE DISK SELECTIONS:
>
> 0. c2t0d0 <DEFAULT cyl 35497 alt 2 hd 255 sec 63>
>
> /pci at 7b,0/pci1022,7458 at 11/pci1000,3060 at 2/sd at 0,0
>
> 1. c2t2d0 <DEFAULT cyl 35497 alt 2 hd 255 sec 63>
>
> /pci at 7b,0/pci1022,7458 at 11/pci1000,3060 at 2/sd at 2,0
>
> Specify disk (enter its number): Specify disk (enter its number):
>
> :root # zpool create export mirror c2t0d0s5 c2t2d0s5
>
> invalid vdev specification
>
> use ''-f'' to override the following errors:
>
> /dev/dsk/c2t0d0s5 is part of active ZFS pool export. Please see zpool(1M).
>
>
>
> Thanks,
>
> Srini
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Hi Dale,
It worked. Prtvtoc is already set right.
# zpool attach export c2t0d0s5 c2t2d0s5
# zpool status
pool: export
state: ONLINE
scrub: resilver completed with 0 errors on Tue Jun 17 09:36:12 2008
config:
NAME STATE READ WRITE CKSUM
export ONLINE 0 0 0
mirror ONLINE 0 0 0
c2t0d0s5 ONLINE 0 0 0
c2t2d0s5 ONLINE 0 0 0
errors: No known data errors
Thanks,
Srini
-----Original Message-----
From: Dale Ghent [mailto:daleg at elemental.org]
Sent: Tuesday, June 17, 2008 9:32 AM
To: Srinivas Chadalavada
Cc: zfs-discuss at opensolaris.org
Subject: Re: [zfs-discuss] mirroring zfs slice
On Jun 17, 2008, at 12:23 PM, Srinivas Chadalavada wrote:
> :root # zpool create export mirror c2t0d0s5 c2t0d0s5
> invalid vdev specification
> use ''-f'' to override the following errors:
> /dev/dsk/c2t0d0s5 is part of active ZFS pool export. Please see
> zpool(1M).
(I presume that you meant to use c2t2d0s5 as the second slice)
You''ve already created your pool, so all you want to do is attach the
new slice to be a mirror of one that is already in the pool:
zpool attach export c2t0d0s5 c2t2d0s5
This will create a mirror between c2t0d0s5 and c2t2d0s5
First be sure that slice 5 on c2t2d0 is at least the same size as
c2t0d0s5. If c2t2d0 is unused, you can copy the vtoc from the first
disk to the second one with a simple command:
prtvtoc /dev/rdsk/c2t0d0s2 | fmthard -s - /dev/rdsk/c2t2d0s2
Since you''re on x86, you may need to run fdisk against c2t2d0 if it is
a virgin drive.
/dale
On Tue, 17 Jun 2008 17:36:47 +0100 "Enda O''Connor ( Sun Micro Systems Ireland)" <Enda.Oconnor at Sun.COM> wrote:> zpool attach [-f] pool device new_device > > Attaches new_device to an existing zpool device. The existing > device cannot be part of a raidz configuration. If device is not > currently part of a mirrored configuration, device automatically > transforms into a two-way mirror of device and new_device. If device > is part of a two-way mirror, attaching new_device creates a three-way > mirror, and so on. In either case, new_device begins to resilver > immediately.This is about slices. Can this be done for a whole disk too? And it yes, do these disks have to be exactly the same size? -- Dick Hoogendijk -- PGP/GnuPG key: 01D2433D ++ http://nagual.nl/ + SunOS sxce snv90 ++
On Jun 17, 2008, at 1:13 PM, dick hoogendijk wrote:> This is about slices. Can this be done for a whole disk too? And it > yes, do these disks have to be exactly the same size?Indeed, it can be used on an entire disk. Examples: zpool create mypool c1t0d0 zpool attach mypool c1t0d0 c2t0d0 zpool create mypool mirror c1t0d0 c2t0d0 ... Note the lack of a slice ID in the above command''s disk specifications. ZFS will interpret this as "use the entire disk" At that point it will apply a EFI label to the disk and bring it into the pool as specified. This method is preferred over specifying slice 2 (eg, c1t0d0s2) when wanting to use the entire disk for ZFS. /dale
Sure. This operation can be done with whole disks too. The disk (new_device) should be the same size or larger than the existing disk (device). You can review some examples here: http://docs.sun.com/app/docs/doc/817-2271/gcfhe?a=view If the disks are of unequal size, then some disk space will be wasted. Cindy dick hoogendijk wrote:> On Tue, 17 Jun 2008 17:36:47 +0100 > "Enda O''Connor ( Sun Micro Systems Ireland)" <Enda.Oconnor at Sun.COM> > wrote: > > >>zpool attach [-f] pool device new_device >> >>Attaches new_device to an existing zpool device. The existing >>device cannot be part of a raidz configuration. If device is not >>currently part of a mirrored configuration, device automatically >>transforms into a two-way mirror of device and new_device. If device >>is part of a two-way mirror, attaching new_device creates a three-way >>mirror, and so on. In either case, new_device begins to resilver >>immediately. > > > This is about slices. Can this be done for a whole disk too? And it > yes, do these disks have to be exactly the same size? >