Hello, I would like to know if it is possible to rebuild world, but without upgrading or even compiling the kernel. The problem is such : I am presently working on a FreeBSD station that seems to have quite a lot of problem, notably with fsck. I am starting to wonder whether this BSD station was properly installed, or if some of the system tools were pasted from older FreeBSD setup. Since the machine is in a remote location, I would prefer to avoid full reinstall if possible. Among other things, single user mode is not available. So I was wondering, if I get the full sources with sysinstall, can I make buildworld and then installworld without going through the kernel phase or would this be a bad idea ? Thanks for your help Jerome Herman
On Tue, Jul 26, 2011 at 01:04:04PM +0200, Jerome Herman wrote:> I would like to know if it is possible to rebuild world, but without > upgrading or even compiling the kernel. > > The problem is such : I am presently working on a FreeBSD station > that seems to have quite a lot of problem, notably with fsck. I am > starting to wonder whether this BSD station was properly installed, > or if some of the system tools were pasted from older FreeBSD setup. > Since the machine is in a remote location, I would prefer to avoid > full reinstall if possible. Among other things, single user mode is > not available. > > So I was wondering, if I get the full sources with sysinstall, can I > make buildworld and then installworld without going through the > kernel phase or would this be a bad idea ?Is it possible? Yes. Is it a bad idea? Generally yes. World and kernel effectively need to be "in sync"; some kernel binary structures (particularly for things like libkvm) need to be what userland binaries expect them to be. Nobody will be able to provide any support for this configuration. If you're trying to do things ""in phases"" because of this "fsck problem" (see below for more on that), then please be sure that after you rebuild world and reinstall world, that you DO NOT empty out /usr/obj before rebuilding kernel/reinstalling kernel. The kernel build does refer to things in /usr/obj which were built as a result of buildworld. All that said: can we please get some deeper insight as to this "problems with fsck" you're referring to? I'm of the strong opinion that it's better to try and solve the root cause of an issue than do "hackish stuff" like the above (though it's not that hackish, you get what I mean I hope). I don't understand how fsck would cause you a problem unless the machine is constantly losing power or has serious issues with its storage. Are you sure the problem, for example, isn't with the underlying storage device (disk)? If you aren't sure, would you like to verify that's not the problem piece? If so, please post some details like: * dmesg * Contents of /etc/fstab * sysctl kern.disks If the disks are backed by ata(4): * atacontrol list * atacontrol cap XXX (where XXX = each disk shown in kern.disks) If the disks are backed by ada(4) or are SCSI (da(4)): * camcontrol devlist * For ada(4) disks only: camcontrol identify XXX * For da(4) disks only: camcontrol inquiry XXX And regardless of if ata(4), ada(4), or da(4): * smartctl -a /dev/XXX (where XXX = each disk shown in kern.disks; this will require you install ports/sysutils/smartmontools first) I can assist with the disk analysis portion in particular. And with regards to smartctl, please try to ensure the output doesn't get munged (forced line wrapping, newlines injected, etc.). It makes it more difficult to read. Put the output up on the web if you're worried about this. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |
On 2011-07-26 13:04, Jerome Herman wrote:> I would like to know if it is possible to rebuild world, but without > upgrading or even compiling the kernel. > > The problem is such : I am presently working on a FreeBSD station that > seems to have quite a lot of problem, notably with fsck. I am starting > to wonder whether this BSD station was properly installed, or if some of > the system tools were pasted from older FreeBSD setup. > Since the machine is in a remote location, I would prefer to avoid full > reinstall if possible. Among other things, single user mode is not > available. > > So I was wondering, if I get the full sources with sysinstall, can I > make buildworld and then installworld without going through the kernel > phase or would this be a bad idea ?If you build world from *exactly* the same sources your currently running kernel was built from, then yes, it should work. That is, if you are not running with kern.securelevel >= 1. If you build world from newer sources, however, all bets are off. It might work, but also fail in various interesting ways. :)
On Tue, 2011-07-26 at 13:04 +0200, Jerome Herman wrote:> Hello, > > I would like to know if it is possible to rebuild world, but without > upgrading or even compiling the kernel. > > The problem is such : I am presently working on a FreeBSD station that > seems to have quite a lot of problem, notably with fsck. I am starting > to wonder whether this BSD station was properly installed, or if some of > the system tools were pasted from older FreeBSD setup. > Since the machine is in a remote location, I would prefer to avoid full > reinstall if possible. Among other things, single user mode is not > available. > > So I was wondering, if I get the full sources with sysinstall, can I > make buildworld and then installworld without going through the kernel > phase or would this be a bad idea ? > > Thanks for your help > > Jerome Herman`make buildworld installworld` won't build and install new kernel at all, so that basically answers your first question. You'd need to use `make buildworld installworld kernel` for that effect. To answer your other concern - reinstalling FreeBSD "on the fly" should be without any issues as long as you use the right src revisions corresponding to your current system (and kernel). Mixing worlds and kernels of different revisions should *mostly* work if there were no ABI changes during that time period, but you probably don't want trying this blindly without any means of recovery. Basically - it's doable, but I wouldn't do it with just a single shot on my disposal. Note that you don't necessarily need to install a new kernel in single user mode. While this is generally a good practice and a "safer way to do things", I haven't even done this for half a decade, and I'm re/installing FreeBSD builds practically on a daily basis. My advice: Personally, I'd consider it much safer to roll a new build of kernel along with the world, but again, that's just me. As you're already fully rebuilding a possibly broken installation (which you didn't do and thus don't know everything that might be rotting inside), chances of some magical failure are already pretty decent. Rolling an up-to-date kernel with the rest of the world shouldn't make them any lower, on the opposite, might even raise your chances of a successfull reboot. m. PS: Whatever that means, please don't get your sources through "sysinstall", that monster shouldn't even be present in a seriously maintained FreeBSD installation. Get your sources "the proper way" with csup: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html (note - "csup", not "cvsup", it's explained on the page in detail) -- Michal Varga, Stonehenge (Gmail account)
On 26/07/2011 15:01, Lars Eighner wrote:> On Tue, 26 Jul 2011, Jerome Herman wrote: > >> Hello, >> >> I would like to know if it is possible to rebuild world, but without >> upgrading or even compiling the kernel. >> >> The problem is such : I am presently working on a FreeBSD station >> that seems to have quite a lot of problem, notably with fsck. I am >> starting to wonder whether this BSD station was properly installed, >> or if some of the system tools were pasted from older FreeBSD setup. > > You should look into the problems you have without borrowing trouble. > >> Since the machine is in a remote location, I would prefer to avoid >> full reinstall if possible. Among other things, single user mode is >> not available. > >> >> So I was wondering, if I get the full sources with sysinstall, can I >> make buildworld and then installworld without going through the >> kernel phase or would this be a bad idea ? > > You do not have to enter single user mode to make kernel. You "should" > enter single user mode to install world. And in any event, you have > to be > able to reboot the machine. > > Actually, it is not absolutely necessary to enter single-user mode to > install world, but you have to kick all the users off, shut down the > daemons, and sync the discs. This can be difficult and error-prone. And > you have to be able to reboot the machine. If you can reboot the > machine, I > don't quite understand why you cannot enter single-user mode. > > I strongly suggest you document the problems you are having with fsck and > any other system tools to obtain an accurate diagnosis of those problems.I sure wil if the problem arises in a "sane" environment. But here, I realized that my setup was twisted, probably due to an unholy mix of FreeBSD versions. I do not want to get people to try to figure out a problem that only arise when people installing the OS where drunk. Right now I am at step one : "make sure your system looks like something we might be able to support". This box is supposed to be a 8.2, so I am trying hard to make it a real 8.2. Step two will be "make a long and clever bug report stating everything you did and what you expected in result" Step three "Find the bug, submit a patch, be the hero of the day" will be someone else... sadly.> >