Eugene Grosbein
2007-Mar-10 16:19 UTC
devfs promlem: creating new partition in empty slice
Hi! 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? 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. Eugene Grosbein
illoai@gmail.com
2007-Mar-11 04:57 UTC
devfs promlem: creating new partition in empty slice
On 10/03/07, Eugene Grosbein <eugen@kuzbass.ru> wrote:> Hi! > > 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.> 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. Attemting to write to or read from any device node will create it (if possible) or chuck an error. 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. % bsdlabel -w ad4s2 auto % bsdlabel -e ad4s2 You can probably copy and paste those above values if you wish, but putting swap in two different slices of the same disk is a bit . . . unoptimal. If you are going to just use the space as one partition, you can skip the step with the -e flag and proceed to newfs it. % newfs -U -O2 -b 16384 ad4s2a though, if it is over 60G or so, and going to be used for storing larger files (mostly larger than 2 or 3 M), -b 32768 might give better* performance. * Subject to limitations and rash opinions. -- --