Posts Tagged ‘ FreeBSD 7

How to update my sparc FreeBSD install

So the spanking new freebsd- doesn’t work for systems… boo. Have to do everything manually. Here’s what I remember. Let me know if I forgot something, or its wrong.(very likely)

Install cvsup:

# cd /usr/ports/net/cvsup-without-gui/
# make install

install fastest cvsup:


# cd /usr/ports/sysutils/fastest_cvsup/
# make install
# fastest_cvsup -c us

Replace “us” with your country if it’s different. copy the default supfile to our own before editing.


# cp /usr/share/examples/cvsup/stable-supfile /etc/stable-supfile
# cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile

edit both of them and change the


*default host=

to the fastest cvsup server from the “fastest cvsup”

then update the ports


# cvsup -L2 -g /etc/ports-supfile
# cvsup -L2 -g /etc/stable-supfile

Then i guess we try to build the world. see if something breaky.


# cd /usr/src
# make buildworld

Recompiled kernel. I have my own kernel called “MYSPARC2″. Yours might just be “GENERIC”


# cd /usr/src
# make buildkernel KERNCONF=MYSPARC2
# make installkernel KERNCONF=MYSPARC2

rebooted into single user mode then:

# mount -u /
# mount -a -t ufs
# swapon -a

Now you are ready to install the new world.

# cd /usr/src
# make installworld

After that was done, mergemaster to update your configs:

mergemaster -v

Then used portmaster to upgrade all of the ports.

# portmaster -a

Basically everything i know about BSD comes from or stems from something I’ve read at freebsdmadeeasy.com

source: http://www.freebsdmadeeasy.com/tutorials/freebsd/updating-freebsd-with-cvsup.php

webalizer installation on freebsd 7

cd /usr/ports/www/
make
make install
make clean
rehash
mkdir /usr/local/www/
webalizer -o /usr/local/www/stats /var/log/httpd-access_log

After that, just added it to the root crontab
crontab -e

like this:
0 * * * * /usr/local/bin/webalizer -o /usr/local/www/stats /var/log/httpd-access_log > /var/log/webalizer-hourly

That runs every hour, so that the stats are kept up-to-date.

savecore? reboot after panic?

scary. I updated freebsd, and i can only think that i messed it up when i tried to “shutdown -h” to get it shutdown so i could reboot. anyways, when i rebooted, i saw this message. apparently there was a kernel dump on my swap drive. But problem is that i didn’t have enough room on /var/crash to make it happen. i redirected the commands ot the /usr/home/ program.

http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html
fsck -p
mount -a -t ufs
make sure /var/crash is writable
/var/crash /dev/ad0b
exit
exit to multi-user

FreeBSD MYSQL configuration

FreeBSD does not automatically include a default my.cnf for . Instead, a set of sample configuration files can be found under /usr/local/share/mysql. These configuration files include my-small.cnf, my-medium.cnf, my-large.cnf, my-innodb-heavy-4G, and my-huge.cnf. The appropriate file can be copied and used as a template configuration by performing the following actions:
cd /usr/local/share/mysql/
cp /usr/local/share/mysq/mysql-large.cnf /etc/my.cnf
/usr/local/etc/rc.d/mysql-server restart

thanks to http://www.barik.net/archive/2008/05/26/114616/ for the tip.

what not to do in MySQL… and how to pick up the pieces

note to self… do NOT kill processes from phpmyadmin’s control panel and force to quit. Bad things happen. In this case, wouldnt start again. InnoDB’s indexes, binary , etc. were all out of sync. The 20 page log explaining all the ways the DB couldn’t start is located in the DB’s data dir, which in my case was in /dbdisks/<hostname>.err.

To tell mysql to pick up the messy pieces and throw up whats left of your data, edit or create /etc/my.cnf and add this little line to the “[mysqld]” section:

innodb_force_ = 3

The command is talked aboot here the number is btw 1 and 6. bigger the number, the more drastic and desperate it is. I tried 4, and it pulled the tables with no data. 1 gave me nothing. but 3 let me start and mysqldump my .

mysqldump -u root -p <dbname > /path/to/.sql/file

so once the dump was completed, i moved the db data directory, commented out the “innodb_force_recovery” line, and restarted the computer. At restart the db data dir was re-created by mysql. fresh and clean. this deletes EVERYTHING. even users. re-import the data with

mysql -u root <dbname> < /path/to/.sql/file

go ahead and create the users needed, and set root password again. There you go.