From owner-freebsd-fs@FreeBSD.ORG Mon Nov 12 21:20:37 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7347D92F for ; Mon, 12 Nov 2012 21:20:37 +0000 (UTC) (envelope-from me@nikitosi.us) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 235C18FC14 for ; Mon, 12 Nov 2012 21:20:36 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id g24so307321qab.13 for ; Mon, 12 Nov 2012 13:20:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=lkKzBqKN20sXwguPVBW+M/rweoOtPMYR7tTlWK1Mmr4=; b=Fd6J/aXeWWZWp1L3HBoHbFvkYCaP0m9le/58FAdUh7FghJOR8Ftr+4bYjjLafwCaNv pn4uvmPBYongJz0sQUcE86E/ZSWYnbw65P3bAm1NVkw6jxf/GJHNN+lqmOcUZEKTLiDJ FFUId201D721FwWH5na47oRoWwe+H42obwhKf03p3dF+z7C+cHv4eMtGaND0qKxLw5Qw nS7xM981X6UhJNNLsMebm5iWGC653JKauOfQwMUQi63ay3LxByPazwiC5ug07HgXhHPh jAQsfdwBV3gTwc79opmyJffJaQO7yccasFeL090QQlREj1S1JCez/FcceDf7hqmbtH95 pALA== Received: by 10.224.27.140 with SMTP id i12mr21976918qac.15.1352755235023; Mon, 12 Nov 2012 13:20:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.29.230 with HTTP; Mon, 12 Nov 2012 13:20:13 -0800 (PST) From: nikitosiusis Date: Tue, 13 Nov 2012 00:20:13 +0300 Message-ID: Subject: "zpool add" safety checks are skipped if a pool was created with "-f" To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkKT6SQNt9I+OBgAwbT1d3/WrVxaOG7bv0AyH4bqBxuWT61TK6PprZ75BR3dh2micXVDtVV X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 21:20:37 -0000 Good day everyone. I managed to add a single device to a raidz2 pool by a typo(actually I wanted to add a cache device) without "-f" flag. This can be reproduced with md devices. # for a in {1..8}; do dd if=/dev/zero of=$a bs=1M count=96;done # dd if=/dev/zero of=9 bs=1M count=128 # ls -la -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 1 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 2 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 3 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 4 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 5 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 6 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 7 -rw-r--r-- 1 root wheel 100663296 Nov 12 21:04 8 -rw-r--r-- 1 root wheel 134217728 Nov 12 21:04 9 # for a in {1..9}; do mdconfig -f ~/tmp/$a; done Now we create a raidz pool with 8 identical drives. # zpool create testpool raidz2 md{1..8} # zpool add testpool md9 invalid vdev specification use '-f' to override the following errors: mismatched replication level: pool uses raidz and new vdev is disk It's ok. It doesn't allow to add a device. Now we create a new pool, but with devices of different size(I don't know what is the difference in size allowed, I used 32mb). # zpool create testpool raidz2 md{1..7} md9 invalid vdev specification use '-f' to override the following errors: raidz contains devices of different sizes # zpool create -f testpool raidz2 md{1..7} md9 # zpool add testpool md8 And we have no error here - single drive is added to the pool. Since it is an undoable action - it can ruin your pool and should be considered as a bug imho. Here is my result in production. NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT root 3.63T 1.06T 2.57T 29% 1.00x ONLINE - raidz2 3.62T 1.06T 2.57T - ada0 - - - - ada1 - - - - ada3 - - - - ada4 - - - - ada5 - - - - ada6 - - - - ada7 - - - - ada8 - - - - da0p1 3.75G 76.5K 3.75G - # uname -rv 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #2: Thu Nov 8 13:50:55 UTC 2012 root@ex.a.nikitos.name:/usr/obj/usr/src/sys/GENERIC # zpool get version testpool NAME PROPERTY VALUE SOURCE testpool version 28 default # zfs get version testpool NAME PROPERTY VALUE SOURCE testpool version 5 - btw is there a chance to remove this device now? Regards.