man init
Helllo, I am trying to figure out why my system (3.7) comes up in single user mode, so I am working my way through the man pages. man init: The init program is the last stage of the boot process. It normally runs the automatic reboot sequence as described in reboot(8), and if this succeeds, begins multi-user operation. If the reboot scripts fail, init commences single-user operation by giving the superuser a shell on the console. Could somebody explain to me why init is calling reboot and how reboot can succeed without actually rebooting the system? -- Leo Baltus Good judgement comes with experience. Experience usually comes from bad judgement.
openbsd multiboot
Hi, I would like to have more than one openbsd root filesystem on my hardrive. Could somebody please explain how to go about this? In a linux environment I could set up 2 lv's and point to each of them by kernel commandlines. Using openbsd I could use multiple bios-partitions each having an a: label but how do I tel the bootloader to use a specific partition? Maybe there is a way I didn't think of, please let me know. -- Leo Baltus
Re: openbsd multiboot
Op 21/05/2008 om 01:10:05 +0300, schreef Imre Oolberg : > Some time ago i did experiment with dual-booting (actually > multi-booting) from one harddisk several OpenBSD instances, for the sake > of fun. I settled to using dualboot OpenBSD to make upgrades more > suitable for me (just unpacking new distribution's file sets under /mnt > mounted empty partition and rebooting). Right, that's what I am aiming at. > But as i see it there is to ways of having multiple root i.e. a > partitions on one physical harddisk > > 1. Use only one fdisk partition and in it one OpenBSD root is normal a > partition and another is in the same disklabel, say g. And so for > example in this disklabel a, d, e, f partitions belong to one instance > and g is another (consisting of one filesystem). Two instances share > only swap partition. > > To select between them you need to say at boot> prompt > > boot> boot hd0a:/bsd > > or > > boot> boot hd0g:/bsd > > 2. Use severaly fdisk partitions, each has its own disklabel and this > disklabel is dedicated to one OpenBSD instance. OpenBSD bootloader is on > > To select between instances you need to use grub bootloader from binary > packages > > # pkg_add grub Ah, good OLD grub to the rescue. Thanks, I was staring at openbsd's boot, but it doesn't seem to have the configurability that e.g. grub has. > It goes like this that grub's first stage is in the harddisk's MBR and > openbsd bootloader's first stage is installed into each fdisk partition, > i.e. you use chainloading. > > See also > > /usr/local/share/doc/grub/README.OpenBSD > /usr/local/share/examples/grub/menu.lst > > Essential is to understand that OpenBSD uses first fdisk's OpenBSD A6 > disklabel it sees. Thats why grub fiddles with them. I am now totally confused about openbsd disk device naming schema. As I now see it /dev/wd0a refers tho the first ide disk with id 6B (OpenBSD), label a. As it is the one elected by boot to be the rootfs. It would make more sense to me to have en naming schema, which refers to wd$idedisk$partition$label Now, how can I mount, let's say, the fourth partition, on which I only want menu.lst to reside on. this can bee a tiny filesystem, with no OS. So I can mkfs /dev/$whatever mount /dev/$whatever /grub cp /usr/local/share/examples/grub/menu.lst /grub and move on. > Leo Baltus wrote: > >I would like to have more than one openbsd root filesystem on my > >hardrive. Could somebody please explain how to go about this? > > > >In a linux environment I could set up 2 lv's and point to each of them > >by kernel commandlines. > > > >Using openbsd I could use multiple bios-partitions each having an a: label > >but how do I tel the bootloader to use a specific partition? > > > >Maybe there is a way I didn't think of, please let me know. > > -- Leo Baltus
Re: openbsd multiboot
Op 23/05/2008 om 15:57:52 +0100, schreef Jonathan Thornburg : > > I would like to have more than one openbsd root filesystem on my > > hardrive. Could somebody please explain how to go about this? > [[...]] > > Using openbsd I could use multiple bios-partitions each having an a: label > > but how do I tel the bootloader to use a specific partition? > > I have kept two copies of OpenBSD on my laptop for a long time (going > back to 2.8, I think). I've described my scheme in this list several > times, eg <http://archives.neohapsis.com/archives/openbsd/2005-05/1384.html>. I like it. > Basically I keep a single fdisk partition containing the entire disk, > but two sets of OpenBSD root, usr, and now var partitions inside that, > both sharing /home and /data (where I keep my user files): > wd0a rootfstab mounts root, usr, var, home, data > wd0b swap > wd0c entire disk > wd0d root2 fstab mounts root2, usr2, var2, home, data > wd0e var > wd0f var2 > wd0g usr > wd0h usr2 > wd0j home > wd0k data > > I use the standard OpenBSD bootloader; typing "boot wd0a:/bsd" > (or just doing nothing and waiting for the 5 second default timeout) > boots the wd0[aeg] set of partitions, while "boot wd0d:/bsd" boots > the wd0[dfh] partitions. > > I normally boot & run from the wd0[aeg] partitions; currently these > contain OpenBSD 4.3-release, while wd0[dfh] contain 4.2-stable. When > I do an OS upgrade or reinstall, I only do one of the two sets of > partitions, leaving the other unchanged as a backup. For example, > prior to a few weeks ago, both partition sets contained 4.2-stable; > when I was ready to install 4.3-release I first copied (dump|restore > and then running installboot on the wd0d /boot) the wd0[aeg] partitions > to the wd0[dfh] partitions, and verified that I could boot & run > normally from the wd0[dfh] partitions. (In fact, as a test I ran > from them for 5 days or so before finally doing the 4.3-release > install.) This way if anything had gone wrong with the 4.3-release > install (nothing did), I could have aborted and rebooted from the > wd0[dfh] ones and (still) had a working computer. This is still pretty obtrusive, i.e. making a backup, then overwrite filesystems you normally use, hoping the backup is a copy you can rely on. This would all be unnecessary if the bootloader could be informed that it should boot from wd0d:/bsd from now on, so you could leave wd0a: et. all unharmed. Is there really no way to do that, other than by typing it on the boot prompt? Alternatively, is there a way to safely switch labels in the labeleditor, so that wd0a would become wd0d and vice versa? -- Leo Baltus
not a tty
Hi, Could somebody please point me in the right direction? I am setting up a chroot environment in openbsd-4.3 and I expect a shell with a tty. I think I narrowed it down to: as root: r=/tmp/root mkdir $r cd $r mkdir -p bin cp /bin/sh bin mkdir -p usr/bin cp /usr/bin/tty usr/bin mkdir -p usr/lib cp /usr/lib/libc.so* usr/lib mkdir usr/libexec cp /usr/libexec/ld.so usr/libexec mkdir dev cp /dev/MAKEDEV dev ( cd dev; sh MAKEDEV all; ) chroot $r /bin/sh tty not a tty Where I am going wrong? -- Leo Baltus
Re: not a tty
Op 27/08/2008 om 15:33:33 +0200, schreef Heinrich Rebehn : > Josh Grosse wrote: > >On Wed, 27 Aug 2008 14:54:06 +0200, Otto Moerbeek wrote > > > >>Likely /tmp is mounted nodev > > > >I don't think so. I can replicate Leo's exact sequence when /tmp is > >mounted > >dev. If it is mounted nodev, you get warning messages that there is no > >controlling tty when you start the shell. With dev, you get no warning > >message and the chrooted environment works as expected, except for the > >result > >from tty(1). > > > > # mkdir -p /tmp/root/var/run > # cp -p /var/run/dev.db /tmp/root/var/run > # chroot /tmp/root sh > # tty > /dev/ttyp0 > > > found with ktrace(1) Wow, thanks. -- Leo Baltus