pavement

Gotchas, Linux

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
 
(23 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
==Things you should know if you're coming to FreeBSD from Linux==
 
==Things you should know if you're coming to FreeBSD from Linux==
# The kernels are different -- monolithic instead of microkernels, although FreeBSD does allow dynamic loading of modules (see [[kldstat]], [[kldload]], [[kldunload]].)
+
# The kernels are both modular, but the commands for loading/viewing/unloading kernel modules are different -- [[kldstat]], [[kldload]], [[kldunload]] instead of Linux' "lsmod", "insmod/modprobe" and "rmmod/modprobe -r".)
# No iptables/netfilter: ipfw packet filter takes it's place, but you have to recompile your kernel to include it
+
# You need to be a member of the wheel group in order to su to root - and you NEED to be able to su to root, because by default you can't log in directly as root over ssh.  (and this is a Good Thing, and should not be changed.)
 +
# No iptables/netfilter: you have your choice of IPFW, PF, or IPFilter (not recommended for SMP systems).  You can either recompile the kernel to include these, or load the kernel modules at runtime.  QoS and bandwidth throttling are handled via either Dummynet (ipfw) or AltQ (pf)
 +
# Init scripts: [[BSD]] style differs from the [[SysV]] style many/most Linux distros (Slackware and Arch being noteable exceptions) use.  [[runlevels]] mean different things in BSD-style *nixes, and [[init scripts]] are handled differently - in BSD-style init, rc is configured via a single config file (/etc/rc.conf) with the system rc scripts stored under /etc/rc.d, and local daemon startup scripts in /usr/local/etc/rc.d.
 
# No /[[proc]] tree. If you're used to banging around /proc to find system info, man [[sysctl]]. If you installed linux-compatibility, see /usr/compat/linux/proc
 
# No /[[proc]] tree. If you're used to banging around /proc to find system info, man [[sysctl]]. If you installed linux-compatibility, see /usr/compat/linux/proc
 
# You don't '''have''' to compile everything from ports, it's usually better for your particular system if you ''do''. See [[pkg_add]] and the other pkg tools.
 
# You don't '''have''' to compile everything from ports, it's usually better for your particular system if you ''do''. See [[pkg_add]] and the other pkg tools.
 
# If in doubt, read the Handbook (or ask here).
 
# If in doubt, read the Handbook (or ask here).
 
# Different filesystems: linux uses ext2/ext3/reiserfs by default (usually) and FreeBSD uses UFS. It does not do journaling, but instead uses a system called soft-updates. Have a look [[http://www.usenix.org/publications/library/proceedings/usenix2000/general/seltzer.html here]] if you would like to know what this means. It seems that [[http://www.freebsd.org/projects/summerofcode.html Google]] might be helping to change this though.
 
# Different filesystems: linux uses ext2/ext3/reiserfs by default (usually) and FreeBSD uses UFS. It does not do journaling, but instead uses a system called soft-updates. Have a look [[http://www.usenix.org/publications/library/proceedings/usenix2000/general/seltzer.html here]] if you would like to know what this means. It seems that [[http://www.freebsd.org/projects/summerofcode.html Google]] might be helping to change this though.
# Java's a tough nut to install. Deal.
+
# [[Java]]'s a tough nut to install due to Sun's licensing restrictions...unless you're not on the x86 FreeBSD platform, in which case it's uninstallable anyway.
# /stand/sysinstall will be quite useful to you at first.
+
# [[sysinstall]] can be used for system configuration after installation, but should be avoided as it makes a mess of the /etc/rc.conf file.  On FreeBSD 4.x systems it's /stand/sysinstall.  On FreeBSD 5+ systems, it's /usr/sbin/sysinstall.
# [[bash]] is not the default shell, [[csh]] or [[tcsh]] is. If you want to change that, see [[chsh]].
+
# [[bash]] is not the default shell. [[csh]] (actually [[tcsh]]) is the default for root, sh is the default for normal users. Every other shell under the sun can be installed via the ports tree, and you can use  [[chsh]] to change it for a specific user. Users seeking a decent shell (both [[sh]]-compatible and friendly for interactive use) should consider [[ksh]] or [[pdksh]] as well as bash.
 
# Most linux distros use [[vim]], FreeBSD uses [[nvi]] by default. You can change this if it matters to you. Use /usr/ports/editors/vim-lite if you do not want to install the [[X windowing system]] else use /usr/ports/editors/vim.
 
# Most linux distros use [[vim]], FreeBSD uses [[nvi]] by default. You can change this if it matters to you. Use /usr/ports/editors/vim-lite if you do not want to install the [[X windowing system]] else use /usr/ports/editors/vim.
# Your NIC is no longer eth0 or eth0 or whatever. FreeBSD names it's interfaces by the driver they use; you'll see rl0, ed0, hme0, etc.
+
# Your NIC is no longer eth0 or eth1 or whatever. FreeBSD names its interfaces by the driver they use; you'll see rl0, ed0, hme0, etc.  FreeBSD 6.x includes interface renaming, so those that like generic names can use them.
 
# /etc/mtab doesn't show you mounts. [[mount]] and [[df]] do.
 
# /etc/mtab doesn't show you mounts. [[mount]] and [[df]] do.
 
# Your hard disks are no longer /dev/hda or /dev/sda. Now they are /dev/ad0s1a. See [[partitions]].
 
# Your hard disks are no longer /dev/hda or /dev/sda. Now they are /dev/ad0s1a. See [[partitions]].
 
# [[devinfo]] and [[swapinfo]] will do a lot of [[sysctl]] magic for you.
 
# [[devinfo]] and [[swapinfo]] will do a lot of [[sysctl]] magic for you.
# Software RAID? See [[vinum]].
+
# Software RAID? See [[vinum]] and [[RAID1, Software, How to setup]].  (Note:  vinum is dead since 5.3; use [[gvinum]], gmirror, or graid)
# Bandwidth limiting/traffic shaping? See [[dummynet]]
+
 
# Disk encryption? [[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-encrypting.html It's in the Handbook]]
 
# Disk encryption? [[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-encrypting.html It's in the Handbook]]
# You need to be a member of the wheel group to allow you to su to root.
 
 
# Shell scripts do not use '''seq 1 10'''. They use '''jot 10 1''' instead.
 
# Shell scripts do not use '''seq 1 10'''. They use '''jot 10 1''' instead.
# /boot/loader.conf is where you set which kernel modules to load at boot time. /etc/rc.conf is where you set which system daemons to load at boot time.
+
# /boot/loader.conf is where you set which kernel modules to load at boot time. /etc/rc.conf is where you set which system daemons to load at boot time. Or you can edit the startup scripts manually in /etc/rc.d (Some say this is the only way to do it, some say it doesn't matter. Your choice.)  (Note:  don't edit the rc scripts directly unless you *REALLY* know what you are doing, and understand how mergemaster works.)
 +
# [[wget]] is replaced by [[fetch]]. Feel free to install wget if you don't want to learn another program, but they're very similar.
 +
# If you install [[X11]], and switch to a shell, getting back to X is a matter of alt-F9 since FreeBSD sets you up with 8 virtual terminals instead of Linux's default of 6.
 +
 
 
[[Category : Linux Equivalents]]
 
[[Category : Linux Equivalents]]

Latest revision as of 01:39, 10 November 2009

[edit] Things you should know if you're coming to FreeBSD from Linux

  1. The kernels are both modular, but the commands for loading/viewing/unloading kernel modules are different -- kldstat, kldload, kldunload instead of Linux' "lsmod", "insmod/modprobe" and "rmmod/modprobe -r".)
  2. You need to be a member of the wheel group in order to su to root - and you NEED to be able to su to root, because by default you can't log in directly as root over ssh. (and this is a Good Thing, and should not be changed.)
  3. No iptables/netfilter: you have your choice of IPFW, PF, or IPFilter (not recommended for SMP systems). You can either recompile the kernel to include these, or load the kernel modules at runtime. QoS and bandwidth throttling are handled via either Dummynet (ipfw) or AltQ (pf)
  4. Init scripts: BSD style differs from the SysV style many/most Linux distros (Slackware and Arch being noteable exceptions) use. runlevels mean different things in BSD-style *nixes, and init scripts are handled differently - in BSD-style init, rc is configured via a single config file (/etc/rc.conf) with the system rc scripts stored under /etc/rc.d, and local daemon startup scripts in /usr/local/etc/rc.d.
  5. No /proc tree. If you're used to banging around /proc to find system info, man sysctl. If you installed linux-compatibility, see /usr/compat/linux/proc
  6. You don't have to compile everything from ports, it's usually better for your particular system if you do. See pkg_add and the other pkg tools.
  7. If in doubt, read the Handbook (or ask here).
  8. Different filesystems: linux uses ext2/ext3/reiserfs by default (usually) and FreeBSD uses UFS. It does not do journaling, but instead uses a system called soft-updates. Have a look [here] if you would like to know what this means. It seems that [Google] might be helping to change this though.
  9. Java's a tough nut to install due to Sun's licensing restrictions...unless you're not on the x86 FreeBSD platform, in which case it's uninstallable anyway.
  10. sysinstall can be used for system configuration after installation, but should be avoided as it makes a mess of the /etc/rc.conf file. On FreeBSD 4.x systems it's /stand/sysinstall. On FreeBSD 5+ systems, it's /usr/sbin/sysinstall.
  11. bash is not the default shell. csh (actually tcsh) is the default for root, sh is the default for normal users. Every other shell under the sun can be installed via the ports tree, and you can use chsh to change it for a specific user. Users seeking a decent shell (both sh-compatible and friendly for interactive use) should consider ksh or pdksh as well as bash.
  12. Most linux distros use vim, FreeBSD uses nvi by default. You can change this if it matters to you. Use /usr/ports/editors/vim-lite if you do not want to install the X windowing system else use /usr/ports/editors/vim.
  13. Your NIC is no longer eth0 or eth1 or whatever. FreeBSD names its interfaces by the driver they use; you'll see rl0, ed0, hme0, etc. FreeBSD 6.x includes interface renaming, so those that like generic names can use them.
  14. /etc/mtab doesn't show you mounts. mount and df do.
  15. Your hard disks are no longer /dev/hda or /dev/sda. Now they are /dev/ad0s1a. See partitions.
  16. devinfo and swapinfo will do a lot of sysctl magic for you.
  17. Software RAID? See vinum and RAID1, Software, How to setup. (Note: vinum is dead since 5.3; use gvinum, gmirror, or graid)
  18. Disk encryption? [It's in the Handbook]
  19. Shell scripts do not use seq 1 10. They use jot 10 1 instead.
  20. /boot/loader.conf is where you set which kernel modules to load at boot time. /etc/rc.conf is where you set which system daemons to load at boot time. Or you can edit the startup scripts manually in /etc/rc.d (Some say this is the only way to do it, some say it doesn't matter. Your choice.) (Note: don't edit the rc scripts directly unless you *REALLY* know what you are doing, and understand how mergemaster works.)
  21. wget is replaced by fetch. Feel free to install wget if you don't want to learn another program, but they're very similar.
  22. If you install X11, and switch to a shell, getting back to X is a matter of alt-F9 since FreeBSD sets you up with 8 virtual terminals instead of Linux's default of 6.
Personal tools