From owner-freebsd-fs@FreeBSD.ORG Sun May 16 00:13:54 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D46841065670 for ; Sun, 16 May 2010 00:13:54 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA11.westchester.pa.mail.comcast.net (qmta11.westchester.pa.mail.comcast.net [76.96.59.211]) by mx1.freebsd.org (Postfix) with ESMTP id 8437B8FC08 for ; Sun, 16 May 2010 00:13:53 +0000 (UTC) Received: from omta10.westchester.pa.mail.comcast.net ([76.96.62.28]) by QMTA11.westchester.pa.mail.comcast.net with comcast id Hzua1e0050cZkys5B0DuhL; Sun, 16 May 2010 00:13:54 +0000 Received: from koitsu.dyndns.org ([98.248.46.159]) by omta10.westchester.pa.mail.comcast.net with comcast id J0Ds1e00D3S48mS3W0DtVX; Sun, 16 May 2010 00:13:54 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 9D5B59B419; Sat, 15 May 2010 17:13:51 -0700 (PDT) Date: Sat, 15 May 2010 17:13:51 -0700 From: Jeremy Chadwick To: Kaya Saman Message-ID: <20100516001351.GA50879@icarus.home.lan> References: <4BEF2F9C.7080409@netscape.net> <4BEF3137.4080203@netscape.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BEF3137.4080203@netscape.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@freebsd.org Subject: Re: Quick ZFS mirroring question for non-mirrored pool X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2010 00:13:55 -0000 On Sun, May 16, 2010 at 02:41:43AM +0300, Kaya Saman wrote: > 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 What you have here is the equivalent of RAID-10. It might be more helpful to look at the above as a "stripe of mirrors". In this situation, you might be better off with raidz1 (RAID-5 in concept). You should get better actual I/O performance due to ZFS distributing the I/O workload across 4 disks rather than 2. At least that's how I understand it. > 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?? I don't have this problem: testbox# zpool create mypool mirror da1 da2 mirror da3 da4 testbox# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT mypool 254G 75K 254G 0% ONLINE - testbox# zpool status pool: mypool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM mypool ONLINE 0 0 0 mirror ONLINE 0 0 0 da1 ONLINE 0 0 0 da2 ONLINE 0 0 0 mirror ONLINE 0 0 0 da3 ONLINE 0 0 0 da4 ONLINE 0 0 0 errors: No known data errors And after creating a 32MByte file: testbox# dd if=/dev/urandom of=/mypool/file bs=1024 count=32768 32768+0 records in 32768+0 records out 33554432 bytes transferred in 1.522111 secs (22044669 bytes/sec) testbox# ls -l /mypool/file -rw-r--r-- 1 root wheel 33554432 May 15 17:12 /mypool/file testbox# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT mypool 254G 32.1M 254G 0% ONLINE - -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |