misc/157722: unable to newfs a geli encrypted partition

Robert Simmons rsimmons0 at gmail.com
Thu Jun 9 04:30:11 UTC 2011


>Number:         157722
>Category:       misc
>Synopsis:       unable to newfs a geli encrypted partition
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 09 04:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:


More information about the freebsd-bugs mailing list