On Wed, Feb 13, 2008 at 10:56:42PM +0200, Imre Oolberg wrote: > Hi! > > Thank you for your answer but let me put more clearly the question i had. > > I have two fdisk partitions, this disk has quite ugly layout but i just > tried things out (it had at times four OpenBSD instances :) > > # fdisk sd0 > Disk: sd0 geometry: 1044/255/63 [16777216 Sectors] > Offset: 0 Signature: 0xAA55 > Starting Ending LBA Info: > #: id C H S - C H S [ start: size ] > ------------------------------------------------------------------------ > *0: A6 0 1 1 - 261 22 16 [ 63: 4194304 ] > OpenBSD > 1: B6 0 0 1 - 267349 89 4 [ 0: 0 ] > <Unknown ID> > 2: B6 0 0 1 - 267349 89 4 [ 0: 0 ] > <Unknown ID> > 3: A6 783 64 49 - 1043 254 63 [ 12582975: 4188885 ] > OpenBSD > > /grub/menu.lst is in 3rd fdisk partition's partition 'a'. > > Everything works allright and my question is that is it possible while > booted up with kernel and root filesystem form 0rd fdisk partition to > access 3rd fdisk's 'a' partition? >
It should be possible if you can configure the disklabel to point out the right sectors of fdisk's partition 3 slice a. Since OpenBSD has the notion of "One Disk - One Disklabel", that is a bit quirked on i386 due to the fdisk partitions, I think the disklabel is stored in the first found A6 partition. Grub hopefully hides the inactive A6 partition so therefore you have in effect got two disklabels, or rather alternate between two disklabels. Since apparently it works: boot partition 3 and write down the sector numbers of your slice a, reboot into partition 0 and run disklabel -E. You will have to force disklabel into regarding the whole disk as the BSD section, not only partition 0, through the 'b' command. Then you can destroy anything on the disk, and also create a new slice with the same sector numbers as partition 3 slice a. Good luck! > > Imre > > > Louis V. Lambrecht wrote: > >Imre Oolberg wrote: > >>Hallo! > >> > >>I experimented with OpenBSD 4.2 on i386 platform, made two fdisk > >>partitions on the same disk, into each of them OpenBSD disklabel, > >>installed grub from packages and can successfully dualboot. > >> > >>But i cant figure out if there is a way to access fdisk partition's > >>disklabel partitions while booted up from the other fdisk partition's > >>OpenBSD instance? Ie it seems, that either way e.g. wd0a is a root > >>partition and there isnt a way to point to non-booted-up disklabel's > >>root partition. > >> > >>It doesnt practically impact my use of OpenBSD (workaround could be > >>using two physical disks, for example) but its interesting to know if > >>it is so. > >> > >> > >>Imre > >> > >>PS In /usr/local/share/doc/grub/README.OpenBSD is an hint actually on > >>this > >> > >>... > >>When booting, the kernel will use the disklabel from the first OpenBSD > >>partition found, therefor grub has to set the partition type of unused > >>partitions to another value as can be seen in > >>/usr/local/share/examples/grub/menu.lst. > >> > >> > >>Louis V. Lambrecht wrote: > >> > >>>> .... > >>>> > >>>My way is to use grub. > >>>Has to do with the way OpenBSD default label reads and allocates the > >>>labels in it's default install. > >>>(I never could edit a disklabel correctly). > >>>What I do is to partition the disk to have a second OpenBSD disklabel. > >>>Also, I have my sources and packages(/usr/ports) on yet another slice. > >>>Grub allows me to mark the operating system. > >>> > >>>So, a normal entry for OpenBSD would look like > >>>title openbsd_working > >>>root (hd0,1) > >>>chainloader +1 > >>> > >>>Which I can change for > >>>title openbsd_testing > >>>parttype (hd0,1) 0xB6 > >>>parttype (hd0,2) 0xA6 > >>>root (hd0,2) > >>>chainloader +1 > >>> > >>>Uff course, must change amd revert the working instance to: > >>>title openbsd_working > >>>parttype (hd0,1) 0xA6 > >>>parttype (hd0,2) 0xB6 > >>>root (hd0,2) > >>>chainloader +1 > >>> > >>>Grub let me hide or unhide partitions (which can be usefull if you > >>>try to install an OS > >>>via Anaconda (RedHats and derivates) which read the 0xA6 to be > >>>"active" ad bortk out. > >>>Will try the hide/unhide method on next fresh install. > >>> > >>>Found this method straightforward, foolproof, and not needing to > >>>write any wrappers. > >> > >> > >I see I was incomplete in my former mail: indeed you need to boot GRUB > >from wd0a, > >or ... > >put GRUB in another partition. > >Actually, I have a Debian Linux in an "extended partition" which holds > >the GRUB. > >Always nice to have a Linux around with FFS, UFS and Sun modules and be > >able to, > >at least read, *any* filesystem. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB