From owner-freebsd-questions@FreeBSD.ORG Sun Jun 11 14:55:41 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3D2616A41B for ; Sun, 11 Jun 2006 14:55:41 +0000 (UTC) (envelope-from nospam@mgedv.net) Received: from mail.mgedv.net (mail.mgedv.net [81.223.168.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF57C43D4C for ; Sun, 11 Jun 2006 14:55:40 +0000 (GMT) (envelope-from nospam@mgedv.net) Received: from metis (sslint.my.loop [1.1.1.1]) by mail.my.loop (mgedv) with ESMTP id 023BA45787 for ; Sun, 11 Jun 2006 16:55:38 +0200 (CEST) From: "no@spam@mgedv.net" To: Date: Sun, 11 Jun 2006 16:55:42 +0200 Message-ID: <000001c68d67$1ce42720$01010101@avalon.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcaNZxwZhl/lUZfARdCPtQQ8hfHGDw== Subject: /dev nodes population errors with GELI/bsdlabel X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jun 2006 14:55:42 -0000 well. i'm quit sure, it's a little bit complicated to explain what i did and what i figured out while i was doing it ;-), but: short description: attach->mount->umount->detach->attach->mount of GELI-encrypted filesystems does not work correctly if the fs is on a bsdlabel- partition inside the geli-provided device (/dev/???.eli). after detach, the bsdlabel-created devicefiles /dev/???.elia are left and after re-attach, they get duplicated (SAME NAME) inside /dev. the long version: the hardware is as follows: intel P4, 2.4, 768MB RAM ad0 (my root disk): a SEAGATE 40GB UDMA-100 disk ad4 (my test disk): a HITACHI 400GB UDMA-133 disk i installed 6.1-RELEASE on ad0 as follows: ad0s1a: / ad0s1b: (not used currently) the test-disk i originally configured using: dd if=/dev/random of=/dev/ad4 bs=1m; dd if=/dev/random of=/ad4.key bs=1024 count=256; geli init -v -P -a AES -l 256 -K /ad4.key -s 4096 /dev/ad4; geli attach -p -k /ad4.key /dev/ad4; bsdlabel -w /dev/ad4.eli; newfs -m 0 -o space /dev/ad4.elia; mount -o rw,noatime /dev/ad4.elia /test now, without storing any data on /test, everything seemed to be ok. df showed the ~373GB being available on /test, nice. playing around with the volume i also mounted/unmounted it. umount /test; geli detach /dev/ad4; works fine. /dev/ad4.eli and /dev/ad4.elia were removed. attaching the disk again with (with auto-detach enabled!): geli attach -d -p -k /ad4.key /dev/ad4 and mounting it with: mount -o rw,noatime /dev/ad4.elia /test and finally again unmounting it with: umount /test; should automatically detach the device. and indeed, this action is being logged to console/dmesg from GELI as soon as i unmount it. now, checking the files in /dev i STILL find a /dev/ad4.elia, but /dev/ad4.eli is gone. if i try to re-attach the GELI-disk, i get the file /dev/ad4.eli back and i get 2 instances of /dev/ad4.elia, which renders the device unusable. this behaviour cannot be corrected until a reboot. changing the /test disk from bsdlabel-layout to: dd if=/dev/random of=/dev/ad4 bs=1m; dd if=/dev/random of=/ad4.key bs=1024 count=256; geli init -v -P -a AES -l 256 -K /ad4.key -s 4096 /dev/ad4; geli attach -p -k /ad4.key /dev/ad4; newfs -m 0 -o space /dev/ad4.eli; mount -o rw,noatime /dev/ad4.eli /test works fine and attach->mount->umount->detach (manual and auto) behaves well and can be performed many times... if there's some further interest on that by someone, i probably can add some outputs/geli-debugs later. (box not networked now) ps: don't cc me, i'm on the list...