From owner-freebsd-questions@FreeBSD.ORG Mon Feb 18 07:25:36 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B1216A420 for ; Mon, 18 Feb 2008 07:25:36 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id A2CC313C459 for ; Mon, 18 Feb 2008 07:25:36 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id m1I7PZ2C057803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 17 Feb 2008 23:25:36 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id m1I7PZ0g057802 for freebsd-questions@freebsd.org; Sun, 17 Feb 2008 23:25:35 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA11351; Sun, 17 Feb 08 23:10:15 PST Date: Sun, 17 Feb 2008 23:05:28 -0800 From: perryh@pluto.rain.com To: freebsd-questions@freebsd.org Message-Id: <47b92e38.PPjllqvtMAVuJE1V%perryh@pluto.rain.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Mounting a read-only md FS as read-only 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: Mon, 18 Feb 2008 07:25:36 -0000 I'm trying to mount an ext2fs image (in a file), following sec. 17.13.2 of the Handbook and the mdconfig(8) manpage. Since I don't want to change the image, just examine it, I specified -o readonly to mdconfig and the equivalent to mount. Is there some reason why this should not work? The backing file, and the mountpoint, do exist. # ls -ld [filename] -rw-r--r-- 1 perryh perryh 104857600 Mar 16 2007 [filename] # mdconfig -a -t vnode -f [filename] -o readonly md0 # ls -ld /dev/md0 /[mountpoint] crw-r----- 1 root operator 1, 15 Nov 24 21:17 /dev/md0 drwxr-xr-x 2 perryh perryh 512 Feb 17 21:57 /[mountpoint] # mount -r -o noexec -t ext2fs /dev/md0 /[mountpoint] mount_ext2fs: /dev/md0: Read-only file system # mount -o ro,noexec -t ext2fs /dev/md0 /[mountpoint] mount_ext2fs: /dev/md0: Read-only file system # /sbin/mount_ext2fs -o ro,noexec /dev/md0 /[mountpoint] mount_ext2fs: /dev/md0: Read-only file system # mdconfig -l -u 0 md0 vnode 100M /[mountpoint] # uname -a FreeBSD fbsd61 6.1-RELEASE FreeBSD 6.1-RELEASE #30: Mon Jan 1 23:01:34 PST 2007 perryh@fbsd61:/usr/src/sys/i386/compile/GENERIC i386