From owner-freebsd-stable@FreeBSD.ORG Sun Mar 11 05:33:08 2007 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEB1C16A400 for ; Sun, 11 Mar 2007 05:33:08 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.freebsd.org (Postfix) with ESMTP id 4341F13C471 for ; Sun, 11 Mar 2007 05:33:07 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (eugen@localhost [127.0.0.1]) by www.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id l2B5FMan011075; Sun, 11 Mar 2007 12:15:22 +0700 (KRAT) (envelope-from eugen@www.svzserv.kemerovo.su) Received: (from eugen@localhost) by www.svzserv.kemerovo.su (8.13.8/8.13.8/Submit) id l2B5FMkB011074; Sun, 11 Mar 2007 12:15:22 +0700 (KRAT) (envelope-from eugen) Date: Sun, 11 Mar 2007 12:15:22 +0700 From: Eugene Grosbein To: "illoai@gmail.com" Message-ID: <20070311051522.GA8421@svzserv.kemerovo.su> References: <20070310161908.GA3238@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: stable@freebsd.org, Eugene Grosbein Subject: Re: devfs problem: creating new partition in empty slice 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: Sun, 11 Mar 2007 05:33:09 -0000 On Sat, Mar 10, 2007 at 10:30:21PM -0600, illoai@gmail.com wrote: > >There is FreeBSD 6.2-STABLE (updated yesterday) having single > >SATA drive. The drive has two equal-sized slices ad4s1 and ad4s2, > >both marked with sysid 165 (FreeBSD). > > > >The system occupies ad4s1 (partitions from a to h), > >and ad4s2 is empty. This scheme was created at installation time > >with sysinstall started by system boot CD (official disk1). > > > >Now, when the system is up and running, I need to create partitions > >within slice ad4s2. Questions are: > > > >1. Do I really need 'sysctl kern.geom.debugflags=16' > >if I do not want to touch MBR or living slice at all, and why, if I do? > > In my experience (for this type of use) no. You do not need > to set the sysctl. Sysinstall insists on that to proceed. Erroneously? > >2. How should I create new partitions within ad4s2? I've tried > >to use sysinstall, it fills bsdlabel right but fails to newfs/mount > >new partitions because device nodes do not exist. So now I have this: > > > ># bsdlabel ad4s2 > ># /dev/ad4s2: > >8 partitions: > ># size offset fstype [fsize bsize bps/cpg] > > a: 524288 2097152 4.2BSD 0 0 0 > > b: 2097152 0 swap > > c: 78702435 0 unused 0 0 # "raw" part, > > don't edit > > d: 524288 2621440 4.2BSD 0 0 0 > > e: 4194304 3145728 4.2BSD 0 0 0 > > f: 20971520 7340032 4.2BSD 0 0 0 > > g: 20971520 28311552 4.2BSD 0 0 0 > > h: 29419363 49283072 4.2BSD 0 0 0 > > > ># ls -l /dev/ad4s2* > >crw-r----- 1 root operator 0, 75 10 อมา 14:53 /dev/ad4s2 > >crw-r----- 1 root operator 0, 84 10 อมา 14:53 /dev/ad4s2c > > > >What should I do now to get needed device nodes? The server is remote one, > >it runs in production and I'd prefer to not reboot it. > > The device nodes are automagically created and managed > on all versions of FreeBSD after 5.0. More precisely, they should be automagically created, but they are not in this case. > Attemting to write to > or read from any device node will create it (if possible) or > chuck an error. # true > /dev/ad4s2a bash: /dev/ad4s2a: Operation not supported I don't think it is not possible for devfs to create device node but it does not. Why? > It appears that the bsdlabel from ad4s1 is also being read, > or has been copied to, ad4s2. You might want to > % fdisk ad4 > and assure yourself that the slices do not overlap before > continuing. They do not overlap: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 77593887 (37887 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 1/ sector 63 The data for partition 2 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 77593950, size 78702435 (38428 Meg), flag 80 (active) beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 14/ sector 63 The data for partition 3 is: The data for partition 4 is: By the way, I doubt that sysinstall would create overlaping slices. And labels was not "copied". I manually duplicated partitioning of first slice in the second using sysinstall to learn how such task should be done in 6.x. I did not encounter such problems in 2.2.x, 3.x and 4.x where device nodes must be created manually with /dev/MAKEDEV. Now, either I did not read some manual (I did read recent Handbook, though) or this is a bug. > % bsdlabel -w ad4s2 auto > % bsdlabel -e ad4s2 > You can probably copy and paste those above values > if you wish, Thanks a lot! Bsdlabel did a trick and missing device nodes have appeared. > but putting swap in two different slices of > the same disk is a bit . . . unoptimal. I have no intent to use both swap partition at the same time really :-) So I think there is a time to discover why bsdlabel leads to automagical rising of device nodes but sysinstall does not... Eugene Grosbein