FreeBSD

From DWIKI

Jump to: navigation, search

Contents

[edit] Documentation

[edit] NFS

[edit] Ports

[edit] Filesystems

[edit] Networking

[edit] ipfw

[edit] ipv6 on freebsd

[edit] port forwarding

[edit] Tips and Tricks

  • man intro
  • man tuning
  • mergemaster
  • man pw
sysinstall
cd /sys/i386/conf ; make LINT


[edit] Rescue

[edit] Snapshots


[edit] Kernel modules

kldload kldstat etc

[edit] Hardware info

kenv
pciconf -lv
grep -i cpu /var/run/dmesg.boot
sysctl hw.ncpu

[edit] Checking resources

[edit] avialable memory

grep memory /var/run/dmesg.boot


systat -pigs
fstat -f /var
systat -vm
iostat
gstat
vmstat
pstat
sockstat

[edit] Building a kernel


cd /usr/src/sys


[edit] Serial console

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

[edit] FAQ

[edit] Upgrading


cd /usr/src
make buildworld
make buildkernel KERNCONF=mykernel
make installkernel KERNCONF=mykernel


or

portupgrade -P -f -a

[edit] Courier-imap certificates

check out /usr/local/share/mkimapdcert

[edit] 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

[edit] ping: sendto: Permission denied

That's when you try to ping from inside a jail.

sysctl:

security.jail.allow_raw_sockets: 0

[edit] Timezones, date and time settings

[edit] Ports

[edit] Post install messages

/usr/ports/*/*/pkg-message

[edit] 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)

[edit] config options used for a port

/var/db/ports/*/options

[edit] ssh taking a long time

In /etc/ssh/sshd_config

UseDNS no

[edit] files installed by ports

/var/db/pkg

[edit] 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


[edit] 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 )

[edit] 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?


[edit] Networking

[edit] Set default route

route add default 10.0.0.1

[edit] Delete default route

route delete default


[edit] rm: Operation not permitted

ls -lo
chflags noschg
Personal tools