From owner-freebsd-hackers Wed Oct 2 14:43:45 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA09058 for hackers-outgoing; Wed, 2 Oct 1996 14:43:45 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id OAA09051 for ; Wed, 2 Oct 1996 14:43:41 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA04776; Wed, 2 Oct 1996 14:40:43 -0700 From: Terry Lambert Message-Id: <199610022140.OAA04776@phaeton.artisoft.com> Subject: Re: VPS mailing list, BSD interest? To: kpneal@pobox.com (Kevin P. Neal) Date: Wed, 2 Oct 1996 14:40:43 -0700 (MST) Cc: buhrow@cats.ucsc.edu, gibbs@freefall.freebsd.org, thorpej@nas.nasa.gov, phk@critter.tfs.com, greywolf@siva.captech.com, hackers@FreeBSD.org, tech-kern@NetBSD.ORG In-Reply-To: <1.5.4.32.19961002052637.008e9d0c@mindspring.com> from "Kevin P. Neal" at Oct 2, 96 01:26:37 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk [ ... soft geometry control metadata ... ] > How about storing the data in a private section of the disk, and being able > to export the data into a flat file, human readable? Then also being > able to parse the output file and restore it onto the disk? > > I mean, the mount command on some (all?) systems can generate an fstab. > Why not the virtual disk device? Actually, you want each device to be able to do several things: 1) Ennumerate partitioning allowed on this logical or physical device 2) Determine partitioning currently present on this device 3) Manipulate partitioning currently present on this device 4) Export additional device based on active partitioning Thus: struct pt_enum pterec; /* partition entry records*/ struct pt_contrl ptectrl; /* partition entry control*/ struct pt_data ptdata; /* partition table entry*/ int fd; int cnt = 0 fd = open( devname, O_RDWR); /* get available partitioning*/ pterec.index = 0; while( ioctl( fd, PTIO_ENUMALL, &pterec)) { /* get list of allowable partitioning schemas*/. strcpy( list[ cnt], pterec.name); cnt++; } /* list/select paritioning*/ if( ioctl( fd, PTIO_GETACT, &ptectrl) == 0) { printf( "Current partitioning is %s\n", list[ ptectrl.type]); ... } else { int i; printf( "Not partitioned. Available partitioning:\n"); for( i = 0; i < cnt; i++) { printf( " %2d. %s\n", i, list[ i]); } ... } /* display partitions present on device*/ ptdata.index = 0; while( ioctl( fd, PTIO_ENUMACT, &ptdata) { printf( "partition %i (in blocks):\n", ptdata.index - 1); printf( " relative start: %d\n", ptdata.pd_rstart); printf( " relative end : %d\n", ptdata.pd_rend); printf( " total length : %d\n", ptdata.pd_length); printf( " physical start: %d\n", ptdata.pd_start); printf( " physical end : %d\n", ptdata.pd_end); printf( " device name : %s/%s\n", devname, ptdata.pd_dnam); printf( "\n"); } One tool handles all partitioning tasks... for all partitioning schemas. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.