1. Check if your module exists or not in /boot/defaults/loader.conf file

2. If it exists then open file /boot/loader.conf and add entry in it. Do not add or modify /boot/defaults/loader.conf file. If entry does not exist then read step # 4.

3. Reboot system to see to take effect..

For example, we want to load NTFS file system driver everytime our FreeBSD box comes up. Here is procedure:

a) Find if ntfs module exist or not

grep -i “ntfs” /boot/defaults/loader.conf
ntfs_load=”NO” # NTFS

b) We got above output i.e. module exists copy that line and paste it to /boot/loader.conf file:
vi /boot/loader.conf
ntfs_load=”YES” # NTFS added by Vivek on fbsdx.test.com on dec07-04

c) Reboot system to see changes.

d) When system comes up type kldstat to see ntfs module is loaded or not.
kldstat

4) Ok so you donÒ€ℒt find entry then add module (this only required for 3rd party module or your own module) using:

a) Open /boot/loader.conf and add following lines to it, let say your module name is foo:

foo_load=”YES” # loads module “foo”
foo_name=”realname” # uses “realname” instead of “foo”
foo_type=”type” # passes “-t type” to load
foo_flags=”flags” # passes “flags” to the module
foo_before=”cmd” # executes “cmd” before loading the module
foo_after=”cmd” # executes “cmd” after loading the module
foo_error=”cmd” # executes “cmd” if load fails

b) Reboot system


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • Anonymous Sep 25, 2005 @ 17:39

    foo_load=”YES” # loads module “foo”
    foo_name=”realname” # uses “realname” instead of “foo”
    foo_type=”type” # passes “-t type” to load
    foo_flags=”flags” # passes “flags” to the module
    foo_before=”cmd” # executes “cmd” before loading the module
    foo_after=”cmd” # executes “cmd” after loading the module
    foo_error=”cmd” # executes “cmd” if load fails

  • cyberciti Sep 25, 2005 @ 22:01

    Thanks! I have updated text πŸ™‚

  • neohiren Nov 12, 2006 @ 12:31

    dear all . i m newbie to linux i want to know how do is set up a nat router on linux redhat fedora to forward all the traffic towards clients ,and how can i bind/block the clients via ip address

  • 🐧 nixCraft Nov 12, 2006 @ 12:45

    @neohiren,

    Try following urls:
    http://www.cyberciti.biz/tips/linux-as-router-for-dsl-t1-line-etc.html

    If you have specific questions try our forum to get more personalized free tech support http://forums.cyberciti.biz/

  • Misbah Naveed Dec 5, 2007 @ 4:57

    hi
    i am newbie to linux.i am using redhat enterprise with kernel-2.6.9-42 and used this module usbat02-2.6-0.5.0 but didnot no work maybe i did not used it correctly.
    I did the following steps:
    1. I downloaded the source rpm for kernel 2.6.9-42.EL and rebuild it.
    2. I patch the file present in usbat02-2.6-0.5.0/patch/usb-integration.patch.
    3. replace the exixting usb.c and usb.h with the usbat02-2.6-0.5.0’s usb.c and usb.h.
    4. make menuconfig and select the option of USBAT/ support from USB mass storage option.
    5. The setting are saved in new kernel and gave it the name usbat-2.6.9
    6. Then use the command “make modules modules_install”.
    7. run “make install”.
    8. modprobe usb_storage
    9. on demesg i got a meeage that i m sending u as attached file. named Error-old.doc
    Should i do the steps 6 and 7 in new kernels? if i do these steps in new kernel usbat-2.6.9 ,the dmesg gives the detail that i couldnot understand attatched file with name error.doc.
    also system configure the USB flash automatically i am confused how would i know that i have installed the new driver .
    Using lsmod shows usb_storage with 0 before plugging the flash. and after plugging it turns to 1. what it means
    pls help me i am so confused how would i know that new module is loaded in my system
    waiting 4 reply

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum