Bug 157722 - [geli] unable to newfs a geli encrypted partition
Summary: [geli] unable to newfs a geli encrypted partition
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-09 05:30 UTC by rsimmons0
Modified: 2012-03-02 05:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rsimmons0 2011-06-09 05:30:10 UTC
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

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.
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
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-06-09 22:23:47 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Reclassify and assign.
Comment 2 Andrey V. Elsukov freebsd_committer freebsd_triage 2011-06-10 12:33:30 UTC
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
Comment 3 rsimmons0 2012-03-02 03:10:25 UTC
Please close this bug.  It is not a bug, I failed to read the man page
completely.
Comment 4 Sergey Kandaurov freebsd_committer freebsd_triage 2012-03-02 05:20:30 UTC
State Changed
From-To: open->closed

Close per submitter request.