• 08Nov

    การจัดทำ Windows Diskless โดยใช้การ boot ผ่าน PXE (Network Boot ซึ่งมีใน Mainboard รุ่นใหม่ๆ เกือบทุกตัว)
    http://www.etherboot.org/wiki/sanboot

    การ setup iSCSI บน Ubuntu 9.04
    http://www.howtoforge.com/using-iscsi-on-ubuntu-9.04-initiator-and-target

  • 29Oct

    วันนี้เข้ามาตรวจเช็คปัญหาระบบ Fileserver ของ inca
    ปัญหาคือ
    1. Account แจ้งว่าโปรแกรม Express ใช้งานช้ามาก (เวลาเขียนข้อมูล)
    2. บางเครื่องไม่สามารถเข้า share folder ได้ โดยมี error report ว่า duplicate user (ทั้งๆที่ปกติก็ใช้ user เดียวกันในการ logon เข้าใช้ share folder)

    ได้ทำการแก้ไขดังนี้
    1. เพิ่ม config เข้าไปใน smb.conf
    socket options = SO_KEEPALIVE
    * ยังไม่ทราบว่าเป็นเช่นไร แต่จากการดูสภาพการใช้งาน (ใช้คำสั่ง smbstatus พบว่ามีการเข้าใช้ได้มากขึ้น และไม่พบ error oplock ใน smb.log อีก)

    2. ปัญหาเกิดจาก การตั้ง computer name ซ้ำกัน (error report ที่แจ้งว่า duplicate user นั้น อีกความหมายคือ duplicate Machine name)

    สรุป ความรู้ที่ได้วันนี้
    คำสั่ง smbstatus ใช้ในการตรวจสอบสถานะการใช้งาน samba โดยจะ report ให้ทราบว่ามีเครื่องใดเชื่อมต่อเข้ามาบ้าง (ถ้า computer name ซ้ำ จะเข้าได้เครื่องเดียว), กำลังใช้ resource อะไร(share folder) และกำลังเปิดไฟล์อะไรบ้าง

  • 23Aug

    Linux doesn’t have a separate threads per process limit, just a limit on the total number of processes on the system (threads are essentially just processes with a shared address space on Linux) which you can view like this:

    cat /proc/sys/kernel/threads-max
    

    The default is the number of memory pages/4. You can increase this like:

    echo 100000 > /proc/sys/kernel/threads-max
    

    There is also a limit on the number of processes (an hence threads) that a single user may create, seeulimit/getrlimit for details regarding these limits.

    Continue reading »

  • 10Aug

    วิธีติดตั้ง VHCS2 บน Debian 4.0
    ผมเองก็ไม่ค่อยเก่งหรอกนะเท่าที่ผมลองทำก็มีเท่านี้นะครับ (ลองเอาไปแปลงๆ ดูสำหรับมือใหม่ทุนน้อย ประหยัดค่า CP ไปได้พอควร)

    # apt-get update
    # apt-get upgrade
    # apt-get dist-upgrade
    # apt-get install apache2 apache2-mpm-prefork bind9 bzip2 courier-authdaemon courier-base courier-imap courier-maildrop courier-pop dialog diff gzip iptables libapache2-mod-php5 libberkeleydb-perl libcrypt-blowfish-perl libcrypt-cbc-perl libcrypt-passwdmd5-perl libdate-calc-perl libdate-manip-perl libdbd-mysql-perl libdbi-perl libio-stringy-perl libmail-sendmail-perl libmailtools-perl libmcrypt4 libmd5-perl libmime-perl libnet-dns-perl libnet-netmask-perl libnet-perl libnet-smtp-server-perl libperl5.8 libsasl2-modules libsasl2 libsnmp-session-perl libterm-readkey-perl libterm-readpassword-perl libtimedate-perl make mysql-client mysql-common mysql-server original-awk patch perl perl-base perl-modules php5 php5-mcrypt php5-mysql php5-gd postfix postfix-tls procmail proftpd-mysql sasl2-bin tar wget gcc libc6-dev php5-dev subversion php5-cli

    Create directories for web-based administration ? เลือก yes
    เลือก Ok
    General type of configuration? เลือก Internet Site
    Mail name? เลือก Ok
    Run proftpd from inetd or standalone? เลือก standalone
    # nano /etc/mysql/my.cnf

    Continue reading »

  • 24Jul

    Install PoPToP Point to Point Tunneling Server:

    sudo apt-get install pptpd

    Edit /etc/pptpd.conf file:

    sudo joe /etc/pptpd.conf

    Uncomment the following lines (replace IP range if you like)

    localip 192.168.0.1
    remoteip 192.168.1.1-255

    Save and exit.

    Edit /etc/ppp/pptpd-options file

    sudo joe /etc/ppp/pptpd-options

    Continue reading »

  • 24Jul

    For updates of this post please visithttp://mexpolk.wordpress.com.

    Hello again, this time we’re going to setup a DynDNS client so your computer/server can be reached from anywhere.

    Step 1

    First, you need to create an account with DynDNS to do so follow this howto:https://www.dyndns.com/services/dns/dyndns/howto.html.

    Step 2

    First we’ll install ssh and ssh-socket so we can send our DynDNS user and password encrypted instead clear text:

    $ sudo apt-get install ssh libio-socket-ssl-perl

    Continue reading »

  • 15Jul

    Pre-Installation Setup

     

    None of the following pre-installation steps are strictly necessary.

     

    User Permissions

     

    NFS user permissions are based on user ID (UID). UIDs of any users on the client must match those on the server in order for the users to have access. The typical ways of doing this are:

    • Manual password file synchronization
    • Use of LDAP

    • Use of NIS

    It’s also important to note that you have to be careful on systems where the main user has root access – that user can change UID’s on the system to allow themselves access to anyone’s files. This page assumes that the administrative team is the only group with root access and that they are all trusted. Anything else represents a more advanced configuration, and will not be addressed here.

      Continue reading »

  • 15Jul

    NFS was developed at a time when we weren’t able to share our drives like we are able to today – in the Windows environment. It offers the ability to share the hard disk space of a big server with many smaller clients. Again, this is a client/server environment. While this seems like a standard service to offer, it was not always like this. In the past, clients and servers were unable to share their disk space.

     

    Thin clients have no hard drives and thus need a “virtual” hard-disk. The NFS mount their hard disk from the server and, while the user thinks they are saving their documents to their local (thin client) disk, they are in fact saving them to the server. In a thin client environment, the root, usr and home partitions are all offered to the client from the server via NFS

     

    .

  • 12Jul

    Imagine you have a machine with all of its disk full and another with unused gigabytes, and you don’t want to move the data from one to the other. Why not using the second’s disk on the first, you can do it with iSCSI but you can do it with ATA over Ethernet (AoE) too. It’s the second method I’ll explain in this article. All of this was made with two computers running Debian Etch.

    Prepare The Kernel
    First check if your running kernel has AoE, the config option name is CONFIG_ATA_OVER_ETH, have a look at fig1, my kernel has AoE as a module:

    host:/# grep ATA_OVER /boot/config-`uname -r`

    CONFIG_ATA_OVER_ETH=m
    host:/#

    If not, configure your kernel and activate AoE in core or in module like you prefer:

    Device Drivers –>
    |- Block Devices —>
    |- ATA over Ethernet support

    Ok now you have a kernel with AoE, just load the aoe module:

    host:/# modprobe aoe

    You can check your syslog to be sure AoE is available:

    host:/#tail /var/log/syslog

    Oct 10 11:54:07 host kernel: aoe: aoe_init: AoE v22 initialised.
    host:/#

    Now we’ll call the client ‘client’ and the server ’server’, funny isn’t it?
    In SAN vocabulary we call the client ‘initiator’ and the server ‘target’, I prefer to continue using simplest terms. Continue reading »

  • 12Jul
    • ทดสอบใช้กับ ubuntu 8.04
    • ต้นฉบับจาก http://smartmontools.sourceforge.net/
    • ใช้สำหรับอ่านค่าคุณสมบัติต่างๆของ hard disk
    • ต้องตั้งค่า BIOS ของ PC ให้รองรับคุณสัมบัติ S.M.A.R.T hard disk ด้วย

     

    1. ติดตั้งด้วยคำสั่ง  sudo apt-get install smartmontools
    2. ในขั้นต้นให้ตรวจสอบว่าใน PC มี hard disk กี่ลูก ด้วยคำสั่ง sudo fdisk -lตัวอย่างนี้เป็นแบบง่ายๆ มี hard disk ลูกเดียว
      Disk /dev/hda: 20.4 GB, 20404101120 bytes
      255 heads, 63 sectors/track, 2480 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Device Boot      Start         End      Blocks   Id  System
      /dev/hda1   *           1          13      104391   83  Linux
      /dev/hda2              14        2480    19816177+  8e  Linux LVM

      ตัวอย่างต่อไปมี hard disk 2 ลูก ต่อกันแบบ software raid
      Disk /dev/hda: 80.0 GB, 80026361856 bytes
      255 heads, 63 sectors/track, 9729 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Device Boot      Start         End      Blocks   Id  System
      /dev/hda1   *           1          13      104391   fd  Linux raid autodetect
      /dev/hda2              14        9447    75778605   fd  Linux raid autodetect
      /dev/hda3            9448        9708     2096482+  fd  Linux raid autodetect
      Disk /dev/hdc: 80.0 GB, 80026361856 bytes
      255 heads, 63 sectors/track, 9729 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Device Boot      Start         End      Blocks   Id  System
      /dev/hdc1   *           1          13      104391   fd  Linux raid autodetect
      /dev/hdc2              14        9447    75778605   fd  Linux raid autodetect
      /dev/hdc3            9448        9708     2096482+  fd  Linux raid autodetect

    3. ตรวจสอบชนิด hard disk /dev/hda ด้วยตัวอย่างคำสั่ง  sudo smartctl -i /dev/hda
      หากเป็น hard disk แบบ SATA อาจต้องเพิ่ม option ว่า -d ata ด้วย ตัวอย่างคำสั่ง sudo smartctl -i /dev/sda -d ata ได้ผลดังตัวอย่าง=== START OF INFORMATION SECTION ===
      Device Model:     ST320413A
      Serial Number:    7ED2J419
      Firmware Version: 3.39
      User Capacity:    20,404,101,120 bytes
      Device is:        In smartctl database [for details use: -P show]
      ATA Version is:   4
      ATA Standard is:  Exact ATA specification draft version not indicated
      Local Time is:    Mon Oct 16 12:55:11 2006 ICT
      SMART support is: Available – device has SMART capability.
      SMART support is: Enabled
    4. ตรวจสอบสุขภาพ hard disk /dev/hda  ด้วยตัวอย่างคำสั่ง sudo smartctl -Hc /dev/hda
      หากเป็น hard disk แบบ SATA อาจต้องเพิ่ม option ว่า -d ata ด้วย  ตัวอย่างคำสั่ง sudo smartctl -Hc /dev/sda -d ata  ได้ผลดังตัวอย่าง*** บรรทัดที่มีคำว่า PASSED แสดงว่าปรกติดี ถ้าเสียจะเป็น FAILED
      === START OF READ SMART DATA SECTION ===
      SMART overall-health self-assessment test result: PASSED

      General SMART Values:
      Offline data collection status:  (0×82) Offline data collection activity
                                              was completed without error.
                                              Auto Offline Data Collection: Enabled.
      Self-test execution status:      (   0) The previous self-test routine completed                                        without error or no self-test has ever
                                              been run.
      Total time to complete Offline
      data collection:                 ( 422) seconds.
      Offline data collection
      capabilities:                    (0×1b) SMART execute Offline immediate.
                                              Auto Offline data collection on/off support.
                                              Suspend Offline collection upon new
                                              command.
                                              Offline surface scan supported.
                                              Self-test supported.
                                              No Conveyance Self-test supported.
                                              No Selective Self-test supported.
      SMART capabilities:            (0×0003) Saves SMART data before entering
                                              power-saving mode.
                                              Supports SMART auto save timer.
      Error logging capability:        (0×01) Error logging supported.
                                              No General Purpose Logging support.
      Short self-test routine
      recommended polling time:        (   1) minutes.
      Extended self-test routine
      recommended polling time:        (  23) minutes.

    5. ทดสอบแบบเร็ว hard disk /dev/hda  ด้วยตัวอย่างคำสั่ง sudo smartctl -t short /dev/hda
      หากเป็น hard disk แบบ SATA อาจต้องเพิ่ม option ว่า -d ata ด้วย  ตัวอย่างคำสั่ง sudo smartctl -t short /dev/sda -d ata  ได้ผลดังตัวอย่าง=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
      Sending command: “Execute SMART Short self-test routine immediately in off-line mode”.
      Drive command “Execute SMART Short self-test routine immediately in off-line mode” successful.
      Testing has begun.
      Please wait 1 minutes for test to complete.
      Test will complete after Mon Oct 16 15:01:20 2006

      Use smartctl -X to abort test.

      ให้รอสัก 1 นาที จะได้ผลลัพธ์ออกมา
      ตรวจสอบดูด้วยคำสั่งว่า  sudo smartctl -l selftest /dev/hda
      หากเป็น hard disk แบบ SATA ต้องเพิ่ม option ว่า -d ata ด้วย
      ตัวอย่างคำสั่ง smartctl -l selftest /dev/sda -d ata
      ได้ผลตัวอย่าง

      === START OF READ SMART DATA SECTION ===
      SMART Self-test log structure revision number 1
      Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
      # 1  Short offline       Completed without error       00%     19789         -
      # 2  Short offline       Completed without error       00%     19788         -

      หมายความว่าเคยทดสอบมา 2 ครั้งแล้ว และสภาพดีไม่มีปัญหา

    6. ดูรายงาน error ของ hard disk /dev/hda  ด้วยตัวอย่างคำสั่ง  sudo smartctl -l error /dev/hda
      หากเป็น hard disk แบบ SATA อาจต้องเพิ่ม option ว่า -d ata ด้วย ตัวอย่างคำสั่ง sudo smartctl -l error /dev/sda -d ataตัวอย่างผลที่ได้แสดงว่าเป็นปรกติดี
      === START OF READ SMART DATA SECTION ===
      SMART Error Log Version: 1
      No Errors Logged

      ตัวอย่างผลที่ได้  ว่าเคยมี error เกิดขึ้น แต่ก็ยังคงใช้งานได้
      === START OF READ SMART DATA SECTION ===
      SMART Error Log Version: 1
      ATA Error Count: 5
              CR = Command Register [HEX]
              FR = Features Register [HEX]
              SC = Sector Count Register [HEX]
              SN = Sector Number Register [HEX]
              CL = Cylinder Low Register [HEX]
              CH = Cylinder High Register [HEX]
              DH = Device/Head Register [HEX]
              DC = Device Command Register [HEX]
              ER = Error register [HEX]
              ST = Status register [HEX]
      Powered_Up_Time is measured from power on, and printed as
      DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
      SS=sec, and sss=millisec. It “wraps” after 49.710 days.

      Error 5 occurred at disk power-on lifetime: 13636 hours (568 days + 4 hours)
        When the command that caused the error occurred, the device was active or idle.
        After command completion occurred, registers were:
      ………. มีต่อมากมาย

    7. หากต้องการให้มีการตรวจสภาพโดยอัตโนมัติ แล้วส่งอีเมล์แจ้งผู้ดูแลระบบด้วย
      ให้แก้ไขแฟ้ม /etc/smard.conf ให้มีข้อความตัวอย่างว่า
      /dev/sda -H -m  myemail@domain.com
      หากเจอปัญหาสุขภาพไม่ค่อยดี  ก็จะส่งอีเมล์มาให้แก่ myemail@domain.com
    8. หากต้องการให้ระบบตรวจสอบอัตโนมัติทุกครั้งที่บูทเครื่อง  ให้แก้ไขแฟ้ม  /etc/default/smartmontools 
      ปรับตั้งค่าตัวแปรประมาณตัวอย่างดังนี้
      start_smartd=yes
      enable_smart=”/dev/sda”สั่งให้ระบบเริ่มทำงานด้วยคำสั่ง sudo /etc/init.d/smartmontools start
    9. ตัวอย่างคำสั่งในการอ่านเฉพาะค่าอุณหภูมิของ hard disk คือ
      sudo smartctl -A /dev/sda|grep “Temperature_Celsius”

« Previous Entries