FreeBSD: Difference between revisions
(90 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Documentation= | |||
*[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ The handbook] | *[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ The handbook] | ||
*[http://www.freebsdmadeeasy.com/ FreeBSD made easy] | |||
*[http://www.freebsddiary.org/ The FreeBSD Diary] | |||
*http://www.freebsdwiki.net/ | |||
*[http://www.freebsd-howto.com/ http://www.freebsd-howto.com/] | |||
*[http://www.freebsd.org/releng/ the releng stuff] | |||
*[http://motoyuki.bsdclub.org/BSD/cvsup.html How to build *BSD CVSup mirror] | |||
*[http://sixshooter.v6.thrupoint.net/jeroen/faq.html UFS FAQ] | |||
*[[FreeBSD Jails]] | |||
*[http://www.in-ulm.de/~mascheck/locale/ Locales] | |||
*[[Fixing FreeBSD with Fixit]] | |||
*[http://wiki.freebsd.org/HAST Highly Available Storage] ([[HAST]]) | |||
*[http://people.freebsd.org/~hmp/utilities/satbl/vfs_sysctl.html sysctl] | |||
==Tips and Tricks= | ===NFS=== | ||
*http://freebsd.peon.net/quickies/5/ | |||
*http://www.freebsd.org/doc/en/books/handbook/network-nfs.html | |||
==Ports== | |||
*http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html | |||
==Filesystems== | |||
*[[UFS]] | |||
*[[ZFS]] | |||
==Networking== | |||
*http://www.erudition.net/freebsd/NAT-HOWTO | |||
*[http://www.mail-archive.com/freebsd-ipfw%40freebsd.org/msg00528.html natd examples] | |||
*http://freebsd.rogness.net/redirect.cgi?basic/nat.html | |||
===ipfw=== | |||
*[http://www.freebsd-howto.com/HOWTO/Ipfw-HOWTO ipfw-HOWTO] | |||
*http://www.onlamp.com/pub/a/bsd/2001/04/25/FreeBSD_Basics.html | |||
===ipv6 on freebsd=== | |||
*[[IPv6 on FreeBSD]] | |||
===port forwarding=== | |||
*http://www.defcon1.org/natd.html | |||
*http://www.erudition.net/freebsd/NAT-HOWTO | |||
*http://freebsd.rogness.net/redirect.cgi?basic/nat.html | |||
=Tips and Tricks= | |||
*man intro | |||
*man tuning | *man tuning | ||
*mergemaster | |||
*man pw | |||
sysinstall | |||
cd /sys/i386/conf ; make LINT | |||
==Rescue== | |||
*[http://freebsdhowtos.com/25.html System: Accessing a dead freebsd installation] | |||
==Snapshots== | |||
*http://people.freebsd.org/~rse/snapshot/ | |||
==Kernel modules== | |||
kldload kldstat etc | |||
==Hardware info== | |||
kenv (also shows hw vendor, model number etc) | |||
pciconf -lv | |||
grep -i cpu /var/run/dmesg.boot | |||
sysctl hw.ncpu | |||
==Checking resources== | |||
===avialable memory=== | |||
grep memory /var/run/dmesg.boot | |||
top | |||
systat -pigs | |||
fstat -f /var | |||
systat -vm | |||
iostat | |||
gstat | |||
vmstat | |||
pstat | |||
sockstat | |||
==Building a kernel== | |||
*http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html | |||
cd /usr/src/sys | |||
==Serial console== | |||
*http://www.freebsd.org/doc/en/articles/console-server/freebsd.html | |||
*http://www.freebsd.org/doc/en/books/handbook/serialconsole-setup.html | |||
Assuming you want to use keyboard/video as well as serial: | |||
echo "-D" > /boot.config | |||
In /boot/loader.conf: | |||
boot_multicons="YES" | |||
boot_serial="YES" | |||
comconsole_speed="115200" | |||
console="comconsole,vidconsole" | |||
In /etc/ttys: | |||
ttyd0 "/usr/libexec/getty std.9600" vt100 on secure | |||
==Mount CDROM== | |||
http://www.freebsddiary.org/iso-mount.php | |||
==Check network traffic== | |||
systat -ifstat 1 | |||
trafshow | |||
=FAQ= | |||
==Upgrading== | |||
*http://people.freebsd.org/~rse/upgrade/ | |||
*[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html Rebuilding world] | |||
cd /usr/src | |||
make buildworld | |||
make buildkernel KERNCONF=mykernel | |||
make installkernel KERNCONF=mykernel | |||
or | |||
portupgrade -P -f -a | portupgrade -P -f -a | ||
==Courier-imap certificates== | |||
check out /usr/local/share/mkimapdcert | |||
==crontab: temp file must be edited in place== | |||
Happens when you set EDITOR=vim. Fix it by setting '':set nobackup'' and '':set nowritebackup'' in .vimrc | |||
==ping: sendto: Permission denied== | |||
That's when you try to ping from inside a jail. | |||
sysctl: | |||
security.jail.allow_raw_sockets: 0 | |||
===Timezones, date and time settings=== | |||
*http://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/ | |||
*adjkerntz | |||
*tzsetup | |||
*[[ntp]] | |||
[[Category: System Administration]] | |||
==Ports== | |||
===Post install messages=== | |||
/usr/ports/*/*/pkg-message | |||
===exclude from csup=== | |||
To exclude for example /usr/ports/japanese, put in /var/db/refuse | |||
ports/japanese | |||
sample: /usr/src/share/examples/cvsup/refuse | |||
(or a refuse file in whatever base you defined in supfile) | |||
===config options used for a port=== | |||
/var/db/ports/*/options | |||
===ssh taking a long time=== | |||
In /etc/ssh/sshd_config | |||
UseDNS no | |||
===files installed by ports=== | |||
/var/db/pkg | |||
===Using large ( >2T ) drives=== | |||
gpt create mfid1 | |||
create a 'slice' of 200000 sectors (this will automagically create /dev/mfid1p1 | |||
gpt add -s 2000000 mfid1 | |||
create one taking up the rest (/dev/mfid1p2) | |||
gpt add mfid1 | |||
===Migrate users/accounts=== | |||
http://www.ggis.biz/wiki/index.php/FreeBSD_-_Migrate_Users | |||
After editing /etc/master.passwd run | |||
pwd_mkdb /etc/master.passwd | |||
(careful with this not entirely tested advice ) | |||
===truss: cannot open /proc/curproc/mem: No such file or directory=== | |||
kldload procfs | |||
mount_procfs /dev/procfs /proc | |||
But you're supposed to use sysctl? | |||
==Networking== | |||
===Set default route=== | |||
route add default 10.0.0.1 | |||
===Delete default route=== | |||
route delete default | |||
===rm: Operation not permitted=== | |||
ls -lo | |||
chflags noschg |
Latest revision as of 10:46, 11 July 2012
Documentation
- The handbook
- FreeBSD made easy
- The FreeBSD Diary
- http://www.freebsdwiki.net/
- http://www.freebsd-howto.com/
- the releng stuff
- How to build *BSD CVSup mirror
- UFS FAQ
- FreeBSD Jails
- Locales
- Fixing FreeBSD with Fixit
- Highly Available Storage (HAST)
- sysctl
NFS
Ports
Filesystems
Networking
ipfw
ipv6 on freebsd
port forwarding
- http://www.defcon1.org/natd.html
- http://www.erudition.net/freebsd/NAT-HOWTO
- http://freebsd.rogness.net/redirect.cgi?basic/nat.html
Tips and Tricks
- man intro
- man tuning
- mergemaster
- man pw
sysinstall
cd /sys/i386/conf ; make LINT
Rescue
Snapshots
Kernel modules
kldload kldstat etc
Hardware info
kenv (also shows hw vendor, model number etc) pciconf -lv grep -i cpu /var/run/dmesg.boot sysctl hw.ncpu
Checking resources
avialable memory
grep memory /var/run/dmesg.boot
top systat -pigs fstat -f /var systat -vm iostat gstat vmstat pstat sockstat
Building a kernel
cd /usr/src/sys
Serial console
- http://www.freebsd.org/doc/en/articles/console-server/freebsd.html
- http://www.freebsd.org/doc/en/books/handbook/serialconsole-setup.html
Assuming you want to use keyboard/video as well as serial:
echo "-D" > /boot.config
In /boot/loader.conf:
boot_multicons="YES" boot_serial="YES" comconsole_speed="115200" console="comconsole,vidconsole"
In /etc/ttys:
ttyd0 "/usr/libexec/getty std.9600" vt100 on secure
Mount CDROM
http://www.freebsddiary.org/iso-mount.php
Check network traffic
systat -ifstat 1 trafshow
FAQ
Upgrading
cd /usr/src make buildworld make buildkernel KERNCONF=mykernel make installkernel KERNCONF=mykernel
or
portupgrade -P -f -a
Courier-imap certificates
check out /usr/local/share/mkimapdcert
crontab: temp file must be edited in place
Happens when you set EDITOR=vim. Fix it by setting :set nobackup and :set nowritebackup in .vimrc
ping: sendto: Permission denied
That's when you try to ping from inside a jail.
sysctl:
security.jail.allow_raw_sockets: 0
Timezones, date and time settings
- http://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/
- adjkerntz
- tzsetup
- ntp
Ports
Post install messages
/usr/ports/*/*/pkg-message
exclude from csup
To exclude for example /usr/ports/japanese, put in /var/db/refuse
ports/japanese
sample: /usr/src/share/examples/cvsup/refuse (or a refuse file in whatever base you defined in supfile)
config options used for a port
/var/db/ports/*/options
ssh taking a long time
In /etc/ssh/sshd_config
UseDNS no
files installed by ports
/var/db/pkg
Using large ( >2T ) drives
gpt create mfid1
create a 'slice' of 200000 sectors (this will automagically create /dev/mfid1p1
gpt add -s 2000000 mfid1
create one taking up the rest (/dev/mfid1p2)
gpt add mfid1
Migrate users/accounts
http://www.ggis.biz/wiki/index.php/FreeBSD_-_Migrate_Users
After editing /etc/master.passwd run
pwd_mkdb /etc/master.passwd
(careful with this not entirely tested advice )
truss: cannot open /proc/curproc/mem: No such file or directory
kldload procfs mount_procfs /dev/procfs /proc
But you're supposed to use sysctl?
Networking
Set default route
route add default 10.0.0.1
Delete default route
route delete default
rm: Operation not permitted
ls -lo chflags noschg