From owner-freebsd-fs@FreeBSD.ORG Sun Aug 7 07:32:37 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 140FA106564A for ; Sun, 7 Aug 2011 07:32:37 +0000 (UTC) (envelope-from ttsestt@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5CC8FC0C for ; Sun, 7 Aug 2011 07:32:36 +0000 (UTC) Received: by fxe4 with SMTP id 4so1325695fxe.13 for ; Sun, 07 Aug 2011 00:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:references:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=vqKk9BP8Yl5uAkFCQUQ9h3YEai0pAlE/5zovvN5PUuo=; b=rZeknNiXxpk1zzSkJF9JBzDCT1aae5CRPul2cBWBTERvOJ4V+H5j/vG7k/h1w0Ss0T xYfIkLofVFHwdXVWpPQhQSTXd1bW4pWdzjKwj0aXyD4fg330hEYgRUNcgB1stHjq2Xdc DnfJLb1oPwrm86VTZRi6FhLtDH8klH2k+h/P4= Received: by 10.204.18.13 with SMTP id u13mr274094bka.83.1312700467479; Sun, 07 Aug 2011 00:01:07 -0700 (PDT) Received: from localhost (raskin.torservers.net [74.120.15.150]) by mx.google.com with ESMTPS id m25sm1123084bks.15.2011.08.07.00.01.05 (version=SSLv3 cipher=OTHER); Sun, 07 Aug 2011 00:01:06 -0700 (PDT) From: Test Rat To: freebsd-fs@freebsd.org References: Date: Sun, 07 Aug 2011 11:00:59 +0400 Message-ID: <867h6pemdw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: kern.geom.debugflags=16 does NOT allow me to write to device 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, 07 Aug 2011 07:32:37 -0000 Peter Schuller writes: [...] > In addition, geom(4) still has: > > 0x10 (allow foot shooting) > Allow writing to Rank 1 providers. This would, for example, > allow the super=E2=80=90user to overwrite the MBR on the roo= t disk or > write random sectors elsewhere to a mounted disk. The impli= ca=E2=80=90 > tions are obvious. > > In addition, geom/geom_subr.c has: > > /* If foot-shooting is enabled, any open on rank#1 is OK */ > if ((g_debugflags & 16) && pp->geom->rank =3D=3D 1) > ; > > I wonder if the problem is that it's not of rank 1 because I'm writing > to the slice's first second rather than the MBR... That's now feeling > pretty likely and can perhaps explain lots of confusion that seems to > exist based on Googling. [...] The issue still seems unanswered. For example, this guide http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition silently avoids explaining why zroot on MBR & BSD should be exported. If gpart is ever fixed I still think shooting the foot on rank > 1 is useful for things like testing FS for corruption without accidentally destroying partition table if operating on rank =3D=3D 1.