Archive for the FreeBSD Category

How to Repair Corrupted rc.conf file

Posted in FreeBSD with tags on July 3, 2009 by ndok
 

Procedure on how to solve FreeBSD boot up problem with the error message:

Loading configuration files.
/etc/rc.conf:51 Syntax error: Unterminated quoted string
Enter full pathname of Shell or RETURN for /bin/sh:

This error is normally encountered if there is a misplaced or missing double quote in the configuration file of the FreeBSD installation.
Sample invalid rc.conf file:

usbd_enable="YES
dbus_enable="YES"
compat5x_enable="YES"

Note that there is a missing double quote in the example above. This error may also be triggered by a misplaced or unnecessary double quote in the configuration file.
To fix this problem:

1. (Optional) Reboot your FreeBSD and select the login option:
4. Boot FreeBSD in single user mode This can by done by pressing the number 4 upon boot up.

2. Press ENTER after the error message:
Loading configuration files.
/etc/rc.conf:51 Syntax error: Unterminated quoted string Enter full pathname of Shell or RETURN for /bin/sh:
3. Type mount -a -t ufs then press enter.
The argument following the -t is used to indicate the file system type. The type ufs is the default. The -t option can be used to indicate that the actions should only be taken on file systems of the specified type.

- or -

Type mount -a then press enter.
This will mount all the file systems described in fstab.
3. Open the configuration file by typing:
/usr/bin/ee /etc/rc.conf
You may also use your preferred editor like vi, pico, etc. by replacing ee. (/usr/bin/vi /etc/rc.conf, /usr/bin/pico /etc/rc.conf)
4. Modify rc.conf and ensure that there is no missing or misplaced characters.
5. Press ESC to exit editor.
6. Save changes.
7. Reboot by using the command:
shutdown -r now

From : http://cyberjotter.blogspot.com/2008/01/how-to-repair-corrupted-rcconf-file.html

mpt0: QUEUE FULL EVENT: Bus 0×00 Target 0×08 Depth 128

Posted in FreeBSD with tags on July 3, 2009 by ndok

 

proxy# dmesg |grep mpt
mpt0: <LSILogic SAS/SATA Adapter> port 0×4000-0×40ff mem 0xd8610000-0xd8613fff,0xd8600000-0xd860ffff irq 25 at device 3.0 on pci5
mpt0: [ITHREAD]
mpt0: MPI Version=1.5.13.0
mpt0: Capabilities: ( RAID-0 RAID-1E RAID-1 )
mpt0: 0 Active Volumes (2 Max)
mpt0: 0 Hidden Drive Members (10 Max)
da0 at mpt0 bus 0 target 8 lun 0
da1 at mpt0 bus 0 target 9 lun 0

Scenario: Performed a clean install of FreeBSD 7.1-STABLE with a SAS RAID controller, which completed without errors. After rebooting and beginning to install packages, I started seeing the following error: mpt0: QUEUE FULL EVENT: Bus 0×00 Target 0×08 Depth 128.

Solution: Searching online indicated that the problem was with support for Tagged Command Queuing in the mpt driver. The output of camcontrol was:

proxy# camcontrol tags da0 -v
(pass0:mpt0:0:8:0): dev_openings  255
(pass0:mpt0:0:8:0): dev_active    0
(pass0:mpt0:0:8:0): devq_openings 255
(pass0:mpt0:0:8:0): devq_queued   0
(pass0:mpt0:0:8:0): held          0
(pass0:mpt0:0:8:0): mintags       2
(pass0:mpt0:0:8:0): maxtags       255

proxy# camcontrol tags da1 -v
(pass1:mpt0:0:9:0): dev_openings  255
(pass1:mpt0:0:9:0): dev_active    0
(pass1:mpt0:0:9:0): devq_openings 255
(pass1:mpt0:0:9:0): devq_queued   0
(pass1:mpt0:0:9:0): held          0
(pass1:mpt0:0:9:0): mintags       2
(pass1:mpt0:0:9:0): maxtags       255

I then entered:

proxy# camcontrol tags da0 -N 119
(pass0:mpt0:0:8:0): tagged openings now 119
(pass0:mpt0:0:8:0): device openings: 119

proxy# camcontrol tags da1 -N 119
(pass1:mpt0:0:9:0): tagged openings now 119
(pass1:mpt0:0:9:0): device openings: 119

This second command limited the size of the queue to 119, preventing the error I had seen before. To ensure that this problem wouldn’t come up in the future, I added the following line to /etc/rc.local

# Set the devq_openings to 119 to prevent problems with SAS controller

camcontrol tags da0 -N 119

camcontrol tags da1 -N 119

Doing this runs the command at every boot, preventing the problem from creeping up in the future.

From : http://www.shaddihasan.com/blog/2009/02/23/dell-poweredge-t300-sas-raid-and-freebsd/

From ZDNet Australia: Security measures: Linux vs BSD

Posted in FreeBSD on October 10, 2008 by ndok

Sebuah comotan dari ZDnet Australia dan cukup menarik untuk dibaca, agar lebih mengerti keberadaanya
“From ZDNet Australia: Security measures: Linux vs BSD”

Security measures: Linux vs BSD

I hear a lot of discussion about how superior Linux is to Microsoft’s operating systems. Certainly, there are many more attacks targeting Windows and IIS platforms.

A good case can also be made that Linux is inherently more stable and secure than Microsoft products, either because it’s based on a better core of code or because it’s open source, and many individuals have a stake in monitoring and making repairs.
Monggo di woco…

Upgrade pfsense dari FreeBSD 6.2 ke FreeBSD 6.3

Posted in FreeBSD with tags on October 9, 2008 by ndok

Bagi rekan yang Pfsense nya masih FreeBSD 6.2 dan ada masalah dengan squid nya bisa di upgrade dengan FreeBSD 6.3
Ini hasil iseng berkunjung ke forum pfsense, dapet link

berikut sepenggal kutipan dari comment di forum tsb

NEED TEST
Looks like the throughput issue may have resolved itself in the FreeBSD 6.3 build of pfSense 1.2_RELEASE. I have had success with the new build, please let us know if you see improvements as well.
http://cvs.pfsense.org/~sullrich/testing_images/6/FreeBSD_RELENG_6_3/pfSense_RELENG_1_2/

Interesting…we only have 3MBit of bandwidth and don’t see ANY difference between squid or direct.

ini link nya

You might ask why squid on pfsense is so slow?

Posted in FreeBSD with tags , , on October 9, 2008 by ndok

Bagi yang pake Pfsense dan package squid nya di aktifin … pasti lemot dehh…. selidik punya selidik ternyata pfsense tersebut dikususkan pada class router, bukannya untuk server dengan beban tinggi sperti high load proxy server.

Monggo dibaca selengkapnya

Setup firewall IPFW pada FreeBSD

Posted in FreeBSD with tags on May 22, 2008 by ndok

Ipfirewall (ipfw) adalah IP packet filter pada FreeBSD dan fasilitas untuk  traffic accounting . IPFW sudah termasuk dalam system FreeBSD. Tetapi untuk mengaktifkan harus di load dahulu module kernel nya pada  rc.conf dengan perintah firewall_enable=”YES” .

koompile kernel FreeBSD untuk IPFW

Pastikan IPFW support belum terkompile pada kernel:
#ipfw list

Jika anda mendapatkan error seperti berikut ini, maka anda harus meng kompile ulang kernel FreeBSD anda.
ipfw: getsockopt(IP_FW_GET): Protocol not available

 

Baca Sepuasnya Deh...!!

Konfigurasi Static Routing pada FreeBSD

Posted in FreeBSD on May 22, 2008 by ndok

Untuk konfigurasi static routing pada FreeBSD anda dapat melakukan dengan mengedit file /etc/rc.conf

# nano /etc/rc.conf

Set IP default router nya misalnya 10.234.1.1:
Buat static routing untuk beberapa network jika jaringan anda memang terdiri dari beberapa network misalnya

network1 192.168.1.0/24 dengan gateway 192.168.1.254
network2 192.168.2.0/24 dengan gateway 192.168.1.254
network3 10.234.2.0/24 dengan gateway 10.234.1.253
network4 10.234.3.0/24 dengan gateway 10.234.1.253

 
 Read more »

Menampilkan Setting Environment pada FreeBSD

Posted in FreeBSD with tags , , , on May 22, 2008 by ndok

Tuliskan perintah berikut ini:
# env

contoh keluaran:

SSH_CLIENT=10.234.2.3 2041 22
USER=ndok
MAIL=/var/mail/ndok
HOME=/root
SSH_TTY=/dev/ttyp0
PAGER=more
ENV=/home/ndok/.shrc
 Read more »

Perintah pada UNIX untuk unerase / undelete ?

Posted in FreeBSD with tags , on May 22, 2008 by ndok

Adakah perintah pada unix untuk undelete atau unerase suatu file/folder…. ?

Jawabnya seh gampang aja …. TIDAK ADA  …. :( mantab banget deh….

jadi solusi terbaik adalah selalu backup file2 configurasi atau file2 penting anda, jadi suatu saat jika hialng atau rusak selalu dapat di restore.

sedikit tips untuk menghindari kesalahan men delete/erase file

  • Jangan pernah login sbg root jika memang dirasa tidak perlu 
  • Selalu gunakan regular user untuk semua normal task
  • Ubah perintah Alias rm / mv / cp dengan rm -i / mv -i
    alias cp='cp -i'
    alias mv='mv -i'
    alias rm='rm -i'
  • Buat file copy nya dahulu sebelum mengedit suatu file
  • Gunakan RAID 6 hardware card sebagai tambahan proteksi untuk file server
  • Buat file tersebut Unchangeable dengan menggunakan chflags - sehingga tidak dapat di dihapus walaupun user root.

Perintah membuat Symbolic link pada UNIX

Posted in FreeBSD with tags on May 22, 2008 by ndok

Symbolic link

Untuk membuat  symbolic link, enter
# ln -s {/path/to/file-name} {link-name}
# ln -s /shared/sales/data/file.txt sales.data.txt
# vi sales.data.txt
# ls -l sales.data.txt

Untuk menghapus link, enter
# rm {link-name}
# rm sales.data.txt
# ls -l
# ls -l /shared/sales/data/file.txt

 

Read more »