Date: Fri, 14 Dec 2012 11:42:19 +0100 From: rank1seeker@gmail.com To: "Dieter BSD" <dieterbsd@engineer.com>, hackers@freebsd.org Subject: Re: NetBSD's boot select MBR Message-ID: <20121214.104219.547.1@DOMY-PC> In-Reply-To: <20121213221145.310760@gmx.com> References: <20121213221145.310760@gmx.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > So I use NetBSD's MBR for disks I want=0D=0A> > > to boot = from.=0D=0A> >=0D=0A> > Can I have a CMD sequence?=0D=0A> >=0D=0A> > = First would be ...=0D=0A> > # fetch ...=0D=0A> =0D=0A> Read NetBSD's = fdisk(8) and mbr(8).=0D=0A> =0D=0A> The MBR is only 512 bytes, and must = contain the code and data.=0D=0A> This is very limiting, so there are = multiple versions depending=0D=0A> on which features you need. IIRC, = /usr/mdec/mbr_bootsel is the one I use.=0D=0A> You can specify a label = (up to 7 characters) for each bootable partition=0D=0A> ("slice" in = FreeBSD-speak). When the system executes the MBR code,=0D=0A> it presents = a menu with these labels. You can type '1' for the first=0D=0A> = partition/slice, '2' for the second, and so on. You can also type = a=0D=0A> function key to run the MBR of a different disk. The disk = numbering=0D=0A> can be rather insane, so it must be using the bios disk = numbering. If=0D=0A> you don't type anything it times out and boots the = active partition/slice.=0D=0A> =0D=0A> Sadly, the FreeBSD bootstrap = insists on booting the partition/slice=0D=0A> marked active in the MBR. = (The MBR code should look at the active=0D=0A> bit, the later bootstraps = should not.) So if you want to have=0D=0A> multiple FreeBSD versions, it = works best to put each on its own disk.=0D=0A> =0D=0A> The last time I = used fdisk, large disks triggered a bug where some=0D=0A> variable = overflowed, giving negative numbers. Hopefully this is fixed=0D=0A> by = now. FreeBSD's fdisk also had some bug, so I had great fun=0D=0A> = handcrafting a MBR.=0D=0A> =0D=0A> It's been a long time since I = installed NetBSD from scratch, (I usually=0D=0A> just unpack the tar = files, run installboot, and edit some config files.)=0D=0A> I assume you = can just boot a CD and get a shell, and experiment with=0D=0A> fdisk on a = scratch disk without actually installing NetBSD.=0D=0A> To avoid a = disaster, do something like=0D=0A> dd if=3D$DISK of=3D/boot/MBR_backup = bs=3D512 count=3D1 ; sync=0D=0A> beforehand, in case you accidently mess = up your boot drive.=0D=0A> =0D=0A> man pages:=0D=0A> = http://netbsd.gw.com/cgi-bin/man-cgi?++NetBSD-current=0D=0A> =0D=0A> = isos:=0D=0A> http://www.netbsd.org/mirrors/=0D=0A> for example:=0D=0A> = ftp://iso.netbsd.org/pub/NetBSD/iso/5.2/amd64cd-5.2.iso=0D=0A> or=0D=0A> = ftp://iso.netbsd.org/pub/NetBSD/iso/5.2/i386cd-5.2.iso=0D=0A=0D=0A=0D=0AMBR = supports max of 4 slices/partitions.=0D=0A=0D=0ALooing = at:=0D=0Ahttp://netbsd.gw.com/cgi-bin/man-cgi?mbr++NetBSD-6.0=0D=0A=0D=0AThe = '/usr/mdec/mbr_bootsel', which you've mentioned, is equivalent to = FreeBSD's '/boot/boot0', which is tuned via 'boot0cfg' util.=0D=0AIt will = also show menu, to choose from, a slice to boot or another drive OR =3D> = 'F6' to choose PXE boot.=0D=0AIf nothing has been selected, it will = simply boot an active slice.=0D=0ASo I see FreeBSD's, as superior = (additionally supports PXE) =3D> 8.0 onward ...=0D=0A=0D=0AI don't use = fdisk at all. Gpart is here ...=0D=0A;)=0D=0A=0D=0AAdditionally ..., when = I said '# fetch ...', I meant to get only 1 file, from ftp pub, which is = installed into MBR ('/usr/mdec/mbr_$SOMETHING')=0D=0AThen I would use = FreeBSD's:=0D=0A# gpart bootcode -b $path_to_netbsd_mbr_code = ...=0D=0A=0D=0ABut this won't happen, as I thought NetBSD's had a MBR = code, which could be told via a tool, from fully booted and running = FreeBSD:=0D=0A"Active slice is 2, but please, boot slice 4 at a next = boot".=0D=0AAfter that, I would '# reboot' and without any menu, slice 4 = would be booted, for that one time, instaed of an active slice = 2.=0D=0A=0D=0AAm I missing something?=0D=0AThanks in = advance.=0D=0A=0D=0A=0D=0ADomagoj Smol=E8i=E6=0D=0A=0D=0A
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121214.104219.547.1>