Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 2010 02:41:43 +0300
From:      Kaya Saman <SamanKaya@netscape.net>
To:        freebsd-fs@freebsd.org
Subject:   Re: Quick ZFS mirroring question for non-mirrored pool
Message-ID:  <4BEF3137.4080203@netscape.net>
In-Reply-To: <4BEF2F9C.7080409@netscape.net>
References:  <4BEF2F9C.7080409@netscape.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Ok I think I've got what I want by using the 'attach' command:

from here: 
http://prefetch.net/blog/index.php/2007/01/04/adding-a-mirror-to-a-device-in-a-zfs-pool/

rd1# zpool attach zpool1 /mnt/disk1 /mnt/disk3
rd1# zpool attach zpool1 /mnt/disk2 /mnt/disk4
rd1# zpool status zpool1
   pool: zpool1
  state: ONLINE
  scrub: resilver completed after 0h0m with 0 errors on Sun May 16 
02:36:58 2010
config:

     NAME            STATE     READ WRITE CKSUM
     zpool1          ONLINE       0     0     0
       mirror        ONLINE       0     0     0
         /mnt/disk1  ONLINE       0     0     0
         /mnt/disk3  ONLINE       0     0     0
       mirror        ONLINE       0     0     0
         /mnt/disk2  ONLINE       0     0     0  96.5K resilvered
         /mnt/disk4  ONLINE       0     0     0  15.3M resilvered

errors: No known data errors

which seems to be ok as data is still there post attachement:

rd1# ls /zpool1
file.test

and also space is ok being ~256MB:

rd1# zpool list
NAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
zpool1   246M  32.2M   214M    13%  ONLINE  -

although not sure where 10MB went as all files in this pool are 128MB so 
I should get 256MB no??


On 05/16/2010 02:34 AM, Kaya Saman wrote:
> Hi,
>
> I'm just exploring ZFS commands currently as I haven't used much of 
> ZFS even though I deal with BSD and Solaris/OpenSolaris on a daily 
> basis.....
>
> Basically what I am about to do is build a new server using FreeBSD 
> 8.0 x64 on a Mini-ITX system and unfortunately due to budget I won't 
> be able to get the extra 2 disks that I need so out of 4 disks overall 
> is 2.
>
> I just really wanted to ask after using these tutorials:
>
> http://wiki.freebsd.org/ZFSQuickStartGuide
>
> http://blog.thefrog.net/2008/04/zfs-on-freebsd.html
>
> http://flux.org.uk/howto/solaris/zfs_tutorial_01
>
> if it's possible to add a mirror to a non-mirrored pool??
>
> It's a bit hard to explain but taken from the last URL:
>
> I created 4 files using mkfile in /mnt called file1...4
>
> Now I added the first 2 to a pool: zpool create zpool1 /mnt/disk1 
> /mnt/disk2
>
> and checked the status:
>
> zpool status zpool1
>   pool: zpool1
>  state: ONLINE
>  scrub: none requested
> config:
>
>     NAME          STATE     READ WRITE CKSUM
>     zpool1        ONLINE       0     0     0
>       /mnt/disk1  ONLINE       0     0     0
>       /mnt/disk2  ONLINE       0     0     0
>
> errors: No known data errors
>
>
> What I would like to do over time is add 2 more disks to this pool (in 
> real life, however for my demo they will be /mnt/disk3 and 
> /mnt/disk4). The real catch is that I would like disks 3 + 4 to be a 
> mirror of the first 2 disks.....
>
> Is this possible to start with without loosing any data and destroying 
> the pool?
>
> Or do I need to create another pool say zpool2 and mirror the pools??
>
> So in RAID terms I guess would be something like disk1 and 2 in RAID 0 
> with disks 3 + 4 in RAID 0 however, RAID0(1) in RAID 1 array with 
> RAID0(2).....
>
> Perhaps is RAID 1+ 0 which I'm trying to achieve I don't know but 
> currently I'm not really getting anywhere with what I've tried and 
> managed to crash the kernel and make the system reboot already.
>
> From scratch it would be so easy as I could just use: zpool create 
> zpool1 mirror /mnt/disk1 /mnt/disk2 mirror /mnt/disk3 /mnt/disk4.
>
> Can anyone give me any advice??
>
> Many thanks,
>
> Kaya
>
> _______________________________________________
> freebsd-fs@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BEF3137.4080203>