Quick ZFS mirroring question for non-mirrored pool

Jeremy Chadwick freebsd at jdc.parodius.com
Sun May 16 00:13:55 UTC 2010


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 at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |



More information about the freebsd-fs mailing list