From nobody@FreeBSD.org  Thu Jun  9 04:23:27 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A51F106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Jun 2011 04:23:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B2468FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Jun 2011 04:23:27 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p594NRlI036286
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 9 Jun 2011 04:23:27 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p594NR6s036279;
	Thu, 9 Jun 2011 04:23:27 GMT
	(envelope-from nobody)
Message-Id: <201106090423.p594NR6s036279@red.freebsd.org>
Date: Thu, 9 Jun 2011 04:23:27 GMT
From: Robert Simmons <rsimmons0@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: unable to newfs a geli encrypted partition
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157722
>Category:       kern
>Synopsis:       [geli] unable to newfs a geli encrypted partition
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-fs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 09 04:30:10 UTC 2011
>Closed-Date:    Fri Mar 02 05:20:59 UTC 2012
>Last-Modified:  Fri Mar 02 05:20:59 UTC 2012
>Originator:     Robert Simmons
>Release:        8.2-RELEASE
>Organization:
>Environment:
FreeBSD 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
newfs unable to create filesystem on a fresh geli encrypted provider.

If you create a BSD scheme partition inside a geli encrypted provider like so:
geli init -b -v -a hmac/sha512 -e aes-cbc -l 256 -s 4096 /dev/ad0p1
geli attach /dev/ad0p1
gpart create -s BSD ad0p1.eli
gpart add -s 1g -t freebsd-ufs ad0p1.eli

then you try to newfs, you get an error:
# newfs -U /dev/ad0p1.elia
newfs: can't read old UFS1 superblock: read error from block device: Invalid argument
>How-To-Repeat:
geli init -b -v -a hmac/sha512 -e aes-cbc -l 256 -s 4096 /dev/ad0p1
geli attach /dev/ad0p1
gpart create -s BSD ad0p1.eli
gpart add -s 1g -t freebsd-ufs ad0p1.eli
newfs -U /dev/ad0p1.elia
>Fix:
The workaround for this bug is to dd data to the provider before using newfs:
dd if=/dev/random of=/dev/ad0p1.elia bs=8m

After that, newfs works as it should.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jun 9 21:23:47 UTC 2011 
Responsible-Changed-Why:  
Reclassify and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157722 

From: "Andrey V. Elsukov" <ae@FreeBSD.org>
To: bug-followup@FreeBSD.org, rsimmons0@gmail.com
Cc:  
Subject: Re: kern/157722: [geli] unable to newfs a geli encrypted partition
Date: Fri, 10 Jun 2011 15:33:30 +0400

 Hi,
 
 newfs(8) are trying to read a superblock area, but it gets EINVAL
 error code, because you have not initialized your geli provider.
 
 -- 
 WBR, Andrey V. Elsukov

From: Robert Simmons <rsimmons0@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/157722: [geli] unable to newfs a geli encrypted partition
Date: Thu, 1 Mar 2012 22:10:25 -0500

 Please close this bug.  It is not a bug, I failed to read the man page
 completely.
State-Changed-From-To: open->closed 
State-Changed-By: pluknet 
State-Changed-When: Fri Mar 2 05:20:30 UTC 2012 
State-Changed-Why:  
Close per submitter request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157722 
>Unformatted:
