From owner-freebsd-stable@FreeBSD.ORG Tue Oct 12 20:41:50 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7E21065672; Tue, 12 Oct 2010 20:41:50 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id DD21F8FC0C; Tue, 12 Oct 2010 20:41:49 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 9DCAEAD91B; Tue, 12 Oct 2010 22:41:48 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Stefan Bethke In-Reply-To: <20101012201938.0E4351CC3E@ptavv.es.net> Date: Tue, 12 Oct 2010 22:41:47 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <37370332-E112-4669-ABE8-0F908AE39566@lassitu.de> References: <20101012201938.0E4351CC3E@ptavv.es.net> To: "Kevin Oberman" X-Mailer: Apple Mail (2.1081) Cc: stable@freebsd.org, Pawel Jakub Dawidek Subject: Re: Label question...why does ufs label vanish on mount? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 20:41:50 -0000 Am 12.10.2010 um 22:19 schrieb Kevin Oberman: >> From: Stefan Bethke >> Date: Tue, 12 Oct 2010 22:01:24 +0200 >>=20 >> Am 12.10.2010 um 20:51 schrieb Kevin Oberman: >>=20 >>> For some reason the /dev/ufs/label entry that geom creates for every = UFS >>> formatted partition is deleted when the device is mounted. This is = not >>> the case for other file systems, though I have not tried them all. = It >>> makes the drive much harder to deal with when you have to keep track = of >>> which physical drive contains the labeled media. It is a particular >>> issue for hald and the tools which depend on it. >>=20 >> In 8, only the ones that are not mounted are removed; they are >> restored on unmount. So when you mount the filesystem via it's = label, >> that entry continues to exist. And it's not limited to any = particular >> label type, I've noticed the same with partitions that I used gmirror >> on. >=20 > Sorry, but my experience in contrary to that. I mount "/dev/ufs/aux" = and > that device name is returned by df(1), but 'ls /dev/ufs' no longer > contains 'aux'. This broke gnome-mount and required patching hald to > ignore device created in /dev/ufs. Otherwise, when the device was > removed, the /dev/ufs device was re-created, a devd creation event > occurred and the partition was immediately re-mounted. It made it > impossible to unplug the USB drive. >=20 > Joe Marcus added a test of the created device to hald so the creation = of > /dev/ufs/aux would be ignored and the device always mounted by the > hardware device name. >=20 > This all works fine for msdosfs systems. The /dev/msdosfs entry does > stay around when the device is mounted as /dev/msdosfs and all is > well. I'd like to see consistent behavior before we get to making > devicekit work with FreeBSD. (devicekit will replace hald some day.) This got me curious, so I fired up my -stable VM. I only tried UFS, but = label entries do not reappear constently, at least in the quick test I = did. And I still don't understand why they get removed in the first = place. root@freebsd8:~# uname -a FreeBSD freebsd8.lassitu.de 8.1-STABLE FreeBSD 8.1-STABLE #2 r212724: = Thu Sep 16 15:22:34 UTC 2010 = root@freebsd8.lassitu.de:/usr/obj/usr/src/sys/MINIMAL amd64 Here's what I tried with a 1 gig stick that probes as: umass0: on = usbus1 (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0=20 (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error (probe0:umass-sim0:0:0:0): SCSI status: Check Condition (probe0:umass-sim0:0:0:0): SCSI sense: UNIT ATTENTION asc:28,0 (Not = ready to ready change, medium may have changed) da2 at umass-sim0 bus 0 scbus1 target 0 lun 0 da2: Removable Direct Access SCSI-0 = device=20 da2: 40.000MB/s transfers da2: 984MB (2015232 512 byte sectors: 64H 32S/T 984C) root@freebsd8:~# gpart create -s gpt /dev/da2 da2 created root@freebsd8:~# gpart add -s 256m -l ufs -t freebsd-ufs da2 da2p1 added root@freebsd8:~# gpart list da2 Geom name: da2 fwheads: 64 fwsectors: 32 last: 2015198 first: 34 entries: 128 scheme: GPT Providers: 1. Name: da2p1 Mediasize: 268435456 (256M) Sectorsize: 512 Mode: r0w0e0 rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b label: ufs length: 268435456 offset: 17408 type: freebsd-ufs index: 1 end: 524321 start: 34 Consumers: 1. Name: da2 Mediasize: 1031798784 (984M) Sectorsize: 512 Mode: r0w0e0 root@freebsd8:~# ls /dev/gpt ufs root@freebsd8:~# ls /dev/gptid bba94c8e-d63f-11df-888c-000c295e330a root@freebsd8:~# newfs -L ufslabel /dev/da2p1 /dev/da2p1: 256.0MB (524288 sectors) block size 16384, fragment size = 2048 using 4 cylinder groups of 64.02MB, 4097 blks, 8256 inodes. super-block backups (for fsck -b #) at: 160, 131264, 262368, 393472 root@freebsd8:~# mount /dev/da2p1 /mnt root@freebsd8:~# ls /dev/gpt root@freebsd8:~# ls /dev/ufs root@freebsd8:~# ls /dev/gptid root@freebsd8:~# umount /mnt root@freebsd8:~# mount /dev/ufs/ufslabel /mnt root@freebsd8:~# ls /dev/da2p1 /dev/da2p1 root@freebsd8:~# ls /dev/gpt root@freebsd8:~# ls /dev/ufs ufslabel root@freebsd8:~# ls /dev/gptid root@freebsd8:~# umount /mnt root@freebsd8:~# ls -l /dev/da2p1 /dev/gpt /dev/gptid /dev/ufs crw-r----- 1 root operator 0, 103 Oct 12 20:34 /dev/da2p1 /dev/gpt: total 0 crw-r----- 1 root operator 0, 111 Oct 12 20:34 ufs /dev/gptid: total 0 crw-r----- 1 root operator 0, 112 Oct 12 20:34 = bba94c8e-d63f-11df-888c-000c295e330a /dev/ufs: total 0 crw-r----- 1 root operator 0, 108 Oct 12 20:34 ufslabel I then unplugged and replugged the stick: root@freebsd8:~# ls -l /dev/da2p1 /dev/gpt /dev/gptid /dev/ufs crw-r----- 1 root operator 0, 103 Oct 12 20:34 /dev/da2p1 /dev/gpt: total 0 crw-r----- 1 root operator 0, 111 Oct 12 20:34 ufs /dev/gptid: total 0 crw-r----- 1 root operator 0, 112 Oct 12 20:34 = bba94c8e-d63f-11df-888c-000c295e330a /dev/ufs: total 0 crw-r----- 1 root operator 0, 108 Oct 12 20:34 ufslabel --=20 Stefan Bethke Fon +49 151 14070811