From owner-freebsd-geom@FreeBSD.ORG Sun Jun 13 17:14:26 2004 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1B9D16A4CE for ; Sun, 13 Jun 2004 17:14:26 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B69B43D45 for ; Sun, 13 Jun 2004 17:14:26 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5DHEBud087386 for ; Sun, 13 Jun 2004 19:14:12 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: geom@freebsd.org From: Poul-Henning Kamp Date: Sun, 13 Jun 2004 19:14:11 +0200 Message-ID: <87385.1087146851@critter.freebsd.dk> Subject: GEOM class idea... X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2004 17:14:27 -0000 OK, here is one of the more nasty ideas for a GEOM class: Many of us read CD's into iso images, stick them on a harddisk and mount them from there when we need to access them. This usually costs us a md(4) vnode gadget, and that is really a waste. Write a GEOM class which is a slicer, but it needs to work on CD9660 image headers as metadata, and work the following way: Read in the first ISO image onto our archive disk: dd if=/dev/acd0 of=/dev/ad8 bs=2k On close, the disk is tasted, and our "geom_cdarch" class finds a valid CD9660 volume description and attaches to the disk. It extracts the image size from the CD9660 descriptor (offset 0x8050, 32bitLE. Repeated at 0x8054 as 32bitBE) and creates a slice with this ISO image in it. Since there is no valid CD9660 descriptor on the disk right after this image, the remaining free space gets put into a special slice ("ad8.freespace"). To read in the next ISO image: dd if=/dev/acd0 of=/dev/ad8.freespace bs=2k On close the geom_cdarch class looks for a valid CD9660 volume and if it finds one, creates a new slice and recreates the freespace slice with the space now available, and we can repeat the process until we run out of space. Any takers ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.