# how to fix wiped /usr on 7.2



## pippo (Apr 28, 2010)

Faulty usb to sata adapter disoriented my effort to dump|restore a 7.2 installation that refused to get updated.
The usb device kept disconnecting; probably due to overheating in the tiny 2.5" enclosure... It took about an hour to do the dump|restore. It's probably meant for small backup purposes; 250 gb.
I newfs'ed the source disk /usr slice instead of the target. I suspect it is impossible to recover the slice.
I'd like to keep the other slices intact if possible; I do have them on 2 separate disks in the same computer. A third disk is installed with 8.0 which also refuses updating the ports.
Ultimately I want to update/upgrade the 7.2 to 8.0.
What would be the simplest (best) way to go about this?
Is there a way to restore /usr on the 7.2 and then do 
freebsd-update -r 8.0-RELEASE upgrade  ?
Is is possible to use the running 8.0 version to fix the 7.2 on a 
Or might it be simpler to just do a fresh install of 8.0 and reinstall all the ports?
TIA


----------



## DutchDaemon (Apr 29, 2010)

A fresh install of the version you want to use, plus a pristine new ports installation is by far the best option. You can restore missing things (home directories, configuration files maybe?) selectively from your backup.


----------



## pippo (May 1, 2010)

Ok, I am in the midst of another fresh 8.0 installation.
Can't configure Xorg.
This has always given be trouble every time I get an installation working, there's another curve ball coming right at my head!
I've use hal and I've not used hal bet either way it's a pain.
Mouse is usually psm0 (on my system, anyway) but now it seems to be sysmouse...great. I'm not sure even that works as the screen now turns black but there is no arrow!
The log files don't show nvidia driver. Error - from what I have searched, the nvidia kernel module is out of sync. But this is a fresh install. Ok, I do minimal install to begin. So, when I needed sources, I did the stable-supfile thing. So, I can only assume that nvidia is looking for the standard-supfile sources. I did not install the standard (8_0) as that, apparently is the current branch.
So what am I supposed to do?
Should I wipe /src and load the current sources instead and then rebuild the GENERIC kernel? Do I do buildworld or what? This is really getting outrageously kinky.
Maybe I should pos a new thread... but then doing that is another exercise in frustration... Just what is the way to post a new thread when you have searched and not found the answer you wanted?
TIA


----------



## wblock@ (May 1, 2010)

pippo said:
			
		

> Ok, I am in the midst of another fresh 8.0 installation.
> Can't configure Xorg.
> This has always given be trouble every time I get an installation working, there's another curve ball coming right at my head!
> I've use hal and I've not used hal bet either way it's a pain.
> Mouse is usually psm0 (on my system, anyway) but now it seems to be sysmouse...great.



Sounds like you're trying too hard.  If you don't declare the mouse as an input device in xorg.conf, X will try to autoconfig.  Unless you've defeated it with AllowEmptyInput or AutoAddDevices in xorg.conf, or build xorg-server without hal.  So step 1: try without an xorg.conf, or at least without the InputDevice sections.



> I'm not sure even that works as the screen now turns black but there is no arrow!



Does ctrl-alt-f1 and alt-f9 work to switch to console and back?  If so, X is running, you just have defeated the input devices.



> The log files don't show nvidia driver. Error - from what I have searched, the nvidia kernel module is out of sync. But this is a fresh install. Ok, I do minimal install to begin. So, when I needed sources, I did the stable-supfile thing. So, I can only assume that nvidia is looking for the standard-supfile sources. I did not install the standard (8_0) as that, apparently is the current branch.



If the nVidia stuff wants source, it's probably not going to be happy that the source you give it doesn't match the current kernel and world.



> So what am I supposed to do?
> Should I wipe /src and load the current sources instead and then rebuild the GENERIC kernel? Do I do buildworld or what? This is really getting outrageously kinky.



My suggestion would be to update your sources to 8-stable, then build and install them (buildworld/kernel/installworld/mergemaster).  Alternatively, revert to sources that match your current kernel and world.

After that, try your nVidia driver.


----------



## pippo (May 1, 2010)

I sure appreciate your input. At least, someone is listening.
The unexplainable problem is this. And I have installed FreeBSD quite a few times, albeit usually, but not always, with some difficulty.
Now, what puzzles me is that this is a fresh install!
So I can only assume that the GENERIC kernel is fine. It obviously dis not use the sources on the installation as they did not exist before the kernel was built, loaded and installed. This was done from a livefs disk and downloaded via ftp as the source.
It is absolutely clear that the sources were empty since I needed them for some port installation. I started to csup the standard supfile but then I realized that I should be using the stable-supfile. I aborted the download, deleted the files in the src directory and cvsup'd the stable-supfile.
From what I seem to understand from several posts, is that the nvidia driver is looking for the 8_0 sources. How to I determine which sources my kernel is supposed to match.
Doing  a rebuild of the kernel doesn't seem to make much sense as that is what is supposed to have been installed originally (no changes made - and I don't bother making a custom kernel... saves a lot of bother).
It would seem that the problem does come from the nvidia driver.
I do have the nv (nvidia) driver installed and it did work with a previous install but I don't seem to be able to get it right... I used a different monitor but I had not changed the xorg.conf for the new monitor... oddly, it worked...
er... did work until just now... I wanted to check it out before posting and wham! /libexec/ld-elf.so.1: Shared object "librpcsvc.so.4" not found....
so, there goes that thought... but it did work ,,,, I guess that disk is f*cked up.
Ok, so how do I do this simply? check kernel against source...how?


----------



## jb_fvwm2 (May 1, 2010)

"not found"... "required by..."
the latter is probably what needs rebuilding, the
port that produces librpcsvc.so.4 probably was
bumped to so.5 or something (maybe even not installed
yet.)  Post more of the CLI you used and more
of the complete error sentences?


----------



## pippo (May 1, 2010)

I'll leave fixing the other 8.0 installation for later.
Right now I have to figure out how to get Xorg running with the nvidia-driver. I read another post about that but it did not help. I tried using the 8_0  standard supfile to load the src but that didn't change anything either.
I just can't believe that I would have to rebuild the kernel (GENERIC), do a make buildworld and all that crap that is totally ridiculous when you're doing a fresh install. 
I'll be happy to post whatever is necessary if someone can understand what is going on... The system is on an MSI-6758 mboard, 875P Neo chipset or whatever it is, with cpu Pentium 4 at 3ghz and an Nvidia FX5600 video card with 128mb memory, mainboard memory is 4gb. FreeBSD 8.0 has worked before. Installed are apache22, php52, cups, samba, openoffice.org, Firefox 3.6, etc. etc. and I am not about to go through another eternity installing Openoffice.org 3.2. Once was enough... there were no errors... only have to get Xorg to work to check the rest. File manageris fluxbox; never had a problem with.
Any suggestions?


----------



## jb_fvwm2 (May 2, 2010)

Volume 308, Issue 9, of the freebsd-questions list
has a thread explaining setup that *might* work
in that case.  You can probably find the thread
from the web interface to the list, and a few
things in the list might fix the (non-Xorg, if
you are upgrading X etc in May that
complicates issues) problem(s).
...
The thread is about the last week of April 2010


----------



## wblock@ (May 2, 2010)

pippo said:
			
		

> I sure appreciate your input. At least, someone is listening.
> The unexplainable problem is this. And I have installed FreeBSD quite a few times, albeit usually, but not always, with some difficulty.
> Now, what puzzles me is that this is a fresh install!



A fresh install of what version?  8.0-RELEASE, right?



> So I can only assume that the GENERIC kernel is fine. It obviously dis not use the sources on the installation as they did not exist before the kernel was built, loaded and installed. This was done from a livefs disk and downloaded via ftp as the source.
> It is absolutely clear that the sources were empty since I needed them for some port installation. I started to csup the standard supfile but then I realized that I should be using the stable-supfile. I aborted the download, deleted the files in the src directory and cvsup'd the stable-supfile.



Maybe a misunderstanding.  The stable-supfile gets the latest 8-stable sources.  These change almost daily, it's the latest and greatest version of FreeBSD 8.  They are almost certainly different from the older sources that your kernel was built from, likely 8.0-RELEASE.  So if you build some code with the new source, there's a chance that the new code won't find features it expects because you are running an old kernel.

So there are two ways to go: rebuild the system and kernel with the new sources.  Then kernel and source will match.

Or go back to the 8.0-RELEASE source, which your kernel already matches.

uname -r (or -a) will show your kernel version.  As far as sources, the tag in your supfile is probably the easiest way to tell: tag=RELENG_8 is stable, tag=RELENG_8_0 is 8.0-RELEASE (plus security updates, but probably close enough for this purpose).


----------



## pippo (May 4, 2010)

*solved*

Well, it looks like the guilty party for all this is the nvidia driver. I had to try different config options, like not checking the configure for Linux to finally get a message that cleared things up... the video card I have is not the latest and apparently requires the port nvidia-driver-173 and not the latest one (nvidia-driver). I wonder if anyone thought of informing the user about how to determine which driver is the correct one.
However, that still does not clear up the Xorg configuration... it still had to be tweaked and even now, I'm not entirely sure that it's right. When I close Xorg, there is a message that psm0 could not be opened and that it is in use. Maybe that has something to do with fluxbox, but so far Xorg seems to work ok.
Thanks all, for your input. Strange how many absurd error were generated by the wrong configuration... I wonder why the binaried for such programs as Openoffice.org and gimp are so simple when installing on Windoz... why couldn't this be done for the ports or is that what packages are? Sure would beat waiting more than 12 hours to install - especially the many dependencies that one simply does not need.
Cheers. And the times for installation seem to grow with every update.


----------

