From owner-freebsd-fs@FreeBSD.ORG Fri Dec 9 14:58:08 2011 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 80A04106566B; Fri, 9 Dec 2011 14:58:08 +0000 (UTC) (envelope-from c.kworr@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB1B8FC0A; Fri, 9 Dec 2011 14:58:07 +0000 (UTC) Received: by eekc50 with SMTP id c50so1892827eek.13 for ; Fri, 09 Dec 2011 06:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0SzOnNxRh2bPDx5zgCpWMqu8CsH6mr29PEh2WBm4zPo=; b=uEx/foUXywj+5f5oxlwWFqAlvMTD6d5YlFRXBbg75XshdbvT8hXVF+yhWGLvzbFASf BnDRTDkFAc/FE8gvmonVz4CUWd9rWG7pmUXMK2Mmgs9RTA09lwgY5Z4JaFYQHhl9WZfg xtnz1JzKvtxC1sza7ANqzSocDiVn4kQc60quo= Received: by 10.14.2.136 with SMTP id 8mr459065eef.132.1323442686248; Fri, 09 Dec 2011 06:58:06 -0800 (PST) Received: from green.tandem.local (utwig.xim.bz. [91.216.237.46]) by mx.google.com with ESMTPS id d6sm31992392eec.10.2011.12.09.06.58.02 (version=SSLv3 cipher=OTHER); Fri, 09 Dec 2011 06:58:03 -0800 (PST) Message-ID: <4EE221F9.9010505@gmail.com> Date: Fri, 09 Dec 2011 16:58:01 +0200 From: Volodymyr Kostyrko User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111111 Thunderbird/8.0 MIME-Version: 1.0 To: Robert Millan References: <20111208134307.GA5266@thorin> In-Reply-To: <20111208134307.GA5266@thorin> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org, Adrian Chadd Subject: Re: [PATCH] Wipe other file systems when creating new UFS 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: Fri, 09 Dec 2011 14:58:08 -0000 08.12.2011 15:43, Robert Millan wrote: > This patch resolves a problem reported to Debian BTS [1] which also affects > FreeBSD. The problem is that if you create a ZFS file system in a partition > and later decide you'd rather use UFS and overwrite it, remnants of ZFS > uberblocks are left at the beginning and end of the partition. This can > lead to disaster (data loss) if "zpool import" is attempted, as it would > destroy UFS data structures. > > newfs(8) currently erases remnants of UFS if they exist. I think it should > go further and erase first and last 512 kiB of the partition. > > [1] http://bugs.debian.org/635272 Shouldn't it make us a coffee then? Making precautions against shooting-the-foot is a wrong choice for me. This way we need to extend it to support any other file system that can repair thyself upon mount in case user mistakenly mounted the wrong one. What about drives that support SSD? Isn't it convenient to use TRIM in such cases? You messing up ZFS terminology a bit. Uberblock size is 1k and what you refer is ZFS vdev label. Size of vdev label is 256k. There are four vdev labels for each vdev - two at the beginning of the vdev and two at the end. All vdev labels are _aligned_ to 256k. So technically this is not just last 512k. -- Sphinx of black quartz judge my vow.