Linux_Unix -

Linux_Unix

  • Writing/Burning a data CD-R/DVD-R or DVD+RW in Unix/Linux


    There's a lot of outdated information and confusion for system administrator's out there.

    One annoying task for many an Administrator has been backing up data in Linux.  You don't need any GUI tools such as K3B or GnomeBaker.  Both are excellent tools but for veteran command line users working remotely, using the keyboard is a great and possibly automated way to save yourself pain and hassle.

    At a later date we'll cover how scripting can automatically backup certain files to disc, verify them, catalogue them and even e-mail a report of the whole thing nightly or weekly.  It can even remind you the night before to make sure a blank disc has been inserted.

    Requirements:

    You'll need dvd+rw-tools.

    On Debian variants including Ubuntu you would run:

    apt-get install dvd+rw-tools

    On Redhat Enterprise / Centos you would run:

    yum install dvd+rw-tools

    In Unix it would probably be the same port/package name, especially on FreeBSD.

    No drivers or anything else are required at this point.

    Now for the burning.

    There are two ways of doing it, the traditional way is creating an iso image using mkisofs, but that is a pain and not even a possibility for some overfilled disk systems.  Many people believe there is no way to write on the fly, except to create an ISO with the data you'd like to burn.

    Here's the tradtional way just for the sake of the oldschool:

    mkisofs -r -o /root/myisoname.iso /var/www/vhosts

    Now we use growisofs to actually burn the .iso:

    growisofs -Z /dev/dvd1=/root/myisoname.iso

    *Replace /dev/dvd1 with the device name of your burner

    Watch as it burns:

       52887552/367337472 (14.4%) @3.9x, remaining 0:59 RBU 100.0% UBU  61.2%
       71925760/367337472 (19.6%) @4.1x, remaining 0:53 RBU 100.0% UBU  55.1%
       90112000/367337472 (24.5%) @3.9x, remaining 0:49 RBU 100.0% UBU  59.2%
      108363776/367337472 (29.5%) @4.0x, remaining 0:47 RBU  99.6% UBU  53.1%
      127303680/367337472 (34.7%) @4.1x, remaining 0:43 RBU 100.0% UBU  55.1%
      145555456/367337472 (39.6%) @4.0x, remaining 0:39 RBU 100.0% UBU  51.0%
      164265984/367337472 (44.7%) @4.1x, remaining 0:37 RBU  99.6% UBU  53.1%
      182779904/367337472 (49.8%) @4.0x, remaining 0:33 RBU 100.0% UBU  55.1%
      200900608/367337472 (54.7%) @3.9x, remaining 0:29 RBU 100.0% UBU  61.2%
      219971584/367337472 (59.9%) @4.1x, remaining 0:26 RBU  97.3% UBU  53.1%
      238157824/367337472 (64.8%) @3.9x, remaining 0:23 RBU 100.0% UBU  57.1%
     



    The Sensible Way

    There's no reason to use mkisofs and create an isofile, it wastes time and resources.

    You could have just done this:

    growisofs -M /dev/dvd1 -R -J /var/www/vhosts

    *-R and -J are for Rockridge and Joliet extensions so you don't get annoying 8-character long, truncated filenames

     

    *Actually my preferred way is this:

    growisofs -M /dev/dvd1 -R -J -joliet-long -iso-level 3 /filenordir/name

    -joliet-long gives you much longer filenames

    -iso-level 3 helps too

    This is the perfect setup, in both Linux, Windows and a DVD Player the filenames are shown as expected.


  • SSH Problem User username from 127.0.0.1 not allowed because not listed in AllowUsers


    User username from 127.0.0.1 not allowed because not listed in AllowUsers

    What's going on?  The user was created properly, it has been defined as having a shell entry and the entry for /etc/passwd and /etc/shadow is set just fine.

    This is a new and very smart/secure feature of SSHD.  It is simple and yet effective, but also very annoying if you didn't know about it being implemented and that hand editing of /etc/ssh/sshd_config is required to allow a newly added SSH user access.

    vi /etc/ssh/sshd_config

    Search for "AllowUsers"

    You'll probably see this:

    AllowUsers root

    Just add your user underneath:

    Eg. AllowUsers YourUserName

    That's all there is to it.


  • Bash Scripting Variable Scope Using Piped While Loop


    I've been struggling with this for awhile, wondering why all of my variables are null.  I just realized the variables disappear after leaving this while loop.

    Note that I'm piping to the while loop which makes a subshell I believe which is the cause of the issue:

     

    echo "$accounts"|while read thisline; do
       somevariable="some value"
       (( ++counter ))
    done

    At all costs you need to avoid the style above, use a for loop or whatever it takes BUT DO NOT pipe anything in or the variables you get from the loop will be NULL


  • BASH Decrement Does not work


    track-=1

    produces

    track: command not found

    It's weird because track+=1 works just fine

    The solution is to used the old fashion method:

    track=$(($track - 1))


  • BASH script error "((: 08: value too great for base (error token is "08")"


    ((: 08: value too great for base (error token is "08")

    Here is the code that caused it for ((track=1;track <= $number_of_tracks;track+=1));do

    Also in each iteration "track" is padding with zeros using: track=`printf "%02d" $track`

    It doesn't happen until you pass 8 to it, if you pass 1,2,3,4,5,6 or 7 it works fine.  I read this is because it sees these numbers as octal numbers (it as in many progamming languages and also the BASH shell).

     

     


  • Viewing and Connecting to an SMB Samba Share on Windows/Linux/Unix


    This will give you the basic info needed to browse and connect to Samba shares from the command line.  From the GUI of Gnome or KDE etc, it is pretty standard and straight forward.  However, I've found very little guides on how to do it from the command line and if you're like me, a nerd who prefers command line for its simplicity and for remote use, this is the way to go.

    First get a list of all the Samba/SMB shares on the target.

    smbclient -L hostname (or IP address).

    If you need to specify a specific username you would use:

    smbclient -U username -L hostname 

    If you are prompted for a password and you know one is not required, just hit enter (in this kind of case it doesn't matter what username you authenticate as).

    The list of SMB Samba shares has been returned

    Domain=[OURHOUSE] OS=[Unix] Server=[Samba 3.0.28-0.el4.9]

            Sharename       Type      Comment
            ---------       ----      -------
            DVDROMExternal  Disk
            dump            Disk
            driveshare      Disk

    Connect to the chosen SMB Samba Share

    smbclient \\hostname\sharename

    Yes, you read it right.  The first part before the hostname contains 4 backslashes \\

    And the part before share name contains two backslashes \

    smb: > ls
      .                                   D        0  Fri Feb 27 08:50:50 2009
      ..                                  D        0  Thu Jan  8 14:32:19 2009
      New Folder                          D        0  Sat Jan 26 16:24:54 2008
      test                                D        0  Sun Sep  7 18:29:26 2008
      fdsfd                               D        0  Sun Jan 27 11:37:55 2008

    You'll be prompted with something like the above.  Note that I did type "ls" to get the list of folders.

    The rest is pretty normal and straight forward for anyone who has ever used command line ftp.

    An SMB share retrieval example:

    If you want to download a file called "test" just type:

    mget test

    If you want to recursively get a bunch of directories just do this:

    recurse
    prompt
    mget *

    The recurse is obvious, it means to get a directory and recursively so that means everything inside.

    The prompt takes away the annoying prompt, that means for each transfer you wont' be prompted to manually confirm.


    An alternate and preferred way using SMB over CIFS

    If that annoys you, you can simply mount the share on your local system and then browse, retrieve and make/write files as you like (assuming your permissions on the SMB server allow for it).

    Others may have had different experiences but I can only get mounting with CIFS working by using the IP and not the hostname.

    mount -t cifs //192.168.1.24/driveshare /mnt/cifs -o user=guest,pass=bla

    If you try with the hostname dmesg will produce this message:

    CIFS VFS: cifs_mount failed w/return code = -22

     Mounting SAMBA SMB CIFS shares at boot time by using /etc/fstab

    Just add a line like this to /etc/fstab

    //192.168.1.24/driveshare /mnt/cifs cifs        user=guest,pass=bla 0 0

    Be sure to modify the user and pass options if you require a specific user and password to connect to the share.

     


  • Configuring OCFS2 Clustered File System on Debian Based Linux including Ubuntu and Kubuntu


    There's a lot of information and guides on OCFS2 for RHEL and Centos Linux but the package setup and configuration is slightly different and this has thrown some people off.

    Installing OC2FS

    You should install the following packages to get started:

    apt-get install ocfs2-tools ocfs2console

    Configure OC2FS

    In RHEL/Centos the main configuration file is located in /etc/sysconfig/o2cb

    However in Debian based Linux it is located in: /etc/default/o2cb (I don't think either make sense, why not just have a dir inside /etc/ called ocfs2 ?)

    Open the file: /etc/default/o2cb and change the following line:

    O2CB_ENABLED=false

    to O2CB_ENABLED=true

    This enables OCFS2 to startup at boot time (which you obviously should want if you are using such a filesystem).

    Setup OC2FS cluster.conf

    You'll need to manually create this path:

    mkdir /etc/ocfs2

    now touch /etc/ocfs2/cluster.conf

    Here is the cluster.conf I created (you can have less/more nodes if you like):

    node:
            ip_port = 7777
            ip_address = 192.168.1.115
            number = 1
            name = one
            cluster = ocfs2
    node:
            ip_port = 7777
            ip_address = 192.168.1.116
            number = 2
            name = two
            cluster = ocfs2
    cluster:
            node_count = 2
            name = ocfs2

    The hostname must be correct for the node, meaning it has to be the actual hostname.

    Under "cluster" that is the name you will be calling your cluster. Make sure that in /etc/default/o2cb the parameter matches (by default it is set to ocfs2 but it can be changed if you like).

    Also make sure under each node that the cluster value is correct.  cluster is the name of the OCFS2 filesystem/cluster you want those nodes to belong to.

    Move cluster.conf to each node (remember that each node must have the exact same cluster.conf)

    Start the o2cb service: /etc/init.d/o2cb start

    Loading module "configfs": OK
    Mounting configfs filesystem at /sys/kernel/config: OK
    Loading module "ocfs2_nodemanager": OK
    Loading module "ocfs2_dlm": OK
    Loading module "ocfs2_dlmfs": OK
    Mounting ocfs2_dlmfs filesystem at /dlm: OK
    Starting O2CB cluster ocfs2: OK

     Checking the status of o2cb should show something like this (if everything is correct):

    /etc/init.d/o2cb status
    Module "configfs": Loaded
    Filesystem "configfs": Mounted
    Module "ocfs2_nodemanager": Loaded
    Module "ocfs2_dlm": Loaded
    Module "ocfs2_dlmfs": Loaded
    Filesystem "ocfs2_dlmfs": Mounted
    Checking O2CB cluster ocfs2: Online
    Heartbeat dead threshold = 7
      Network idle timeout: 10000
      Network keepalive delay: 5000
      Network reconnect delay: 2000
    Checking O2CB heartbeat: Active

    Format your OCFS2 partition:

    mkfs.ocfs2 -b 4k -C 32K -L "MyOCFS2Cluster" -N 4 /dev/sda2

    Make sure you replace "/dev/sda2" with the partition you want.  Don't make a mistake here because you'll lose all data on whatever partition you specify.

    The "-N 4" stands for slots for up to 4 nodes, note that this can be increased but can't be decreased.  You shouldn't have a number higher than you need (or at least not much).  The Oracle documentation says you can always add more node slots though.

    Mount your OCFS2 partition

    mount /dev/sda2 /mnt/sda2

    Debian/Kubuntu Error when mounting

    On Kubuntu 8.04 I got this error, I'm not sure if the Debian package itself has this problem but here it goes:

    mount.ocfs2: Node manager kernel module is not loaded probably because o2cb service not started

    Everything is fine configuration file wise, but there is a bug in the init script provided by the Kubuntu Package.

    You can fix it by: adding "load_module ocfs2_stackglue" to the LOAD_ACTIONS in /etc/init.d/o2cb

    Or you can just manually modprobe ocfs2_stackglue

    This is supposed to be fix in the latest package, but as of the time of this writing (April 7th, 2009) the latest package is the one I have.  I guess the udpated version hasn't been distributed yet.


  • Samba SMB Error - Server not using user level security and no password supplied. tree connect failed: NT_STATUS_WRONG_PASSWORD


    Server not using user level security and no password supplied.
    tree connect failed: NT_STATUS_WRONG_PASSWORD

    That happens when trying to use smbclient to connect to a share.  The weird thing is that I can authnenticate just fine from Windows XP.

    It is partially my mistake, I forgot this share does have a password.  I've tried authenticating with the correct user and also with "Guest" because this works in Windows.  In Linux I get:

    Server not using user level security and no password supplied.
    Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
    tree connect failed: SUCCESS - 0

    A lot of places suggest adding this to the global portion of smb.conf on the server:

    client lanman auth = Yes
     

    It doesn't work in my case (yes SMB has been restarted), maybe because the client and servers are mixed.

    Server=Centos 4: samba-3.0.28-0.el4.9

    Client=Kunbuntu 8.04: 2:3.2.3-1ubuntu3.4

    ==========================

    Working/Broken Current smb.conf File:

      workgroup = OURHOUSE
      domain master = no
      #client lanman auth = Yes
      #lanman auth = Yes
      hosts allow = 192.168.1.
      log file = /var/log/samba/smbd.log
      max log size = 50
      # security = user
      # when I
      security = user
      encrypt passwords = yes
      smb passwd file = /etc/samba/smbpasswd
      unix password sync = Yes
      #passwd program = /usr/bin/passwd %u
      #passwd chat = *New*UNIX*password* %nn *ReType*new*UNIX*password* %nn *passwd:*all*authentication*tokens*updated*successfully*
      guest account = hostmeister
      socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
      wins support = yes
      printcap name = cups
      printing = cups
      cups options = "raw"
      use client driver = yes

    With security=user I can authenticate from the smbpasswd file from Linux to the password protected share.

    But now in Windows I can't authenticate and I can't browse any shares at all.

    This is why I used to have "security=share", because Windows users could view all the public shares without logging in, and they would only have to login in the case of a share that specified "valid users=someuser".

    This is still not a very good solution at all.

    Samba Allows One Security Mode At A Time

    Documentation I read says you can only have anonymous shares (security=share) or user level authenticated shares (security=user).  I understand that part as it is obvious from the config file :)

    The annoying thing is that I believe SAMBA is the culprit here.  The client or server (whoever is most responsible for this mess) should be fixed.

    In reality the method security=share method makes the most sense.  Why?  Because the anonymous shares can be easily accessed by the public which is the intended functionality.

    And when connecting from a Windows client, it seems to automatically send the username as one of the allowed users and accepts the password for protected/private shares.

    The only very annoying issue, is that we can see above that Linux Samba clients won't be able to do this, whether you specify the correct username and password or not.

    It seems like the Windows SMB client and Samba Unix client's access things differently.  It also could be that either/or the Samba Server and Client see that the "public" security option is set and refuse to accept or authenticate with any password, which is a really stupid and undesired kind of behavior.

    This explains the message "Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled" coming up from the Samba client even though the "client lanman auth" options were enabled.  I guess in effect the mechanism to authenticate from a Unix Samba client is made impossible once you set the security=share. 

    One Pitfall In Windows To Avoid

    I spent hours wondering why my main Windows client could not longer connect to the share, it was just saying I dont' have permission and even when prompting for a password nothing worked.

    I found that Windows caches the way it authenticates or the password it sends or some other strange thing.  Rebooting made it authenticate properly and accept the password so I could get to the shares.

    You can run this to delete all connections: net use * /delete
     


  • OCFS2 crash


    When trying to even cd or ls the mounted OCFS2 partition it crashes.  I think this is a combination of VMWare Server's problem and the way I mounted and symlinked to it.

    More than anything this shows the problem and lack of forsight with VMWare, but also that OCFS2 is easily crashed if you do strange things.

    Output of /var/log/messages for OCFS2

     

    Apr 10 15:57:45 localhost kernel: [84331.691258] Modules linked in: vmnet vmci vmmon ocfs2_stack_o2cb ocfs2 ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs nls_cp437 cifs af_packet binfmt_misc rfcomm bridge stp bnep sco l2cap bluetooth ppdev ipv6 powernow_k8 cpufreq_ondemand cpufreq_conservative cpufreq_userspace cpufreq_stats cpufreq_powersave freq_table pci_slot video output container wmi sbs sbshc battery iptable_filter ip_tables x_tables ac lp psmouse serio_raw k8temp evdev pcspkr nvidia(P) agpgart shpchp pci_hotplug parport_pc parport snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device button i2c_nforce2 isp1760 i2c_core snd soundcore snd_page_alloc ext3 jbd mbcache sd_mod crc_t10dif sr_mod cdrom sg pata_acpi pata_amd ata_generic sata_nv libata ehci_hcd forcedeth ohci_hcd usbcore scsi_mod dock thermal processor fan fbcon tileblit font bitblit softcursor fuse [last unloaded: vmnet]
    Apr 10 15:57:45 localhost kernel: [84331.691258]
    Apr 10 15:57:45 localhost kernel: [84331.691258] Pid: 11293, comm: vmware-vmx Tainted: P          (2.6.27-11-server #1)
    Apr 10 15:57:45 localhost kernel: [84331.691258] EIP: 0060:[<c038d242>] EFLAGS: 00003246 CPU: 1
    Apr 10 15:57:45 localhost kernel: [84331.691258] EIP is at _spin_unlock_irqrestore+0x22/0x40
    Apr 10 15:57:45 localhost kernel: [84331.691258] EAX: 00003246 EBX: 00003246 ECX: c0b64204 EDX: 00003246
    Apr 10 15:57:45 localhost kernel: [84331.691258] ESI: c0b6420c EDI: 00003246 EBP: d6017c94 ESP: d6017c88
    Apr 10 15:57:45 localhost kernel: [84331.691258]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Apr 10 15:57:45 localhost kernel: [84331.691258] CR0: 8005003b CR2: a4706000 CR3: 088f8000 CR4: 000006b0
    Apr 10 15:57:45 localhost kernel: [84331.691258] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Apr 10 15:57:45 localhost kernel: [84331.691258] DR6: ffff0ff0 DR7: 00000400
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90e2069>] ocfs2_should_refresh_lock_res+0xf9/0x1c0 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01802c6>] ? handle_edge_irq+0xd6/0x120
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90e254d>] ocfs2_inode_lock_update+0xad/0x5c0 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c038d1bd>] ? _spin_lock+0xd/0x10
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90f50b2>] ? ocfs2_wait_for_recovery+0x32/0xc0 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90e5b1d>] ocfs2_inode_lock_full+0x37d/0x6f0 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90e6166>] ocfs2_inode_lock_with_page+0x26/0x80 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90d35cb>] ocfs2_readpage+0x4b/0x290 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c018bdc3>] ? find_get_page+0x23/0xb0
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c018db1b>] do_generic_file_read+0x1cb/0x4d0
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c018dec3>] generic_file_aio_read+0xa3/0x1d0
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c018b960>] ? file_read_actor+0x0/0xe0
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90dd62f>] ? ocfs2_inode_unlock+0xff/0x1f0 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<f90e941f>] ocfs2_file_aio_read+0xdf/0x460 [ocfs2]
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01bad89>] do_sync_read+0xd9/0x120
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c023dfb4>] ? aa_file_permission+0x14/0xc0
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c014f040>] ? autoremove_wake_function+0x0/0x50
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c021c494>] ? security_file_permission+0x14/0x20
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01bae1d>] ? rw_verify_area+0x4d/0xc0
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01ba8ab>] ? fsnotify_access+0x6b/0x80
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01bb53d>] vfs_read+0x9d/0x110
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01bacb0>] ? do_sync_read+0x0/0x120
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c01bb633>] sys_pread64+0x83/0x90
    Apr 10 15:57:45 localhost kernel: [84331.691258]  [<c0109f03>] sysenter_do_call+0x12/0x2f
    Apr 10 15:57:45 localhost kernel: [84331.691258]  =======================

    Restart OCFS2 Service

    service ocfs2 restart

    Stopping Oracle Cluster File System (OCFS2) Failed
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    /mnt/sda2:          cmcmcccc
    Could not kill process 11592: No such process
    Could not kill process 11770: No such process
    Could not kill process 12273: No such process
    Could not kill process 12360: No such process
    /var/lib/vmware/Virtual_Machines:cmcmcccc
    Could not kill process 5792: No such process
    Could not kill process 11279: No such process
    Could not kill process 11592: No such process
    Could not kill process 11770: No such process
    Could not kill process 11919: No such process
    Could not kill process 12273: No such process
    Could not kill process 12360: No such process
    Retry stopping Oracle Cluster File System (OCFS2) Failed
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Retry stopping Oracle Cluster File System (OCFS2) Failed
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Cannot stat /var/lib/vmware/Virtual40Machines: No such file or directory
    Starting Oracle Cluster File System (OCFS2) OK

     

    Relevant OCFS2 Mount Points & Symlinks

    /mnt/sda2/VMWare on /var/lib/vmware/Virtual Machines type none (rw,bind)

    I think the space in "Virtual Machines" is half the problem and I was also experimenting on it with new symlinks and even deleting it at some points.  I think this is what did it since that "Virtual Machines" was remounted from the OCFS2 partition.
     


  • SIOCSIFADDR No such device eth0 error while getting interface flags - eth0 Ethernet Device can


    I got this after copying a VMWare image onto another machine in Debian.

    SIOCSIFADDR No such device eth0 error while getting interface flags

    The solution

    1.) Find and edit the device line in persisent-net.rules note it will be prefixed with something like z25 or something else.

    vi /etc/udev/rules.d/z25_persistent-net.rules

    The easiest way is to comment anything out.

    If you are feeling lazy you can just reboot your computer and everything should come back.  If you don't want to reboot follow steps 2 & 3 below.

    2.) Now restart udev /etc/init.d/udev restart

    3.) Reload the Module.  I found the name is pcnet32

    So in my case you unload the module like this: modprobe -r pcnet32

    Now reload the module: modprobe pcnet32

    Now if you do: ifup eth0 everything should be fine.

     


    If the above doesn't work. 

    I copied the same VM again and got the same error, I tried commenting out those lines and rebooting and it wouldn't work.  I tried deleting all lines and there was no luck.  Later on I noticed that another line was adding my device at "eth3". I changed that reference to eth0 but still could not bring it up.

    The solution was to just delete this file: z25_persistent-net.rules

    After a reboot my ethernet card was working again.  This is a really annoying feature of Debian and UDEV.

     


  • SSH Server Slow/Lagged/Delayed Login Response


    This is really something the SSH Server developers should consider.  The cause of this annoyance is because of failed DNS lookups on your IP address, which is especially common for many dedicated/col-located servers and also computers on internal NAT/private networks.

    The chances are this is the cause of your SSH Slow/Delayed Login problems.

    The easy solution to SSH Login Problems

    Edit /etc/ssh/sshd_config

    Add this line to disable reverse DNS lookups when someone is logging into your SSH Server:

    UseDNS no

    It would make sense for this option to be disabled by default, especially considering that someone could have a fake or invalid reverse DNS which makes it impossible to find who was really logged in or trying to login.

    The SSH daemon should not initially due any reverse DNS or at least allow the login process to continue and try a few more times during the session to find the reverse DNS if it must.


  • mkisofs error "genisoimage: Directories too deep for 'Backup/My Documents/My Music/iTunes/Album Artwork/Local/5928CE9C1AFAC465/07/15' (7) max is 6."


    genisoimage: Directories too deep for 'Backup/My Documents/My Music/iTunes/Album Artwork/Local/5928CE9C1AFAC465/07/15' (7) max is 6.

    Some people said choosing the --iso-level-4 option will help.  I just opted to add the "-D" switch and everything was fine.


  • resume: could not stat the resume device file


    resume: could not stat the resume device file

    I got that after migrating to a different physical hard drive, it wanted to resume from a swap partition that no longer exists.

    This is actually controlled by "uswsusp.conf" in /etc

    Just edit it and remove the device or change it to the correct new swap file.


  • SSH Slow Login even with SSHD UseDNS no parameter


    I couldn't understand why on one system it took a few minutes to get the SSH login prompt when connecting to other systems. The other systems all had the UseDNS parameter set to no, which almost always resolves the login prompt delay.

    The reason is Ubuntu and perhaps Debian and other distributions /etc/nsswitch.conf file

    Edit yours to have the "hosts" line like so (notice that files and dns are the primary resolution choice)

    hosts:          files dns mdns4_minimal [NOTFOUND=return] dns mdns4


    If the above does not work - disable GSSAPI auth

    This permanently caused my slow SSH login problems:

    Edit vi /etc/ssh/ssh_config

    Disable GSSAPI auth by setting the following line (make sure to uncomment or change the existing line if there is one that says yes):

    GSSAPIAuthentication no

    I realized what has happening by running -v with SSH, it kept timing out and trying to use GSSAPIAuthentication before trying password, unlike some older systems I have.

    I'm sure this is a real annoyance for a lot of people too.


  • RTL8111/8168B R8169 Gigabit Link slow speeds


    This is the Intel Atom 330 motherboard with integrated Realtek Gigabit NIC (Intel Desktop Board D945GCLF2 Motherboard W/ Atom 330 1.6 GHz Dual Core Processor - Mini-ITX)

    I cannot achieve more than 15 MB/s, even doing a local transfer through eth0 to it's own IP.

    100%   95MB  15.9MB/s   00:06

    So this is not a cabling, switch or hardware issue, it seems like a driver or chipset limitation problem.

    Here is my lspci output:

    00:00.0 Host bridge: Intel Corporation 82945G/GZ/P/PL Memory Controller Hub (rev 02)
    00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)
    00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
    00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
    00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 01)
    00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 01)
    00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
    00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
    00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
    00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
    00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
    00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
    00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
    00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
    00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
    00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
    01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
     

    This is using the "r8169" driver.

    I've read lots of issues getting proper speeds with this chipset, but I'm not sure if this is a problem/unique issue on this Intel board.  I don't see why it isn't going faster considering that this is a PCI Express onboard NIC.

    At this time I don't have any ideas or solutions.

    Oh and mii-tool confirms it has a gigabit link if anyone is interested:

    eth0: negotiated 1000baseT-HD flow-control, link ok


  • Using a Mac OSX DMG Image in Windows and Converting to Standard ISO Format use dmg2iso


    The dmg format is silly and annoying to work with, why couldn't Apple stick with the .iso standard?  Anyway, there's an excellent Linux and Windows based tool to convert it back to a normal .iso Image called dmg2iso

    I'll only cover the Linux version although the Windows pre-built binary works the same way.

    Download dmg2iso here for free (from the author's website)

    It's just silly and doesn't make sense that Ubuntu doesn't have this in the repository at all, it's such a useful and almost essential tool.

    For some reason I'm getting dmg2iso compile errors on my Ubuntu 8.04 install:

    rm -f *.o dmg2iso.exe
    gcc -O3 -c dmg2iso.cc
    In file included from dmg2iso.cc:23:
    dmg2iso.h:45: error: â__int32â does not name a type
    dmg2iso.cc: In function âint main(int, char**)â:
    dmg2iso.cc:117: error: â__int32â does not name a type
    dmg2iso.cc:122: error: â__int32â does not name a type
    dmg2iso.cc:123: error: â__int32â does not name a type
    dmg2iso.cc:124: error: âblock_typeâ was not declared in this scope
    dmg2iso.cc:126: error: âout_offsâ was not declared in this scope
    dmg2iso.cc:127: error: âout_sizeâ was not declared in this scope
    dmg2iso.cc:128: error: âin_offsâ was not declared in this scope
    dmg2iso.cc:129: error: âin_sizeâ was not declared in this scope
    dmg2iso.cc:130: error: âconvert_endianâ was not declared in this scope
    dmg2iso.cc:140: error: âlast_offsâ was not declared in this scope
    dmg2iso.cc:158: error: âlast_in_offsâ was not declared in this scope
    dmg2iso.cc:161: error: âlast_offsâ was not declared in this scope
    dmg2iso.cc:172: error: âlast_offsâ was not declared in this scope
    dmg2iso.cc:172: error: âlast_in_offsâ was not declared in this scope
    dmg2iso.cc:84: warning: ignoring return value of âsize_t fread(void*, size_t, size_t, FILE*)â, declared with attribute warn_unused_result
    make: *** [dmg2iso.o] Error 1

    Instead I just downloaded the perl version.  Make sure you edit the .pl file to point to the correct path to the perl binary.  Also if you get carat M at the end of each line, remove the carat M on the first line or it will always complain perl does not exist.

     Unfortunately this tool didn't actually successfully convert the dmg image:

     

    reading property list...found 6 partitions
    decompressing:
    partition 0
    partition 1
    partition 2

    Conversion failed.File may be corrupted.

     

    I also tried the trick of:

    mount -o loop -t hfsplus file.dmg /mountpoint

    but it didn't work

    mount: wrong fs type, bad option, bad superblock on /dev/loop0,
           missing codepage or helper program, or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so

    And yes I did modprobe hfsplus and modprobe hfs with no luck unfortunately.
     

     ====================================================================

    Use dmg2img instead of dmg2iso, dmg2img is the one that supercedes the dmg2iso

    I just found this out, but I'm getting an error during make:

     

    cc -O2 -Wall -c dmg2img.c
    In file included from dmg2img.c:30:
    dmg2img.h:19:19: error: bzlib.h: No such file or directory
    In file included from dmg2img.c:30:
    dmg2img.h:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bz’
    dmg2img.h: In function ‘read_kolyblk’:
    dmg2img.h:140: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
    In file included from dmg2img.c:32:
    mntcmd.h: In function ‘read_gpt_header’:
    mntcmd.h:11: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
    mntcmd.h: In function ‘read_gpt_entry’:
    mntcmd.h:17: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
    dmg2img.c: In function ‘main’:
    dmg2img.c:327: error: ‘bz’ undeclared (first use in this function)
    dmg2img.c:327: error: (Each undeclared identifier is reported only once
    dmg2img.c:327: error: for each function it appears in.)
    dmg2img.c:456: warning: implicit declaration of function ‘BZ2_bzDecompressInit’
    dmg2img.c:456: error: ‘BZ_OK’ undeclared (first use in this function)
    dmg2img.c:471: warning: implicit declaration of function ‘BZ2_bzCompressEnd’
    dmg2img.c:482: warning: implicit declaration of function ‘BZ2_bzDecompress’
    dmg2img.c:484: error: ‘BZ_PARAM_ERROR’ undeclared (first use in this function)
    dmg2img.c:485: error: ‘BZ_DATA_ERROR’ undeclared (first use in this function)
    dmg2img.c:486: error: ‘BZ_DATA_ERROR_MAGIC’ undeclared (first use in this function)
    dmg2img.c:487: error: ‘BZ_MEM_ERROR’ undeclared (first use in this function)
    dmg2img.c:488: warning: implicit declaration of function ‘BZ2_bzDecompressEnd’
    dmg2img.c:499: error: ‘BZ_STREAM_END’ undeclared (first use in this function)
    dmg2img.c:220: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
    dmg2img.c:285: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
    dmg2img.c:516: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
    dmg2img.c:532: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
    dmg2img.c:546: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
    make: *** [dmg2img.o] Error 1

    Make sure you install libbz2-dev and libssl-dev

    Now it compiles and seems to be working unlike dmg2iso:

     

    reading property list, 1839654 bytes from address 7198731606 ...

    decompressing:
    opening partition 0 ...             100.00%  ok
    opening partition 1 ...             100.00%  ok
    opening partition 2 ...             100.00%  ok
    opening partition 3 ...              52.86%

     


  • Weird characters in Linux putty shell


    I used to get all kinds of weird annoying characters like "â" during compilation with gcc especially.

    example:

    dmg2img.c:456: error: âBZ_OKâ undeclared (first use in this function)
    dmg2img.c:471: warning: implicit declaration of function âBZ2_bzCompressEndâ
    dmg2img.c:482: warning: implicit declaration of function âBZ2_bzDecompressâ
    dmg2img.c:484: error: âBZ_PARAM_ERRORâ undeclared (first use in this function)
    dmg2img.c:485: error: âBZ_DATA_ERRORâ undeclared (first use in this function)
    dmg2img.c:486: error: âBZ_DATA_ERROR_MAGICâ undeclared (first use in this functi                
            

    I noticed the character set translation was set to something strange like "Western Europe" under Window -> Translation so I just changed this in putty and chose "UTF-8" and everything is good now.


  • Bash Script/Linux/Unix HTML/XML Parser


    There is a tool called "xml2" which will parse both HTML and XML scripts, this is very useful to do a mass extraction or conversion of data based on say an HTML table etc..

    It becomes even more powerful using bash if certain tags are identified with a certain class="" attribute or something else unique to only the tags you want.

    Happy parsing.


  • How To Save iptables firewall rules Centos/Redhat/Fedora Linux


    This is something that annoys a lot of people, fortunately the Redhat style OS's are the most simple in this respect.  I disagree that Debian's way makes sense, it is more of a hackish approach in how they implement iptables.

    Anyway, for those who are using Redhat/Centos style OS's it is very simple.

    Set your rules from the shell/command prompt and to save the iptables firewall rules so they are remember/loaded on boot just run this command:

    service iptables save

    What happens is the rules are automatically saved to /etc/sysconfig/iptables

    If you make frequent changes it's wise to manually back that file up or make copies of it.  The reason this works well is because Redhat has a smart initscript that always check upon startup for rules in the /etc/sysconfig/iptables and loads them if they are found.

    After this everytime you reboot your iptables settings will be restored and preserved.


  • Linux How to Search for text within any file using Linux/Unix - Use GREP


    It's actually very simple and "grep" makes it as easy as possible.  I'll outline a few common scenarios and provide some examples.

    Say you want to search ALL files within the current directory (and inside/deeper) for the text "phpinfo()"

    grep -R "phpinfo()" *

    If you want to search only certain files such as only .txt you would do this instead:

    grep -R "phpinfo()" *.txt

    As you can see this is another very simple but powerful feature of grep to help you find what file contains a certain word/phrase/piece of code etc..


  • sudo: Error dropping capabilities, aborting in Linux Centos 5.3


    For some reason I keep getting this error when trying to run a sudo command eg:

    sudo -u someuser somecommand

    sudo: Error dropping capabilities, aborting

    My version of sudo is: sudo-1.6.9p17-3.el5_3.1 and I've heard that version 1.7 fixes everything.  The only thing is yum does not think sudo has any update.  I guess the new version has not been committed to the RPM repository yet.

    This is really a huge and annoying bug, imagine if you have a backup script or something else that depends on sudo.   I should add that this is an OpenVZ container it's happening on, I am not sure if that is part of the issue.

    This is obviously a bug with sudo and hopefully the error will be fixed soon with a new version/update of sudo by the Centos team.

    Solution

    (it seems that some have said this is because the OpenVZ host does not have auditing in the kernel, it still seems that the sudo maintainers should be able to avoid this bug if it detects no audit capabilities though).

     

     wget http://mirror.centos.org/centos/5.3/os/SRPMS/sudo-1.6.9p17-3.el5.src.rpm

     rpm -ivh sudo-1.6.9p17-3.el5.src.rpm


    error: cannot create %sourcedir /usr/src/redhat/SOURCES

    mkdir -p /usr/src/redhat/SOURCES
    rpm -ivh sudo-1.6.9p17-3.el5.src.rpm


    vi /usr/src/redhat/SPECS/sudo.spec

    Replace:


    BuildRequires: audit-libs-devel libcap-devel

    with

    BuildRequires: libcap-devel

    Change "--with-ldap" to "--with-ldap " and add below it:
    --without-audit


    For these steps you need the "rpm-build" package.  Install it if you don't have the binary "rpmbuild" already.


    rpmbuild -bb /usr/src/redhat/SPECS/sudo.spec

    You'll get these errors unless you have the other required packages:

    error: Failed build dependencies:
            pam-devel is needed by sudo-1.6.9p17-3.i386
            openldap-devel is needed by sudo-1.6.9p17-3.i386
            flex is needed by sudo-1.6.9p17-3.i386
            bison is needed by sudo-1.6.9p17-3.i386
            automake is needed by sudo-1.6.9p17-3.i386
            autoconf is needed by sudo-1.6.9p17-3.i386
            libtool is needed by sudo-1.6.9p17-3.i386
            libcap-devel is needed by sudo-1.6.9p17-3.i386


    yum install pam-devel openldap-devel flex bison automake autoconf libtool libcap-devel


    Try again:

    rpmbuild -bb /usr/src/redhat/SPECS/sudo.spec

    Install new/updated sudo package:

    rpm -Uvh --force /usr/src/redhat/RPMS/i386/sudo-1.6.9p17-3.i386.rpm


    Now sudo away :)

     


  • Timezone Change/Updated for Linux/Unix Debian/Fedora/Ubuntu/Centos Change Update Time zone


    This way should work on all Linux machines, at least RHEL/Debian (Ubuntu) based distros but most likely all and also should work on many Unix style machines I believe.

    Many OS's have tools to update the timezone, but most of them (even if command line) require several bloated packages and even Xorg/KDE based packages etc..

    Your time zone info file is actually in /etc/localtime if you open this file in vi/vim/pico you'll see it's gibberish (binary code or another encoding).

    Anyway that is the information for your timezone.

    Note that all timezone information is stored in the following directory:

    ls /usr/share/zoneinfo/

    Africa      Atlantic   Chile    Eire     Factory  GMT-0      Iceland      Jamaica    Mexico   NZ        posix       ROC        Universal  zone.tab
    America     Australia  CST6CDT  EST      GB       GMT+0      Indian       Japan      Mideast  NZ-CHAT   posixrules  ROK        US         Zulu
    Antarctica  Brazil     Cuba     EST5EDT  GB-Eire  Greenwich  Iran         Kwajalein  MST      Pacific   PRC         Singapore  UTC
    Arctic      Canada     EET      Etc      GMT      Hongkong   iso3166.tab  Libya      MST7MDT  Poland    PST8PDT     Turkey     WET
    Asia        CET        Egypt    Europe   GMT0     HST        Israel       MET        Navajo   Portugal  right       UCT        W-SU
    
    


    Inside one of those subdirectdories will be the file with your zone information.

    For example the Pacific Standard time I use is located in: /usr/share/zoneinfo/Canada/Pacific

    There are two ways to change your timezone, you can copy the contents of your timezone file into /etc/localtime or remove your localtime file and symlink to the new timezone.

    Best Way To Update Timezone

    I think to keep the existing format (no symlink and a physical file), this is the best way:


    cat /usr/share/zoneinfo/Canada/Pacific > /etc/localtime

    This just overwrites/updates your /etc/localtime file.  For more advanced users you could just delete /etc/localtime and instead symlink to that file (same results but different method):

    rm /etc/localtime

    ln -s /usr/share/zoneinfo/Canada/Pacific /etc/localtime

    Now just type date and you'll see your timezone has been updated.

     


  • [error] server reached MaxClients setting, consider raising the MaxClients setting - Apache


    Have you ever seen this dreaded message in your Apache/HTTPD /var/log/httpd/error_log?

    [error] server reached MaxClients setting, consider raising the MaxClients setting

    The error itself is slightly misleading.  I believe this happened to one of my servers, I found Apache was running still, and that you could telnet to port 80 but no respnose would be given.

    For some reason my error log initially did not have the above error, but after a restart I saw it.  I'm assuming it was a DOS attack or increased traffic.

    The "MaxClients" setting is not the only thing to take into consideration, if you follow the above you'll get an error message like this:

    httpd: WARNING: MaxClients of 500 exceeds ServerLimit value of 10 servers,
     lowering MaxClients to 10.  To increase, please see the ServerLimit
     directive.

    So make sure you edit /etc/httpd/conf/httpd.conf

    And check the ServerLimit value first and set that to something like 100-500 and then set MaxClients


  • Linux/Unix Open SSH Login Without Password Key Exchange including Debian, Redhat, Fedora, Ubuntu, BSD etc..


    In those 4 simple commands you can setup mutual key exchange between two sshservers by using a single login shell session and single window.

    *Just change the IP address examples of (10.10.0.2) to the target of your mutual key exchange.  It doesn't matter if the server is on a LAN or WAN (well unless the server is behind a firewall and you cannot SSH into it).

    Code:
    ssh-keygen -t rsa
    cat ~/.ssh/id_rsa.pub|ssh 10.10.0.2 tee -a ~/.ssh/authorized_keys

    ssh 10.10.0.2 ssh-keygen -t rsa
    ssh 10.10.0.2 cat ~/.ssh/id_rsa.pub |tee -a ~/.ssh/authorized_keys


    • *tee simply just takes stdinput and redirects it to where ever you say.
    • *on some systems you'll need to chmod 600 ~/.ssh/authorized_keys


    If you want to do it the hard way, on both servers you can just run this command:

    ssh-keygen -t rsa

    Just keep hitting enter, and then copy and paste the contents of:

    ~/.ssh/id_rsa.pub into the other servers "~/.ssh/authorized_keys" file.

    Be careful not to add any extra spaces or line breaks when copying it or it won't work.

     

     

     


  • Unixbench Score with Glusterfs/Openvz & Quad Core Xeon


    This is very disappointing since GlusterFS markets itself as a solution to deploy VPS servers on.  On the HN itself I get a Unixbench of about 360.

    I'm also using an SSH tunnel to secure the communications, but even before that, things seemed very slow.

     

     


       #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
       #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
       #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
       #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
       #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
        ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

                     4        1           Based on the Byte Magazine Unix Benchmark
                    44       11
       v   v       4 4        1
        v v       44444       1           v4.1 revisions mostly by David C. Niemi,
         v           4   o   111 - WHT.2  Reston, VA, USA  <niemi@tux.org>

    WHT Variant by Andy A. Lee <andylee@dslextreme.com>
    See: http://www.webhostingtalk.com/showthread.php?s=&threadid=308055


    Dhrystone 2 using register variables  1 2

    Double-Precision Whetstone  1 2

    Execl Throughput  1

    Filesystem Throughput 1024 bufsize 2000 maxblocks  1

    Filesystem Throughput 256 bufsize 500 maxblocks  1

    Filesystem Throughput 4096 bufsize 8000 maxblocks  1

    Pipe Throughput  1 2

    Pipe-based Context Switching  1 2

    Process Creation  1

    System Call Overhead  1 2

    Shell Scripts (8 concurrent)  1

    ==============================================================
    BYTE UNIX Benchmarks (Version 4.1-wht.2)
    System -- Linux 2.6.18-128.2.1.el5.028stab064.7PAE #1 SMP Fri Au                                                                             g 21 03:42:35 MSD 2009 i686 i686 i386 GNU/Linux
    /dev/simfs            62914560       128  62914432   1% /

    Start Benchmark Run: Thu Oct 29 10:46:06 PDT 2009
     10:46:07 up 12:34,  1 user,  load average: 0.00, 0.00, 0.00

    End Benchmark Run: Thu Oct 29 10:57:12 PDT 2009
     10:57:13 up 12:45,  1 user,  load average: 17.19, 6.09, 2.29


                         INDEX VALUES
    TEST                                        BASELINE     RESULT      INDEX

    Dhrystone 2 using register variables        376783.7 18960034.8      503.2
    Double-Precision Whetstone                      83.1     1033.6      124.4
    Execl Throughput                               188.3       22.1        1.2
    File Copy 1024 bufsize 2000 maxblocks         2672.0     7177.0       26.9
    File Copy 256 bufsize 500 maxblocks           1077.0     1897.0       17.6
    File Read 4096 bufsize 8000 maxblocks        15382.0    53051.0       34.5
    Pipe-based Context Switching                 15448.6   524919.6      339.8
    Pipe Throughput                             111814.6  1425479.4      127.5
    Process Creation                               569.3       70.7        1.2
    Shell Scripts (8 concurrent)                    44.8        3.8        0.8
    System Call Overhead                        114433.5  2012543.7      175.9
                                                                     =========
         FINAL SCORE                                                      28.4


  • yum error not working rpmdb: mmap: No such device TypeError: rpmdb open failed


    Loaded plugins: fastestmirror
    rpmdb: mmap: No such device
    error: db4 error(19) from dbenv->open: No such device
    error: cannot open Packages index using db3 - No such device (19)
    error: cannot open Packages database in /var/lib/rpm
    Traceback (most recent call last):
      File "/usr/bin/yum", line 29, in ?
        yummain.user_main(sys.argv[1:], exit_code=True)
      File "/usr/share/yum-cli/yummain.py", line 229, in user_main
        errcode = main(args)
      File "/usr/share/yum-cli/yummain.py", line 84, in main
        base.getOptionsConfig(args)
      File "/usr/share/yum-cli/cli.py", line 184, in getOptionsConfig
        enabled_plugins=self.optparser._splitArg(opts.enableplugins))
      File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 191, in _getConfig
        self._conf = config.readMainConfig(startupconf)
      File "/usr/lib/python2.4/site-packages/yum/config.py", line 754, in readMainConfig
        yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
      File "/usr/lib/python2.4/site-packages/yum/config.py", line 824, in _getsysver
        idx = ts.dbMatch('provides', distroverpkg)
    TypeError: rpmdb open failed

     

    I tried running the rpm rebuilddb but it won't work:

     

    rpm --rebuilddb
    rpmdb: mmap: No such device
    error: db4 error(19) from dbenv->open: No such device
    error: cannot open Packages index using db3 - No such device (19)


  • Unixbench Score with Glusterfs/Openvz & Quad Core Xeon - Updated with GlusterFS 2.0.8


    You might remember my original GluserFS/OpenVZ benchmark which produced a horrible 29.8

    This is the exact same system, but using the latest 2.0.8 (with some small files patch which speeds up performance) you can see it is about 25% faster.

    I also haven't tuned my config files at all, but there are some settings that should increase performance on small files which I believe is the main cause of slow performance when running GlusterFS under OpenVZ

     




       #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
       #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
       #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
       #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
       #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
        ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

                     4        1           Based on the Byte Magazine Unix Benchmark
                    44       11
       v   v       4 4        1
        v v       44444       1           v4.1 revisions mostly by David C. Niemi,
         v           4   o   111 - WHT.2  Reston, VA, USA  <niemi@tux.org>

    WHT Variant by Andy A. Lee <andylee@dslextreme.com>
    See: http://www.webhostingtalk.com/showthread.php?s=&threadid=308055


    Dhrystone 2 using register variables  1 2

    Double-Precision Whetstone  1 2

    Execl Throughput  1

    Filesystem Throughput 1024 bufsize 2000 maxblocks  1

    Filesystem Throughput 256 bufsize 500 maxblocks  1

    Filesystem Throughput 4096 bufsize 8000 maxblocks  1

    Pipe Throughput  1 2

    Pipe-based Context Switching  1 2

    Process Creation  1

    System Call Overhead  1 2

    Shell Scripts (8 concurrent)  1

    ==============================================================
    BYTE UNIX Benchmarks (Version 4.1-wht.2)
    System -- Linux 2.6.18-128.2.1.el5.028stab064.7PAE #1 SMP Fri Aug 21 03:42:35 MSD 2009 i686                                                   i686 i386 GNU/Linux
    /dev/simfs            62914560   1871360  61043200   3% /

    Start Benchmark Run: Sat Nov 28 16:49:57 PST 2009
     16:49:57 up 18:00,  1 user,  load average: 0.16, 0.03, 0.01

    End Benchmark Run: Sat Nov 28 17:00:28 PST 2009
     17:00:28 up 18:11,  1 user,  load average: 16.02, 5.51, 2.09


                         INDEX VALUES
    TEST                                        BASELINE     RESULT      INDEX

    Dhrystone 2 using register variables        376783.7 19600869.3      520.2
    Double-Precision Whetstone                      83.1      984.9      118.5
    Execl Throughput                               188.3       75.1        4.0
    File Copy 1024 bufsize 2000 maxblocks         2672.0     7127.0       26.7
    File Copy 256 bufsize 500 maxblocks           1077.0     1854.0       17.2
    File Read 4096 bufsize 8000 maxblocks        15382.0    54315.0       35.3
    Pipe-based Context Switching                 15448.6   500165.4      323.8
    Pipe Throughput                             111814.6  1570669.8      140.5
    Process Creation                               569.3      186.1        3.3
    Shell Scripts (8 concurrent)                    44.8       15.9        3.5
    System Call Overhead                        114433.5  2170342.9      189.7
                                                                     =========
         FINAL SCORE                                                      39.8
     


  • Clustered/Distributed Network Filesystems, Which Ones live up to the hype?


    I've tried to find a good sensible solution to cluster with and each technology has it's pros and cons and there is no perfect solution and I've found a lot of "exaggerations" in the applications, benefits and performance of these different filesystems.

    DRBD

    I first started off with DRBD and I have to say it does live up to the hype, is quite reliable (although it can be annoying to match up the kernel module and user applications since they must match and when upgrading kernels you may find you have a version mismatch which can bring down your whole cluster if you don't plan and test ahead of time).  The performance is perfect (it gives 100% network bandwidth performance if you chose).  I like that it writes first (locally) and then transfers those files over the network.  It gives you a perfect blend of essentially native performance and the redunancy you require and even allows you to control the transfer rate.

    The drawbacks are some I mentioned, that userspace and kernel modules must match and upgrading one or the other (which often will cause a version mismatch) will bring your cluster down if you aren't careful to plan ahead.  A lot of times you have to manually compile something whether it's the kernel module or userspace tools.  It also does not handle "split-brain" in an easy and obvious way.  The documentation is generally quite good/useful, but it left me searching high and dry to find the best way to handle split-brain.

    DRBD's other drawback/annoyance is that you must actually dedicate a full partition to it which is often not a preferred or ideal solution.

    The other large benefit is that it acts like a native/local filesystem and I've never had any application issue when using it for any kind of VPS use (many do have their quirks with virtualization such as OCFS2 and GlusterFS).

    Another drawback of DRBD is also the fact that it ONLY knows how to be RAID1, you can't aggregate your storage, but it's a great way to mirror data between different sites or for redunancy purposes and it works perfectly if a RAID1 network solution is what you need.  I'd say it's the most robust and polished for what it does.

    OCFS2

    OCFS2 isn't that hard to configure but what's the point of it?  It is basically a clustered/aggregated RAID0 filesystem so it has absolutely no redunancy.  I almost don't understand the point of it, unless you need vast amounts of storage without any regard for data integrity.  Supposedly OCFS2 is self healing which is good, but it's not really enterprise ready in mind without any built-in redunancy options.

    OCFS2 also crashes when using things like VMWare, I tried all kinds of work arounds but kept getting crashes.  It's not a full-featured filesystem and VMWare can sense this.

    I also dislike all the different services associated with it. If something breaks you have to figure out in what order to reload kernel modules and the two associated services with it  This makes it a bit stressful and unnecesarily complex.

    I will say it could be a great solution for a mass on-line RAID0 type array if downtime and redundancy aren't of any concern (maybe for Photobucket type places0.

    I still don't see the relevance of OCFS2 and it seems overly complicated without any special features or anything at all that would prompt me to use it, but at least I can say I tried and played around with it.

    GlusterFS

    I'd say it is pretty good, but has always been overrated and overhyped.  There are often performance issues associated with it and the GlusterFS documentation is sparse and cryptic at best.

    It has been touted as something you should run VPS's under, but I've tried this with poor results.  Things are improving, but it seems that a number of years after it's release that it still hasn't fully matured and still has a long way to go.

    However, with a little tweaking I think GlusterFS may be the most practical all-around solution for almost any use.  You can set it up to be RAID 0+1 or almost any other way imaginable and you can aggregate the storage bricks.

    Best of all you can use your existing filesystem and space, there's no need to dedicate a partition to it.  The bad thing is that there's no way to control transfer rates like DRBD, and there doesn't seem to be a way to control the way data is written.

    I'd prefer to have an option like DRBD where the write is done locally and then transferred over the wire, this would make it possible and practical for VPS solutions.

    The other issue is lack of MMAP support and that for some other reason Checkpointing VPS's does not work because of the underyling filesystem structure.

    I think I'm being hard on GlusterFS because I think it's only starting to coming close to living up to its hype and has a lot of common sense, fundamental issues that have not been resolved or addressed when they should have been done immediately.

    With that said, if GlusterFS can provide better documentation, performance and flexibility (DRBD style delayed writes) then I think it could come out on top as the one-stop solution which will be superior in everyway.


  • Unixbench Score with Glusterfs/Openvz & Quad Core Xeon - Updated with GlusterFS 2.0.8 & Optimized Client Config


    The results are still not flattering and are nothing close to native performance.  Unless GlusterFS has a "DRBD-like" option to delay writes over the network and to only read from the client side, I don't see how performance can ever improve much more.

    After doing some client optimizations I added more to the score:

     


    Start Benchmark Run: Sun Nov 29 00:37:44 PST 2009
     00:37:44 up 3 min,  1 user,  load average: 0.01, 0.02, 0.00

    End Benchmark Run: Sun Nov 29 00:48:00 PST 2009
     00:48:00 up 14 min,  1 user,  load average: 14.43, 4.74, 1.77


                         INDEX VALUES
    TEST                                        BASELINE     RESULT      INDEX

    Dhrystone 2 using register variables        376783.7 20568131.5      545.9
    Double-Precision Whetstone                      83.1     1157.8      139.3
    Execl Throughput                               188.3      490.0       26.0
    File Copy 1024 bufsize 2000 maxblocks         2672.0      563.0        2.1
    File Copy 256 bufsize 500 maxblocks           1077.0      550.0        5.1
    File Read 4096 bufsize 8000 maxblocks        15382.0    58805.0       38.2
    Pipe-based Context Switching                 15448.6   543265.9      351.7
    Pipe Throughput                             111814.6  1596349.1      142.8
    Process Creation                               569.3     2885.6       50.7
    System Call Overhead                        114433.5  2277096.2      199.0
                                                                     =========
         FINAL SCORE                                                      57.7
     


  • GRUB "Error 2: Bad file or directory type" 0.97 won


    You can see the problem below, GRUB recognizes my hard drive and sees the partitions but cannot access them.  This is from the GRUB boot disc I'm using.

    What happened is that I had some power issues causing this system's power to be interrupted several times and basically an on/off on/off situation.

    The system won't boot, I just get a flashing cursor and no message or error from GRUB.  Obviously the problem is that my MBR seems corrupt or some other issue.

    My filesystem is ext3 and running fsck does not find any errors.  I'm stumped, this system won't boot and I can't even use GRUB to repair the MBR.  The data seems fine, the BIOS of course recognizes the HDD and I can mount all partitions without any difficulty.

     *Update

    I was able to get my system to boot, it seems that maybe running the fsck did fix something.  I also believe there are differences between some GRUB versions, although both my boot CD and GRUB on my OS show .97, the boot disc was not able to read anything on the partition.  This is still very strange and I'm not sure why things changed and suddenly worked.

    It seems this was caused by the 256 byte inode issue reported here: http://www.linuxplanet.com/linuxplanet/tutorials/6480/1/

    But still, both versions are .97 but I assume the one on the OS partition is patched or updated to support the 256 byte inodes.  This is a very silly move on the part of the EXT3 filesystem maintainers and it would also be nice for GRUB to release an update to support this new style of inodes on EXT3 and EXT4 systems.

        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

           [ Minimal BASH-like line editing is supported.   For
             the   first   word,  TAB  lists  possible  command
             completions.  Anywhere else TAB lists the possible
             completions of a device/filename. ]

    grub> root (hd0,0)/
    Error 2: Bad file or directory type

    grub> root (hd0,
     Possible partitions are:
       Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
       Partition num: 1,  Filesystem type unknown, partition type 0x83
       Partition num: 2,  Filesystem type is ext2fs, partition type 0x83
       Partition num: 3,  Filesystem type is ext2fs, partition type 0x83

    grub> root (hd0,

     


  • SAMBA/SMB Share "Write" Access without Delete


    There is a nice mode that Samba supports which you can add to smb.conf

    create mode=555

    This way users can create and write files/directories without deleting (except I believe dirs can be deleted but only if there are no files inside).

    It's too bad that Linux does not have built-in "write"/"delete" privileges and is something that even Windows 98 can trump.


  • How To Enable 3rd/third party packages in RHEL/Redhat/Centos 4/5 Linux via RPMForge


    It's a bit of a pain that many basic third party tools that aren't put of the main Centos/RHEL repositories are not available unless you compile them or install the RPMForge Repo.

    *Updated 08/29 with new download location changed from apt.sw.be to rpmforge.sw.be

    Here's a quick, simple/cut&paste way to do it:

    wget http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm

    rpm -i
    rpmforge-release-0.5.1-1.el5.rf.i386.rpm

    After this you'll be able to install other useful tools such as bmon, etc... things that are available with any Debian based distribution in standard form.


  • MySQL "Got error 28 from storage engine"


    I've gotten this error enough to bother posting about it, because I've come across so many servers where this happens, so what could "Error 28" possibly mean?  Is your database corrupt, or is this a sign of a RAID failure/corruption or even worse, bad blocks on a clients system who has no RAID and never took backups?

    No, check your free blocks, it simply means you have no space.  This was the result of a script that was overzealous and backed up the entire database each night, it doesn't take long until the whole partition gets full.

    Now that you know this is the likely culprit, have fun clearing out the junk and hopefully you have items that can be deleted.


  • MySQL Error "ERROR 1045 (28000): Access denied for user"


    This happened with a select statement which writes the result to an external file.  I didn't remember the privilege "FILE" must be granted on *.* for this to work successfully, it wasn't actually an authentication issue as it implies since I was already in the SQL prompt and doing the query.

    SELECT some_id
    FROM sometable
    INTO OUTFILE '/tmp/result.txt'

    Keep in mind that the above won't work even with permissions set to 777,  your user must have privileges from MySQL to write to the filesystem.


  • auth/auth_util.c:make_server_info_sam(840) User nobody in passdb, but getpwnam() fails! - SAMBA/SMB Error How To Fix


    auth/auth_util.c:make_server_info_sam(840)
      User nobody in passdb, but getpwnam() fails!

    I never found the solution to this in the web, as usual so I thought I'd post the fix.  In plain English smbd is telling us that the user "nobody" does not exist in /etc/passwd.

    You can simply add this to your /etc/passwd file like so:

    nobody:x:65534:65534:nobody:/nonexistent:/sbin/nologin

    Now SAMBA/smbd should start fine and you won't receive anymore errors.


  • Debian/Ubuntu/Kubuntu Bash/Console/Terminal/Putty Home and End Keys Don't Work or Produce a ~


    This is a very weird, annoying and bizarre quirk with many distributions, especially Debian.  The home and end keys don't work, but it's a simple fix as long as you found this article :)

    You just have to edit /etc/inputrc:

    Find the commented lines as shown below:

    # "e[1~": beginning-of-line
    # "e[4~": end-of-line

    *If you can't find the above, just copy and paste the code below into your inputrc, it will enable your Home & End keys to work, saving you time so you don't have to keep using the arrow key to edit your commands

    Remove the comments :)

     "e[1~": beginning-of-line
     "e[4~": end-of-line

    Save the file, and now restart your terminal/bash/putty/console session and you'll see the Home and End keys now work instead of producing tilda ~ (in bash you can simply just type "bash" and you'll see the settings will be applied instantly)

    I still have not figured out why the Home & End keys in vi produce unwanted/unexpected results, instead of moving the cursor to the Home or End position, it just capitalizes the current letter which is very annoying.


  • Geoip and Geocity Packages


    The  "Geoip" package is available on virtually all Linux and Unix like systems and is very handy in looking an IP address' corresponding country.

     

    The homepage of the maintainers is here.

    They also have a package called "Geocity" which can be downloaded from their site, it is still free and gives you a close indication of the city the visitor is from.  You can download the Free version of Geocity Lite here.


  • pound a Linux Load Balance and Reverse Proxy


    I have played around with Pound a little bit.  It is a reverse proxy and load balancer in one, and it can be used as only a reverse proxy if you like.  It is very simple to configure as either, and Pound even senses if one of the systems is down and stops sending requests to the dead server.

    It supports SSL (but passes the request to the destination server unencrypted) and even the Apache log format.  Pound is very simple, fast and stable which is also secure because it does not require root privileges to run.

    Pound is simple, yet extremely powerful and versatile and is better than running a full blown Apache instance especially if you just need the Proxy features.

     

     

     


  • Linux Kernel Compilation (Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support ) Error - drivers/net/igb/igb_main.c: In function `igb_up': make[3]: *** [drivers/net/igb/igb_main.o] Error 1


    Linux Kernel v2.6.30.3

    102220 blocks
      CHK     include/linux/version.h
      CHK     include/linux/utsrelease.h
      SYMLINK include/asm -> include/asm-x86
      CALL    scripts/checksyscalls.sh
      CHK     include/linux/compile.h
      CC      drivers/net/igb/igb_main.o
    drivers/net/igb/igb_main.c: In function `igb_up':
    drivers/net/igb/igb_main.c:130: sorry, unimplemented: inlining failed in call to 'igb_set_rah_pool': function body not available
    drivers/net/igb/igb_main.c:938: sorry, unimplemented: called from here
    drivers/net/igb/igb_main.c:133: sorry, unimplemented: inlining failed in call to 'igb_set_vmolr': function body not available
    drivers/net/igb/igb_main.c:939: sorry, unimplemented: called from here
    make[3]: *** [drivers/net/igb/igb_main.o] Error 1
    make[2]: *** [drivers/net/igb] Error 2
    make[1]: *** [drivers/net] Error 2
    make: *** [drivers] Error 2

     


  • Linux Kernel Error (2.6.33.1) BUG: Bad page state in process swapper - Keeps rebooting - initramfs bug


    *This is a bug with initramfs support, all kernels after around 2.6.27.54 suffer from this problem.

    If you try to include initramfs into your kernel (I mean actually building your binaries into the kernel) this will always happen. Obviously some code has changed in recent kernels that is present in all new kernels, it makes it impossible to boot

    I've tried the latest 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36, 2.6.37, 2.6.38 kernels and they all do this.  I found one bug report but no action on it.

    Here's a bug someone else filed with the kernel maintainers: https://bugzilla.kernel.org/show_bug.cgi?id=15062

    I've opened a bug for it too, even the latest kernel 2.6.39 has this bug still, here's the link to the bug I opened.

    bugzilla.kernel.org/show_bug.cgi


    I'm not sure why this is happening, but it seems with each newer kernel I've worked with, there's more and more critical bugs for drivers on in this case an error that makes the system unbootable.

    I believe this option is the culprit:

     [ ] Support for paging of anonymous memory (swap)

    Now after removing that option I get an error when making the kernel:

    mm/built-in.o: In function `test_clear_page_writeback':
    (.text+0x6e38): undefined reference to `____ilog2_NaN'
    make: *** [.tmp_vmlinux1] Error 1

     


  • gnuCash - Alternative to Quickbooks/Quicken and other COTS accounting software.


    gnuCash is available for all main platforms, Linux/Unix, MacOS (FreeBSD anyway), and Windows.

    You can download gnuCash free from here.

    It does seem to be fairly full featured and somewhat straight forward, but like so many programs it is missing a few key features or things don't work quite right.

    It doesn't support importation of CSV files, which is a big minus.  And the developers rather than wanting to add support have just decided to link to a page that describes "how to convert CSV to QIF using a shell script".  They go on to say how similar CSV and QIF really are, and I don't mind using a shell script, but this is really not practical for 99% of people out there.

    At least it should be easier for users of Quicken/Quickbooks to move over and it's great that it's a cross platform application.

    I'm not sure if I'm missing something, but I confirmed my QIF file has records going back more than 12 months, yet after importation it appears to only show the current month and nothing before.  This is either an oversight on my part, or a huge bug/feature that needs to be fixed.


  • heartbeat is stopped for some reason


    heartbeat is stopped for some reason

    Anyway hnode2 was active and the services are running fine but I see heartbeat has been stopped somehow.

    Here is the last log I see of heartbeat:

    [quote:23c84415f5]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 9/1762471 ms age 0 [pid16738/MST_CONTROL]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 716/51784021 152624/74519 [pid16738/MST_CONTROL]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 200276 total malloc bytes. pid [16738/MST_CONTROL]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/14 ms age 405180540 [pid16741/HBFIFO]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 321/581 30772/13815 [pid16741/HBFIFO]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 32600 total malloc bytes. pid [16741/HBFIFO]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373810 [pid16742/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 340/657021 33264/15511 [pid16742/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 42008 total malloc bytes. pid [16742/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373820 [pid16743/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 340/394 25136/11458 [pid16743/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 25220 total malloc bytes. pid [16743/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373820 [pid16744/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 352/657052 34784/16543 [pid16744/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 43528 total malloc bytes. pid [16744/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373820 [pid16745/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 353/1244439 34868/16587 [pid16745/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 35812 total malloc bytes. pid [16745/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373820 [pid16746/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 364/657082 36304/17575 [pid16746/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 44840 total malloc bytes. pid [16746/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373830 [pid16747/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 364/454 28176/13522 [pid16747/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 36472 total malloc bytes. pid [16747/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373850 [pid16748/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 376/657112 37824/18607 [pid16748/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 46360 total malloc bytes. pid [16748/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/0 ms age 603373850 [pid16749/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 376/484 29696/14554 [pid16749/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 37992 total malloc bytes. pid [16749/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/1140417 ms age 40 [pid16750/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 388/30411871 39344/19639 [pid16750/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 51588 total malloc bytes. pid [16750/HBWRITE]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: MSG stats: 0/518348 ms age 30 [pid16751/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: cl_malloc stats: 389/10885817 39428/19683 [pid16751/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: RealMalloc stats: 40928 total malloc bytes. pid [16751/HBREAD]
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: Current arena value: 0
    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: These are nothing to worry about.
    [/quote:23c84415f5]


    Now when I start it again I get these messages (I've got these before). What alternative do I have? The services were running on hnode2 I can't just unmount and stop OpenVZ in a production environment.

    I also never stopped heartbeat, it was obviously fine until early this evening 5:12 PM and between now 11:48PM
    [quote:23c84415f5]Starting High-Availability services:
    2008/09/09_23:45:21 CRITICAL: Resource drbddisk::r0 is active, and should not be!
    2008/09/09_23:45:21 CRITICAL: Non-idle resources can affect data integrity!
    2008/09/09_23:45:21 info: If you don't know what this means, then get help!
    2008/09/09_23:45:21 info: Read the docs and/or source to /usr/share/heartbeat/ResourceManager for more details.
    CRITICAL: Resource drbddisk::r0 is active, and should not be!
    CRITICAL: Non-idle resources can affect data integrity!
    info: If you don't know what this means, then get help!
    info: Read the docs and/or the source to /usr/share/heartbeat/ResourceManager for more details.
    2008/09/09_23:45:21 CRITICAL: Non-idle resources will affect resource takeback!
    2008/09/09_23:45:21 CRITICAL: Non-idle resources may affect data integrity!
    [ OK ]
    [/quote:23c84415f5]


     

    hnode1 complains after restarting heartbeat:

    [quote:d10093f29f]Sep 9 23:44:50 hnode1 heartbeat: [31055]: info: Heartbeat restart on node hnode2.ca
    Sep 9 23:44:50 hnode1 heartbeat: [31055]: info: Status update for node hnode2.ca: status init
    Sep 9 23:44:50 hnode1 heartbeat: [31055]: info: Status update for node hnode2.ca: status up
    Sep 9 23:44:51 hnode1 heartbeat: [31055]: info: Status update for node hnode2.ca: status active
    Sep 9 23:44:51 hnode1 heartbeat: [31055]: ERROR: should_drop_message: attempted replay attack [hnode2.ca]? [gen = 1220406280, curgen = 1220406281]
    Sep 9 23:44:51 hnode1 heartbeat: [31055]: info: remote resource transition completed.
    Sep 9 23:44:51 hnode1 heartbeat: [31055]: ERROR: No one owns our local resources!
    Sep 9 23:44:51 hnode1 heartbeat: [31055]: ERROR: No one owns our local resources!
    Sep 9 23:44:51 hnode1 heartbeat: [31055]: ERROR: should_drop_message: attempted replay attack [hnode2.ca]? [gen = 1220406280, curgen = 1220406281]
    Sep 9 23:44:55 hnode1 heartbeat: [31055]: ERROR: should_drop_message: attempted replay attack [hnode2.ca]? [gen = 1220406280, curgen = 1220406281][/quote:d10093f29f]


     

    hnode2 shortly after 5:17PM I installed and ran tiobench, I wonder if that did it?

    Sep 9 17:15:32 hnode2 heartbeat: [16738]: info: These are nothing to worry about.
    Sep 9 17:18:05 hnode2 python: gethostby*.getanswer: asked for "apt.sw.be IN AAAA", got type "SOA"
    [b:04bcff7251]Sep 9 20:18:17 hnode2 yum: Installed: tiobench - 0.3.3-1.2.el5.rf.i386
    [/b:04bcff7251]


     

    CRITICAL: Resource drbddisk::r0 is active, and should not be!
    CRITICAL: Non-idle resources can affect data integrity!
    info: If you don't know what this means, then get help!
    info: Read the docs and/or the source to /usr/share/heartbeat/ResourceManager for more details.
    2008/09/09_23:45:21 CRITICAL: Non-idle resources will affect resource takeback!
    2008/09/09_23:45:21 CRITICAL: Non-idle resources may affect data integrity!

    [quote:a0972a9e65] # What this means is that if you have a shared disk and it's already mounted
    # before you start heartbeat, then you could have it mounted simultaneously
    # on both sides. If this happens then your disk data is toast!
    # So, this is sometimes VERY BAD INDEED!
    #
    [/quote:a0972a9e65]


     

    I ran tiobench again and heartbeat never died


     

    Worse of all I checked the logs on hnode1 and it never seemed to realize hnode2 heartbeat was down.



  • Fix/Solution for apt-get error: " E: Archive directory /var/cache/apt/archives/partial is missing."


    I thought I was being smart, I wanted to download some Debian packages so I went to /var/cache/apt/archives and did "rm -rf *" but then I couldn't use apt-get anymore.  I kept getting this error:

    E: Archive directory /var/cache/apt/archives/partial is missing.
    E: The list of sources could not be read.

    The solution was to recreate the "partial" directory inside /var/cache/apt/archives and then everything will be fine.


  • rsync bash script


    rsync bash script

    [code:1:722d8a25c1]#!/bin/bash

    # config ---------------------------------
    # two methods
    # from = receive data from another server
    # to = send data to another server
    rsync_method=from
    rsync_ip='192.168.5.18'
    local_dir='/home/backupguy/backups'
    remote_dir='/home/backup'
    free_space_bin='/home/backups/freediskspace.sh'
    # config end ------------------------------

    if [ '$rsync_method' == 'to' ]; then
    rsync -ur --progress $local_dir/* $remote_account_name@$rsync_ip:$remote_dir
    else
    rsync -ur --progress $remote_account_name@$rsync_ip:$remote_dir/* $local_dir
    fi

    # free disk space
    $free_space_bin
    [/code:1:722d8a25c1]



  • Rsync Timeout/Stall On Large files bigger than 16GB/Cannot Transfer large files with rysnc


    The last transfer I was able to do was 16.77GB according to rsync's output and it worked fine. 

          16.77G 100%   10.66MB/s    0:25:00 (xfer#17484, to-check=234753/256249)

    But on a file over 17GB (gigs) it stalls.  Trust me, it really is stalled, it's been about 8 hours with no progression from that point for some reason.

    17.24G  54%   10.65MB/s    0:22:07

    I've read about some people trying to change the timeout value on rsync but I don't see how that's the issue or how it might help.

    I should also mention these are VMWare .vmdk virtual disk files that are stalling if it makes any difference  As far as I can tell, whatever the case is, is that the problem is due to the size of the file and not anything to do with VMWare.


  • ntfs-3g Error/Fix/Solution - Unexpected sectors per cluster value (127). Failed to mount '/dev/sda1': Invalid argument The device '/dev/sda1' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a


    ./ntfs-3g /dev/sda1 /mnt -o force
    Unexpected sectors per cluster value (127).
    Failed to mount '/dev/sda1': Invalid argument
    The device '/dev/sda1' doesn't seem to have a valid NTFS.
    Maybe the wrong device is used? Or the whole disk instead of a
    partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

    This is happening on a system I've come across an HP 6930P running Windows XP Professional.  The partition appears to be very normal

     fdisk -l

    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       30401   244196001    7  HPFS/NTFS

    I wonder if this system may just be encrypted somehow because even forcing ntfs-3g does not get it mounted.

     


  • Picking an FTPD (vsftpd) Server in Linux Centos/Debian


    I decided on using yum to help me decide even though I normaly use proftpd I decided to see what else I could find.

    yum search ftp

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * rpmforge: ftp-stud.fht-esslingen.de
     * base: mirrors.netdna.com
     * updates: updates.interworx.info
     * addons: yum.singlehop.com
     * extras: mirrors.netdna.com
    rpmforge                                                                                                     | 1.1 kB     00:00    
    primary.xml.gz                                                                                               | 3.7 MB     00:02    
    rpmforge                                                       10237/10237
    base                                                                                                         | 2.1 kB     00:00    
    updates                                                                                                      | 1.9 kB     00:00    
    primary.sqlite.bz2                                                                                           | 588 kB     00:00    
    addons                                                                                                       |  951 B     00:00    
    extras                                                                                                       | 2.1 kB     00:00    
    =========================================================== Matched: ftp ===========================================================
    bug-buddy.i386 : A bug reporting utility for GNOME
    esound.i386 : Allows several audio streams to play on a single audio device.
    esound-devel.i386 : Development files for EsounD applications.
    gdm.i386 : The GNOME Display Manager.
    gdm-docs.i386 : GDM Documentation
    gftp.i386 : A multi-threaded FTP client for the X Window System.
    mc.i386 : User-friendly text console file manager and visual shell
    kdebase.i386 : K Desktop Environment - core files
    squid.i386 : The Squid proxy caching server.
    aria2.i386 : Download utility with BitTorrent and Metalink support
    atftp.i386 : Advanced Trivial File Transfer Protocol (TFTP) client
    atftp-server.i386 : Advanced Trivial File Transfer Protocol (TFTP) server
    atop.i386 : AT Computing System and Process Monitor
    autoupdate.noarch : AutoUpdate, a simple perl script to keep your system up2date
    awstats.noarch : Powerful and fullfeatured server logfile analyzer
    bittorrent.noarch : Network file transfer tool
    bootparamd.i386 : A server process which provides boot information to diskless clients.
    cfdisk.i386 : Curses based disk partition table manipulator
    checkpassword.i386 : Provides a simple, uniform password-checking interface
    checkpassword-pam.i386 : Provides a simple, uniform password-checking interface using PAM
    chrpath.i386 : Change the dynamic library load path (rpath) of binaries
    curl.i386 : A utility for getting files from remote servers (FTP, HTTP, and others).
    curl-devel.i386 : Files needed for building applications with libcurl.
    dbview.i386 : Display dBase III and IV (.dbf) files
    devhelp.i386 : API document browser
    devhelp-devel.i386 : Library to embed Devhelp in other applications.
    docbook-utils.noarch : Shell scripts for managing DocBook documents.
    docbook-utils-pdf.noarch : A script for converting DocBook documents to PDF format.
    duplicity.i386 : Untrusted/encrypted backup using rsync algorithm
    evolution-sharp.i386 : Evolution Data Server Mono Bindings
    evolution-sharp-devel.i386 : Development files for evolution-sharp
    expect.i386 : A program-script interaction and testing utility
    expect-devel.i386 : A program-script interaction and testing utility
    expectk.i386 : A program-script interaction and testing utility
    file-roller.i386 : File Roller is a tool for viewing and creating archives
    filezilla.i386 : GUI SFTP/FTP client
    freeze.i386 : Archiver and compressor
    ftp.i386 : The standard UNIX FTP (File Transfer Protocol) client.
    ftpproxy.i386 : FTP proxy server
    fuse-curlftpfs.i386 : FUSE filesystem for accessing FTP hosts using libcurl
    fuse-obexfs.i386 : FUSE based filesystem using ObexFTP
    geteltorito.noarch : Tool to extract boot image from an ISO file
    gift.i386 : Deamon for communicating with filesharing protocols
    gift-devel.i386 : Header files, libraries and development documentation for gift.
    gift-gnutella.i386 : Gift plugin to access the Gnutella network
    gift-openft.i386 : Gift plugin to access the openft network
    gnome-commander.i386 : File manager for the GNOME desktop
    gnome-common.i386 : Useful things common to building gnome packages
    gnome-netstatus.i386 : Network interface status applet
    gnome-sharp.i386 : GTK+ and GNOME bindings for Mono
    gnome-sharp-devel.i386 : files needed for developing with gnome-sharp
    gnome-themes.noarch : Themes collection for GNOME
    gnome-vfs2.i386 : The GNOME virtual file-system libraries
    gollem-h3.noarch : The Horde web-based File Manager.
    groff.i386 : A document formatting system.
    groff-gxditview.i386 : An X previewer for groff text processor output.
    groff-perl.i386 : Parts of the groff formatting system that require Perl.
    gtk2-engines.i386 : Theme engines for GTK+ 2.0
    hardlink.i386 : Tool to hardlink duplicate files in a directory tree
    jailkit.i386 : Utilities to limit user accounts to specific files using chroot()
    java-1.4.2-gcj-compat.i386 : JPackage runtime scripts for GCJ
    java-1.4.2-gcj-compat-devel.i386 : JPackage development scripts for GCJ
    java-1.4.2-gcj-compat-javadoc.i386 : API documentation for libgcj
    java-1.4.2-gcj-compat-src.i386 : Source files for libgcj
    kasablanca.i386 : Ftp/fxp client
    konserve.i386 : Small backup application
    krusader.i386 : File manager
    lftp.i386 : Sophisticated file transfer program
    libbonobo.i386 : Bonobo component system
    libbonobo-devel.i386 : Libraries and headers for libbonobo
    libbonoboui.i386 : Bonobo user interface components
    libbonoboui-devel.i386 : Libraries and headers for libbonoboui
    libfaketime.i386 : Pre-loadable library for faking the system date
    libgnome.i386 : GNOME base library
    libgnome-devel.i386 : Libraries and headers for libgnome
    libgnomeprint22.i386 : Printing library for GNOME.
    libgnomeprint22-devel.i386 : Libraries and include files for developing GNOME printing applications
    libgnomeprintui22.i386 : GUI support for libgnomeprint
    libgnomeprintui22-devel.i386 : Libraries and headers for libgnomeprintui
    libgnomeui.i386 : GNOME base GUI library
    libgnomeui-devel.i386 : Libraries and headers for libgnome
    libgpg-error.i386 : libgpg-error
    libgpg-error-devel.i386 : Development files for the libgpg-error package
    libgtop2.i386 : libgtop library (version 2)
    libgtop2-devel.i386 : Libraries and include files for developing with libgtop.
    libobexftp.i386 : Library to access devices via the OBEX protocol
    libobexftp-devel.i386 : Header files, libraries and development documentation for libobexftp.
    libole2.i386 : Structured Storage OLE2 library
    libole2-devel.i386 : Header files, libraries and development documentation for libole2.
    libsoup.i386 : Soup, an HTTP library implementation
    libsoup-devel.i386 : Header files for the Soup library
    libtermcap.i386 : A basic system library for accessing the termcap database.
    libtermcap-devel.i386 : Development tools for programs which will access the termcap database.
    libutempter.i386 : A privileged helper for utmp/wtmp updates
    libutempter-devel.i386 : Development environment for utempter
    libwnck.i386 : Window Navigator Construction Kit
    libwnck-devel.i386 : Libraries and headers for libwnck
    libxml2.i386 : Library providing XML and HTML support
    libxml2-devel.i386 : Libraries, includes, etc. to develop XML and HTML applications
    linscope.i386 : Network scanner for network shares
    metacity.i386 : Metacity window manager
    mirrordir.i386 : Easy to use ftp mirroring package
    mirrordir-devel.i386 : Header files, libraries and development documentation for mirrordir.
    most.i386 : Text viewer similar to more or less, but with additional capabilities
    mpack.i386 : Pack a file in MIME format for mailing and news
    mrepo.noarch : Tool to set up a Yum/Apt mirror from various sources (ISO, RHN, rsync, http, ftp, ...)
    nautilus-sendto.i386 : Nautilus context menu for sending files
    nautilus-sendto-bluetooth.i386 : Nautilus integration for Bluetooth
    ncc.i386 : C source code analyzer
    netrw.i386 : Tool for transporting data over the internet
    numactl.i386 : library for tuning for Non Uniform Memory Access machines
    numactl-devel.i386 : Development package for building Applications that use numa
    obexftp.i386 : Tool to access devices via the OBEX protocol
    pax.i386 : POSIX File System Archiver
    perl-AnyData.noarch : Easy access to data in many formats
    perl-Audio.i386 : Represents audio data
    perl-Crypt-TEA.i386 : Tiny Encryption Algorithm
    perl-Net-FTP-AutoReconnect.noarch : FTP client class with automatic reconnect on failure
    perl-Net-FTP-RetrHandle.noarch : Tied or IO::Handle-compatible interface to a file retrieved by FTP
    perl-Net-SFTP.noarch : Secure File Transfer Protocol client
    perl-Net-SFTP-Foreign.noarch : SSH File Transfer Protocol client
    perl-Net-TFTP.noarch : TFTP Client class
    perl-TFTP.noarch : Perl module that implements a TFTP Client class
    perl-Test-AutoBuild.i386 : Automated build engine
    perl-Test-AutoBuild.noarch : Automated build engine
    perl-Tie-FTP.noarch : Open files on FTP servers as filehandles
    perl-URI-sftp.noarch : Perl module to add support for SFTP uris to URI package
    pexpect.noarch : Pure Python Expect-like module
    pftp.i386 : Port-File-Transfer-Program
    piranha.i386 : Cluster administation tools
    pktstat.i386 : Displays a live list of active connections and what files are being transferred
    proftpd.i386 : Flexible, stable and highly-configurable FTP server
    proftpd-devel.i386 : Header files, libraries and development documentation for proftpd.
    proftpd-ldap.i386 : Module to add LDAP support to the ProFTPD FTP server
    proftpd-mysql.i386 : Module to add MySQL support to the ProFTPD FTP server
    proftpd-postgresql.i386 : Module to add PostgreSQL support to the ProFTPD FTP server
    pure-ftpd.i386 : Lightweight, fast and secure FTP server
    pure-ftpd-selinux.i386 : SELinux support for Pure-FTPD
    python-expect.i386 : Expect module for Python
    python-memcached.noarch : Python interface to the memcached memory cache daemon
    python-obexftp.i386 : Library to access devices via the OBEX protocol
    python-pexpect.i386 : Python Expect-like module
    python-pexpect.noarch : Python Expect-like module
    python-urlgrabber.noarch : High-level cross-protocol url-grabber
    rescuept.i386 : Tool that recognizes ext2, FAT, swap and extended partition tables
    rssh.i386 : Restricted shell for use with OpenSSH, allowing only scp and/or sftp
    sharedance.i386 : Ephemeral key/data pair storing daemon
    sitecopy.i386 : Tool for easily maintaining remote web sites
    sphere.i386 : NIST SPeech HEader REsources (SPHERE) Package
    sphere-devel.i386 : Header files, libraries and development documentation for sphere.
    strobe.i386 : Super optimized TCP port surveyor
    t1lib.i386 : PostScript Type 1 font rasterizer
    t1lib-devel.i386 : Header files, libraries and development documentation for t1lib.
    tcp_wrappers.i386 : A security tool which acts as a wrapper for TCP daemons.
    tcpspray.i386 : Print average throughput for a tcp connection
    tftp.i386 : The client for the Trivial File Transfer Protocol (TFTP)
    tftp-server.i386 : The server for the Trivial File Transfer Protocol (TFTP)
    tnftp.i386 : Enhanced NetBSD ftp client
    urw-fonts.noarch : Free versions of the 35 standard PostScript fonts.
    vsftpd.i386 : vsftpd - Very Secure Ftp Daemon
    wget.i386 : A utility for retrieving files using the HTTP or FTP protocols.
    wput.i386 : Uploads files to FTP servers
    x2x.i386 : Link two X displays together, simulating a multiheaded display
    xmltv2vdr.noarch : Read EPG information the xmltv site
    zoo.i386 : File archiving utility with compression

    I decided to try vsftpd because it stands for "very secure" so it must be right? :)

    Well anyway I thought I'd try it becaues I've heard good things about in the past

    yum install vsftpd


    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * rpmforge: ftp-stud.fht-esslingen.de
     * base: mirrors.netdna.com
     * updates: updates.interworx.info
     * addons: yum.singlehop.com
     * extras: mirrors.netdna.com
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package vsftpd.i386 0:2.0.5-16.el5_4.1 set to be updated
    filelists.xml.gz                                                                                             | 4.1 MB     00:02    
    filelists.sqlite.bz2                                                                                         | 3.3 MB     00:00    
    filelists.sqlite.bz2                                                                                         | 3.0 MB     00:00    
    filelists.sqlite.bz2                                                                                         | 195 kB     00:00    
    filelists.xml.gz                                                                                             |  194 B     00:00    
    --> Finished Dependency Resolution

    Dependencies Resolved

    ====================================================================================================================================
     Package                      Arch                       Version                                Repository                     Size
    ====================================================================================================================================
    Installing:
     vsftpd                       i386                       2.0.5-16.el5_4.1                       updates                       140 k

    Transaction Summary
    ====================================================================================================================================
    Install      1 Package(s)        
    Update       0 Package(s)        
    Remove       0 Package(s)        

    Total download size: 140 k
    Is this ok [y/N]: y
    Downloading Packages:
    vsftpd-2.0.5-16.el5_4.1.i386.rpm                                                                             | 140 kB     00:00    
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : vsftpd                                            [1/1]

    Installed: vsftpd.i386 0:2.0.5-16.el5_4.1
    Complete!

    Now I realized vsftpd isn't all that secure, at least in the default configuration.  Why would it automatically create a public ftp server?

    You better make the following change in: /etc/vsftpd/vsftpd.conf

    anonymous_enable=NO

    For such a secure server there is not even built-in TLS or SSL encryption either!

    Create The VSFTPD Server Key to Enable TLS/SSL

    openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem

    Edit the Server Config file /etc/vsftpd/vsftpd.conf

    Add the following but change as you feel fit if you want to force/disable SSL/TLS connections:

    ssl_enable=YES
    allow_anon_ssl=NO
    force_local_data_ssl=NO
    force_local_logins_ssl=NO
    ssl_tlsv1=YES
    ssl_sslv2=NO
    ssl_sslv3=NO
    rsa_cert_file=/etc/vsftpd/vsftpd.pem

    Now restart vsftpd and all local/shell users can connect securely.


  • XMPP Chat Protocol using Jabber - Guide Tutorial Setup Linux Chat Server


    In Debian based distros:

    apt-get install jabber

    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      fakeroot dkms
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      jabber-common
    The following NEW packages will be installed:
      jabber jabber-common
    0 upgraded, 2 newly installed, 0 to remove and 185 not upgraded.
    Need to get 175kB of archives.
    After this operation, 655kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://ca.archive.ubuntu.com intrepid/universe jabber-common 0.5 [4210B]
    Get:2 http://ca.archive.ubuntu.com intrepid/universe jabber 1.4.3-3.4ubuntu1 [171kB]
    Fetched 175kB in 1s (109kB/s)     
    Selecting previously deselected package jabber-common.
    (Reading database ... 113468 files and directories currently installed.)
    Unpacking jabber-common (from .../jabber-common_0.5_all.deb) ...
    Selecting previously deselected package jabber.
    Unpacking jabber (from .../jabber_1.4.3-3.4ubuntu1_i386.deb) ...
    Setting up jabber-common (0.5) ...

    Setting up jabber (1.4.3-3.4ubuntu1) ...
    Starting jabberd:

    Here's a list of other XMPP servers

     


  • tar gzip: stdout: File too large - Error Size Limit on Large file > 17GB


    The folder I was trying to archive is about 72GB, but much like rsync at about 17GB it chokes because of the filesize.  What's with so many common and essential Linux tools having such limitations?  I guess it is likely that the authors never wrote their code with the idea that files would be so large but it's still very annoying.  It's important to stay on top of these limitations on production servers because I didn't realize what happened until I checked the file with "gzip -t" and the archive was too short.  I then ran the same script again on that directory and recorded the output as shown below from gzip.

    time tar -czpf somefile.tar.gz archive-directory

    gzip: stdout: File too large

    real    33m15.478s
    user    0m2.440s
    sys     0m34.498s

     

    gzip -V
    gzip 1.3.5
    (2002-09-30)
    Copyright 2002 Free Software Foundation
    Copyright 1992-1993 Jean-loup Gailly
    This program comes with ABSOLUTELY NO WARRANTY.
    You may redistribute copies of this program
    under the terms of the GNU General Public License.
    For more information about these matters, see the file named COPYING.
    Compilation options:
    DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H HAVE_MEMORY_H HAVE_STRING_H HAVE_LSTAT ASMV
    Written by Jean-loup Gailly.

     

    Solutions/Alternatives to gzip?

    I don't know the specific limitations of other formats but I'm currently trying to tar and bzip2 the same directory and will report back.  I wonder if rar is a viable option and what the maximum size is.  At the very least, rar may make the most sense because you can easily split the archives into 4GB files and this also makes for easy DVD-R backups as well.

    bzip2 had the same error at the 17GB mark (and this also shows how much SLOWER bzip2 is with hardly much better compression):

    bzip2: I/O or other error, bailing out.  Possible reason follows.
    bzip2: File too large
            Input file = (stdin), output file = (stdout)

    real    199m7.113s
    user    0m2.200s
    sys     0m29.714s


  • email2fax and Asterisk to do eFaxing


    It's basically free bash shell script available from: http://wpkg.org/email2fax/index.php/Main_Page

    Make sure you have the required tools:

    1. libtiff
    2. ghostscript
    3. mpack/munpack

    Where you can e-mail your Asterisk box and it will fax it to the phone number in the subject line.  The good news ends there, it is fairly undocumented and buggy.

    Take for example how the documentation mentions you can invoke from the command line like this:

    cat "somefile.eml"|email2fax --nodebug

    Instead it keeps displaying the help message, I guess this is an oversight but this is supposed to be the stable version.

    email2fax
    email2fax v1.2beta, email to fax gateway for Asterisk

    Usage:

    "piped message" | email2fax [OPTIONS]

    Options:
    --nomail        don't send a confirmation email (default: send confirmation email)
    --nodelete      don't delete temporary files (default: delete temporary files)
    --nofax         don't send the fax (default: send fax)
    --debug         enable debug logging

    Email has to contain either one PDF attachment OR one TIFF attachment, and
    a destination fax number as a subject.

    Examples:

    This one sends a fax from the command line, and enables debug logging:

    cat message.eml | sudo -u root email2fax --debug


    This one enables debug logging, doesn't send a confirmation email,
    doesn't delete temporary files, and doesn't send a fax (useful for testing etc.):

    cat message.eml | sudo -u root email2fax --debug --nomail --nodelete --nofax


    This entry in .procmailrc located in asterisk home directory intercepts all emails
    to asterisk, and passes them to email2fax:

    :0fw
    | /usr/local/bin/email2fax


    By default, email2fax logs ALL messages to /var/log/asterisk/faxlog, and saves temporary files in /tmp/email2fax.
    These paths, along with several different variables, can be changed
    at the beginning of this script (/usr/bin/email2fax).

    See http://wpkg.org/email2fax for updates, bug reports, and answers.

    I've tried hacking around with the code, it may work if you e-mail and use procmail but judging from the mailing list it sounds like others are having difficulty too.

    It's too bad but I thought I'd try this tool, perhaps another day when I have more time.


  • PDF File Conversion/Solution Using Imagemagick to create PDF files for free, quickly and efficiently


    I'm really starting to love ImageMagick, I've used it to mass convert/resize family photos with scripts and all kinds of handy things.

    Today I just learned that you can create PDF files with it too, say if you have images scanned or anything else it's very simple:

    convert *.jpeg output.pdf

    You can replace jpg with whatever format your files are in.  One thing to remember is that you can specify the order that the images/pages are added to the PDF manually.

    Say if you had 5 pages and you need them in sequence you could do this:

    convert Scan10002.JPG Scan10003.JPG Scan10004.JPG Scan10005.JPG Scan10006.JPG SomeFile.pdf

    This is a very handy, quick and efficient way to create PDF files, now imaging the power of it if you started scripting things?


  • Linux EXT3 16GB-17GB maximum filesize issue solved/how to fix


    I have no idea why but mkfs.ext3 defaults to a patheticlly small blocksize of 1024 bytes/1KB (kilobyte).  That means the maximum filesize is ONLY 16GB!  With 2KB/2048 bytes you get a 256 GB maximum filesize, and with 4KB/4096 bytes you get 2TB!

    I finally noticed/paid attention to this after realizing that with rsync and scp that no file larger than 17GB could be transferred.  I then realized it must be a file size limit on the partition.

    Here is what tune2fs told me about it (pay attention to the block size in bold,it's only 1024 bytes which means maximum 16GB filesize, this won't do for virtual VMWare disks):

     

    tune2fs -l /dev/sda3
    tune2fs 1.40-WIP (14-Nov-2006)
    Filesystem volume name:   <none>
    Last mounted on:          <not available>
    Filesystem UUID:          640b832c-1662-4c5c-96cb-da906c7c17ae
    Filesystem magic number:  0xEF53
    Filesystem revision #:    1 (dynamic)
    Filesystem features:      has_journal filetype needs_recovery sparse_super large_file
    Filesystem flags:         signed directory hash
    Default mount options:    (none)
    Filesystem state:         clean
    Errors behavior:          Continue
    Filesystem OS type:       Linux
    Inode count:              118187008
    Block count:              945489508
    Reserved block count:     47274475
    Free blocks:              272940854
    Free inodes:              117274575
    First block:              1
    Block size:               1024
    Fragment size:            1024
    Blocks per group:         8192
    Fragments per group:      8192
    Inodes per group:         1024
    Inode blocks per group:   128
    Filesystem created:       Thu Dec 10 12:45:25 2009
    Last mount time:          Fri Mar 12 22:32:11 2010
    Last write time:          Fri Mar 12 22:32:11 2010
    Mount count:              4
    Maximum mount count:      38
    Last checked:             Thu Dec 10 12:45:25 2009
    Check interval:           15552000 (6 months)
    Next check after:         Tue Jun  8 13:45:25 2010
    Reserved blocks uid:      0 (user extauditaccount)
    Reserved blocks gid:      0 (group unknown)
    First inode:              11
    Inode size:               128
    Journal inode:            8
    Default directory hash:   tea
    Directory Hash Seed:      99a10ab1-7c5c-4b94-9b14-29d05c309a77
    Journal backup:           inode blocks

    Fix/Change FileSize Limit for EXT3 by changing the Block Size

    The good news is that this is fixable, but it ends there.  There's no way to set the blocksize except during the format when you run mkfs.ext3 -b 4096.

    So you'll have to backup your data to another partition/system/drive and then reformat the partition making sure you specify the proper block size.

    Update

    The default block size (if not specified) is from the /etc/mke2fs.conf file which looks like this:

    You can use what I've shown below if this file does not exist on your system (like in my case).

    [defaults]
            base_features = sparse_super,filetype,resize_inode,dir_index
            blocksize = 4096
            inode_ratio = 8192

    [fs_types]
            small = {
                    blocksize = 1024
                    inode_ratio = 4096
            }
            floppy = {
                    blocksize = 1024
            }
            news = {
                    inode_ratio = 4096
            }
            largefile = {
                    inode_ratio = 1048576
            }
            largefile4 = {
                    inode_ratio = 4194304
            }


  • Monitor MB/s Disk IO Usage/Bandwidth - Use iostat from the sysstat Package


    The binary "iostat" comes from the package "sysstat" and is available on all Linux/Unix like platforms. 

    Use the "-m" option to give you what you probably want, which is to see in MB/s how much bandwidth each disk is doing.

    iostat -m
    Linux 2.6.24.2 ((none))         04/16/10

    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               0.08    0.00    3.45   18.64    0.00   77.83

    Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
    sda             430.19        26.80         0.00     149821          5
    sdb              78.96         0.00        29.53          8     165085
    sdc               0.08         0.00         0.00          2         27


  • Convert HDD/Hard Drive Partition(s) into non-RAID into RAID 1 using existing data without data loss and without reformatting.


    Before we start I take no responsibility for this, you should have a backup and if you make a mistake during this process you could wipe out all of your data.  So backup somewhere else before starting this as a precaution, or make sure it's data you could afford to lose.

    The RAID 1 Setup (Hardware Wise)

    I've already setup my 2 x 1TB (Seagate) drives with identical partitions, make sure your new hard drive (the empty one) is setup like your current partitions (original hard drive).

    Before you start you should be in single user mode.

    You can see my fdisk output here:


    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        1460    11727418+  83  Linux
    /dev/sda2            1461        3893    19543072+  83  Linux
    /dev/sda3            3894      121601   945489510   83  Linux

    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1        1460    11727418+  83  Linux
    /dev/sdb2            1461        3893    19543072+  83  Linux
    /dev/sdb3            3894      121601   945489510   83  Linux

    RAID 1 Migration Plan (Using Existing Data and Partitions)

    My plan is to use the /dev/sda1 and /dev/sdb1 partitions for SWAP.

    sda2 and sdb2 will hold about 18GB for the OS partition (md0).

    sda3 and sdb3 will hold about 888GB for other data/backups.

    *remember you could just make a single partition and only have an md0 but I prefer to have a separate OS partition.  This way it's much more simple to backup just the OS and config files setc..

    Create The RAID Arrays (md0 and md1)

    With that in mind let's create our first RAID 1 array (md0) which uses sda2 and sdb2 (currently sdb2 is what has the data so we will create and initialze the array with sda2).  Notice the "missing" clause I added below.  This allows us to create the md0 array with only a single partition (even though RAID1 obviously needs 2 otherwise it's not RAID of course).

    Create the md0 RAID 1 Array (OS partition)

    mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sda2

    Be careful below, yes my sda2 was an ext3 partition already (before I planned to add the extra 1TB drive and make it RAID).  But I know for sure (I checked and mounted to double check) to see that sda2 is empty and contains no useful or important data.


    mdadm: /dev/sda2 appears to contain an ext2fs file system
        size=19543072K  mtime=Wed Dec 31 16:00:00 1969
    Continue creating array? yes
    mdadm: array /dev/md0 started.

    Format the RAID 1 arrays md0 and md1 with EXT3

    *Make sure that you specify -b 4096 otherwise it will default to -b 1024 which gives you a maximum filesize of just 16GB which is a big issue for things like backup files adn VMWare Disks

    mkfs -t ext3 -b 4096 -L md0 /dev/md0       
    mke2fs 1.40-WIP (14-Nov-2006)
    Filesystem label=md0
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    2443200 inodes, 4885744 blocks
    244287 blocks (5.00%) reserved for the super user
    First data block=0
    150 block groups
    32768 blocks per group, 32768 fragments per group
    16288 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000

    Writing inode tables: done                           
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 30 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.

    -bash-3.1# mkfs -t ext3 -b 4096 -L md1 /dev/md1
    mke2fs 1.40-WIP (14-Nov-2006)
    Filesystem label=md1
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    118194176 inodes, 236372352 blocks
    11818617 blocks (5.00%) reserved for the super user
    First data block=0
    7214 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
            102400000, 214990848

    Writing inode tables: done                           
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information:
    done

    This filesystem will be automatically checked every 22 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.

    How fdisk sees the arrays

    Disk /dev/md0: 20.0 GB, 20012007424 bytes
    2 heads, 4 sectors/track, 4885744 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes

    Disk /dev/md0 doesn't contain a valid partition table

    Disk /dev/md1: 968.1 GB, 968181153792 bytes
    2 heads, 4 sectors/track, 236372352 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes

    Disk /dev/md1 doesn't contain a valid partition table

    Don't worry about the "doesn't contain a valid partition table" warnings.  Of course md0 and md1 don't have partition tables, they are essentially (RAID) partitions so of course they won't, but fdisk does not know this.  It treats it just like an sda with no partitions.

    Copy Data To New RAID Arrays

    Now copy all data from /dev/sdb2 to /mnt/md0 (I don't have any since this is a new setup and the sdb drive only had data on sdb3 which is completely used for backups).

    Now copy all data from /dev/sdb3 to /mnt/md1.

    Once you're satisfied the data has copied properly and nothing is missing, you are ready to actually put the RAID 1 arrays into action.

    Synchronize The RAID Arrays

    First we'll do md0 (OS partition)

    mdadm /dev/md0 -a /dev/sdb2
    mdadm: added /dev/sdb2


    -bash-3.1# cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [multipath]
    md1 : active raid1 sda3[1]
          945489408 blocks [2/1] [_U]
         
    md0 : active raid1 sdb2[2] sda2[1]
          19542976 blocks [2/1] [_U]
          [>....................]  recovery =  1.7% (334848/19542976) finish=6.6min speed=47835K/sec
         
    unused devices: <none>

    Now by checking /proc/mdstat you can track the progress of the synchronization.

    Now it's time for md1

    mdadm /dev/md1 -a /dev/sdb3
    mdadm: added /dev/sdb3


    -bash-3.1# cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [multipath]
    md1 : active raid1 sdb3[2] sda3[1]
          945489408 blocks [2/1] [_U]
          [>....................]  recovery =  0.0% (725888/945489408) finish=195.2min speed=80654K/sec
          
    md0 : active raid1 sdb2[0] sda2[1]
          19542976 blocks [2/2] [UU]

    When It's All Done

    cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [multipath]
    md1 : active raid1 sdb3[0] sda3[1]
          945489408 blocks [2/2] [UU]
         
    md0 : active raid1 sdb2[0] sda2[1]
          19542976 blocks [2/2] [UU]
         
    unused devices: <none>

    Notice the [UU] for both arrays, it means both drives are up and the Array is fine.


  • nginx - the ultimate load balancer


    You can find it for free at http://nginx.org/ I find nginx is simpler to setup than pound (it's not hard but I found it unintuitive and annoying), it seemed to make some basic setups overly complicated with the config file syntax.

    nginx on the other hand is perfectly suited in everyway, it is even simpler to setup and seems to be the most stable and most efficient any load balancer.  I would go as far as to say that a good nginx setup is more reliable, faster and more efficient than a hardware based setup, since you can use commodity hardware.

    It's also great (and I read that Fastmail.fm is responsible) that they paid the developer to implement a reverse mail proxy feature as well.

    What really sold me is how Wordpress is using it to load balance their network, and they posted almost 'scientific' documentation showing the difference nginx made on their servers and how much the load was reduced.

    In my opinion I'd say nginx is definitely the best load balancer out there.


  • Linux AHCI Hotswap Tips - Remember To Reread The Partition Table WITHOUT rebooting


    From the package "parted" you can use the command "partprobe" to re-read the partition table.  I really hate rebooting, and that's what I loved to hear about AHCI motherboards, that they allow hotswap so you don't have to reboot.  But that's only as good as the OS, if the OS does not reload the partition table you won't be able to do anything with that new drive you attached without rebooting.  Yes, even without re-reading the partiton table Linux will detect and show the new device you attached, but it won't work right (eg. you can't even format it) until you reread the partition table.  Most people would probably say "you have to reboot", but with "partprobe" you don't need to.

    Otherwise when trying to format/initialize the drive you'll get annoying and strange errors like this:

    mdadm --create /dev/md2 --level=1 --raid-devices=2 missing /dev/sdd2
    mdadm: device /dev/sdd2 not suitable for any style of array

    And just for fun here it is in action, I'm just excited because I didn't know AHCI enabled hotswap on a consumer grade motherboard.  Back in the 90's and early 2000's we could only dream of hotswap with expensive SCSI arrays.

     

    ata3: exception Emask 0x10 SAct 0x0 SErr 0x40d0000 action 0xa frozen
    ata3: irq_stat 0x00400040, connection status changed
    ata3: SError: { PHYRdyChg CommWake 10B8B DevExch }
    ata3: soft resetting link
    ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata3.00: ATA-8: ST31000333AS, CC1F, max UDMA/133
    ata3.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
    ata3.00: configured for UDMA/133
    ata3: EH complete
    scsi 2:0:0:0: Direct-Access     ATA      ST31000333AS     CC1F PQ: 0 ANSI: 5
    sd 2:0:0:0: [sdd] 1953525168 512-byte hardware sectors (1000205 MB)
    sd 2:0:0:0: [sdd] Write Protect is off
    sd 2:0:0:0: [sdd] Mode Sense: 00 3a 00 00
    sd 2:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    sd 2:0:0:0: [sdd] 1953525168 512-byte hardware sectors (1000205 MB)
    sd 2:0:0:0: [sdd] Write Protect is off
    sd 2:0:0:0: [sdd] Mode Sense: 00 3a 00 00
    sd 2:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
     sdd: unknown partition table
    sd 2:0:0:0: [sdd] Attached SCSI disk
    sd 2:0:0:0: Attached scsi generic sg3 type 0

    I read somewhere but haven't confirmed that you can manually do the partition re-read like this (supposedly this works even if partprobe doesn't do the job):

    echo 1 > /sys/block/sdc/device/rescan

     

     


  • tar DON't strip/add leading slashes


    It is desirable to strip the leading slashes when taring / because you wouldn't want to overwrite your entire system when extracting some files to check.

    But if you are restoring / from the tar you want the leading slashes added again.  Here's how to do it:

    --absolute-names
    -P

    Either one above will do the same thing.


  • rsync ERROR: sdb2/backup.r18 failed verification -- update retained.


    ERROR: sdb2/backup.r18 failed verification -- update retained.

    This happened when I was rsyncing a dying hard drive, a lot of people seem to report this as an error with rsync itself but I don't think rsync is the issue at all.

    I know the source hard drive was bad, it was having all kinds of timeout, seek, hardware ECC recovered and reset errors.

    The only time something else could be the problem is if the data is being corrupted in transit, perhaps through an overseas link or a problematic router along the route etc..


  • rsync my favorite/best/optimal default switches and options


    Not sure what rsync switches/options to use?

    rsync -PDrphogtl

    The short version would be:

    rsync -Pha

    I think these are really common sense options to use and probaby should be the default.

    Explanation of rsync switches

    P = display the progress

    D = hybrid of --specials and --devices so all special and device files will be copied as well.

    r = recursive (otherwise rsync won't copy files deeper than the specified target)

    p = preserve the permissions

    h = human readable (usually MB or GB for the filesizes and MB/s or K/s for the transfer speeds

    o = preserve the owner's ownership

    g = preserve the group ownership

    t = preserve times (you should especially for backups)

    l = copy symlinks as symlinks (why wouldn't you?) *Note that if you are not copying an entire partition/drive you may have issues (where the symlink is copied and not the file you actually want, this option may not be a good idea for databackup but is mainly useful when preserving filesystems/migrating an OS etc...)

    -a, --archive        archive mode; equals -rlptgoD (no -H,-A,-

    *As shown above you could replace r,l,p,t,og,D (basically everything by just using the -a) switch.

    Other useful switches

    --exclude=/dev --exclude=/proc --exclude=/sys

    Those are basic directories that usually result in rsync hanging when trying to copy an entire live filesystem.


     

     


  • get_printer_attrs: resource name '/printers/printers' no good! - cups error


    This is what the /var/log/cups/error.log says after my Samsung CLP-310N decided to stop printing.  This is a new printer that replaced my CLP-300 and it has been working for a day so far.

    What happened is that I lifted the top part (not realizing there were rollers on it) and it stopped printing. The network activity light was flashing ,hitting the stop button didn't do anything.  Even powering the printer on and off did not help.

    I have restarted CUPS and SMB on the server with no different results.  I just keep getting the same error "get_printer_attrs: resource name '/printers/printers' no good! "

     

    *Update this error is common and was not the cause of my printing problem.  I paused the printer in Windows during my troubleshooting which is why even powering the printer down did not help.  I'm sure a powercycle would have fixed my stupid mistake of opening the top to make more space for paper that gets printed out :)


  • Is your NIC really down and really dying? r8169: eth0: link up r8169: eth0: link down NetworkManager: (eth0): carrier now OFF (device state 1)


    Apr 30 17:07:07 localhost kernel: [12265558.582378] r8169: eth0: link up
    Apr 30 17:07:07 localhost NetworkManager: <info>  (eth0): carrier now ON (device state 1)
    Apr 30 17:07:08 localhost kernel: [12265559.237961] r8169: eth0: link down
    Apr 30 17:07:08 localhost NetworkManager: <info>  (eth0): carrier now OFF (device state 1)
    Apr 30 17:07:11 localhost NetworkManager: <info>  (eth0): carrier now ON (device state 1)
    Apr 30 17:07:11 localhost kernel: [12265562.162804] r8169: eth0: link up
    Apr 30 17:07:11 localhost kernel: [12265562.577849] r8169: eth0: link down
    Apr 30 17:07:12 localhost NetworkManager: <info>  (eth0): carrier now OFF (device state 1)
    Apr 30 17:07:14 localhost kernel: [12265565.312582] r8169: eth0: link up
    Apr 30 17:07:14 localhost NetworkManager: <info>  (eth0): carrier now ON (device state 1)

    Apr 30 17:09:10 localhost kernel: [12265681.639307] r8169: eth0: link down
    Apr 30 17:09:13 localhost kernel: [12265684.402984] r8169: eth0: link up
    Apr 30 17:09:14 localhost kernel: [12265685.660805] r8169: eth0: link down
    Apr 30 17:09:18 localhost kernel: [12265688.942400] r8169: eth0: link up
    Apr 30 17:09:18 localhost kernel: [12265689.826486] r8169: eth0: link down
    Apr 30 17:09:21 localhost kernel: [12265692.512789] r8169: eth0: link up
    Apr 30 17:09:22 localhost kernel: [12265693.134914] r8169: eth0: link down
    Apr 30 17:09:31 localhost kernel: [12265702.700430] r8169: eth0: link up
    Apr 30 17:09:34 localhost kernel: [12265705.571668] r8169: eth0: link down
    Apr 30 17:09:37 localhost kernel: [12265708.281532] r8169: eth0: link up

    I was getting frustrated by when I checked the Cat5 cable it was a little bit loose on the NIC.  This is a case where any tug somewhere on the line knocked it loose.

    So I would double check with your datacenter or if you can, physically check the server yourself to see if the NIC's RJ45 cable is actually plugged in snugly and fully seated.


  • rsync halted froze Out of memory: kill process 7559 (rsync) score 635 or a child Killed process 7559 (rsync)


    Out of memory: kill process 7559 (rsync) score 635 or a child
    Killed process 7559 (rsync)

    I was surprised to see this in my dmesg when my rsync backup suddenly stalled/stopped.

    This system has 3 gigs of RAM and lots of free memory so I don't understand what is happening.

     

    rsync invoked oom-killer: gfp_mask=0x200d2, order=0, oomkilladj=0
    Pid: 7600, comm: rsync Not tainted 2.6.24.2 #83
     [<c014990e>] oom_kill_process+0x10e/0x120
     [<c0149aab>] out_of_memory+0xbb/0x110
     [<c014b3cb>] __alloc_pages+0x2bb/0x360
     [<c0147f8b>] __grab_cache_page+0x7b/0xc0
     [<c0185739>] simple_commit_write+0x59/0x70
     [<c0185694>] simple_write_begin+0x34/0x80
     [<c01483b4>] generic_perform_write+0xb4/0x1a0
     [<c0148524>] generic_file_buffered_write+0x84/0x150
     [<c0148866>] __generic_file_aio_write_nolock+0x276/0x570
     [<c06ef7a0>] do_sock_read+0x90/0xa0
     [<c06ef828>] sock_aio_read+0x78/0x90
     [<c0148ca4>] generic_file_aio_write+0x64/0xe0
     [<c016964d>] do_sync_write+0xbd/0x110
     [<c0131aa0>] autoremove_wake_function+0x0/0x50
     [<c0169731>] vfs_write+0x91/0x150
     [<c01698a1>] sys_write+0x41/0x70
     [<c01031de>] syscall_call+0x7/0xb
     =======================
    Mem-info:
    DMA per-cpu:
    CPU    0: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    CPU    1: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    CPU    2: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    CPU    3: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: Hot: hi:  186, btch:  31 usd:  63   Cold: hi:   62, btch:  15 usd:  21
    CPU    1: Hot: hi:  186, btch:  31 usd:  59   Cold: hi:   62, btch:  15 usd:   2
    CPU    2: Hot: hi:  186, btch:  31 usd:  37   Cold: hi:   62, btch:  15 usd:   9
    CPU    3: Hot: hi:  186, btch:  31 usd:  37   Cold: hi:   62, btch:  15 usd:   0
    HighMem per-cpu:
    CPU    0: Hot: hi:  186, btch:  31 usd:  63   Cold: hi:   62, btch:  15 usd:   8
    CPU    1: Hot: hi:  186, btch:  31 usd:  11   Cold: hi:   62, btch:  15 usd:   0
    CPU    2: Hot: hi:  186, btch:  31 usd:  55   Cold: hi:   62, btch:  15 usd:   0
    CPU    3: Hot: hi:  186, btch:  31 usd: 186   Cold: hi:   62, btch:  15 usd:  12
    Active:337341 inactive:332842 dirty:0 writeback:0 unstable:0
     free:28044 slab:6711 mapped:48 pagetables:104 bounce:0
    DMA free:6416kB min:68kB low:84kB high:100kB active:0kB inactive:0kB present:16256kB pages_scanned:0 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 4048 4048
    Normal free:105332kB min:3744kB low:4680kB high:5616kB active:361796kB inactive:361852kB present:894080kB pages_scanned:1084885 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 25400 25400
    HighMem free:428kB min:512kB low:3916kB high:7324kB active:987568kB inactive:969516kB present:3251200kB pages_scanned:2938373 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 6*4kB 7*8kB 8*16kB 8*32kB 7*64kB 5*128kB 3*256kB 2*512kB 3*1024kB 0*2048kB 0*4096kB = 6416kB
    Normal: 14*4kB 18*8kB 7*16kB 2*32kB 1*64kB 2*128kB 2*256kB 1*512kB 3*1024kB 3*2048kB 23*4096kB = 105144kB
    HighMem: 0*4kB 1*8kB 1*16kB 1*32kB 1*64kB 0*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 376kB
    Swap cache: add 0, delete 0, find 0/0, race 0+0
    Free swap  = 0kB
    Total swap = 0kB
    Free swap:            0kB
    1048576 pages of RAM
    819200 pages of HIGHMEM
    339234 reserved pages
    10551 pages shared
    0 pages swap cached
    0 pages dirty
    0 pages writeback
    48 pages mapped
    6711 pages slab
    104 pages pagetables
    Out of memory: kill process 7559 (rsync) score 955 or a child
    Killed process 7600 (rsync)
    rsync invoked oom-killer: gfp_mask=0x1280d2, order=0, oomkilladj=0
    Pid: 7559, comm: rsync Not tainted 2.6.24.2 #83
     [<c014990e>] oom_kill_process+0x10e/0x120
     [<c0149aab>] out_of_memory+0xbb/0x110
     [<c014b3cb>] __alloc_pages+0x2bb/0x360
     [<c01561b7>] __do_fault+0x147/0x360
     [<c0155f9d>] do_anonymous_page+0x3d/0x110
     [<c015669f>] handle_mm_fault+0x10f/0x2c0
     [<c0113dea>] do_page_fault+0x12a/0x630
     [<c0169572>] vfs_read+0x132/0x150
     [<c0113cc0>] do_page_fault+0x0/0x630
     [<c075ca8a>] error_code+0x72/0x78
     =======================
    Mem-info:
    DMA per-cpu:
    CPU    0: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    CPU    1: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    CPU    2: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    CPU    3: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: Hot: hi:  186, btch:  31 usd:  63   Cold: hi:   62, btch:  15 usd:  21
    CPU    1: Hot: hi:  186, btch:  31 usd: 114   Cold: hi:   62, btch:  15 usd:   2
    CPU    2: Hot: hi:  186, btch:  31 usd:  28   Cold: hi:   62, btch:  15 usd:   9
    CPU    3: Hot: hi:  186, btch:  31 usd:  37   Cold: hi:   62, btch:  15 usd:   0
    HighMem per-cpu:
    CPU    0: Hot: hi:  186, btch:  31 usd:  63   Cold: hi:   62, btch:  15 usd:   8
    CPU    1: Hot: hi:  186, btch:  31 usd:  11   Cold: hi:   62, btch:  15 usd:   0
    CPU    2: Hot: hi:  186, btch:  31 usd: 138   Cold: hi:   62, btch:  15 usd:   0
    CPU    3: Hot: hi:  186, btch:  31 usd: 186   Cold: hi:   62, btch:  15 usd:  12
    Active:337376 inactive:332787 dirty:0 writeback:0 unstable:0
     free:28044 slab:6711 mapped:48 pagetables:104 bounce:0
    DMA free:6416kB min:68kB low:84kB high:100kB active:0kB inactive:0kB present:16256kB pages_scanned:0 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 4048 4048
    Normal free:105332kB min:3744kB low:4680kB high:5616kB active:362104kB inactive:361596kB present:894080kB pages_scanned:1085435 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 25400 25400
    HighMem free:428kB min:512kB low:3916kB high:7324kB active:987400kB inactive:969552kB present:3251200kB pages_scanned:2939498 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 6*4kB 7*8kB 8*16kB 8*32kB 7*64kB 5*128kB 3*256kB 2*512kB 3*1024kB 0*2048kB 0*4096kB = 6416kB
    Normal: 14*4kB 18*8kB 7*16kB 2*32kB 1*64kB 2*128kB 2*256kB 1*512kB 3*1024kB 3*2048kB 23*4096kB = 105144kB
    HighMem: 0*4kB 1*8kB 1*16kB 1*32kB 1*64kB 0*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 376kB
    Swap cache: add 0, delete 0, find 0/0, race 0+0
    Free swap  = 0kB
    Total swap = 0kB
    Free swap:            0kB
    1048576 pages of RAM
    819200 pages of HIGHMEM
    339234 reserved pages
    903 pages shared
    0 pages swap cached
    0 pages dirty
    0 pages writeback
    48 pages mapped
    6711 pages slab
    104 pages pagetables
    Out of memory: kill process 7559 (rsync) score 635 or a child
    Killed process 7559 (rsync)


  • mdadm Linux Software RAID auto-detect and assemble RAID Array


    mdadm --assemble --scan


    mdadm: /dev/md/diaghost05102010:2 has been started with 2 drives.
    mdadm: /dev/md/diaghost05102010:1 has been started with 2 drives.
    mdadm: /dev/md/diaghost05102010:0 has been started with 2 drives.
    -bash-3.1# cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [multipath]
    md125 : active raid1 sda1[0] sdb1[1]
          14658185 blocks super 1.2 [2/2] [UU]
         
    md126 : active raid1 sda2[0] sdb2[1]
          58604024 blocks super 1.2 [2/2] [UU]
         
    md127 : active raid1 sda3[0] sdb3[1]
          1880246440 blocks super 1.2 [2/2] [UU]
          [>....................]  resync =  0.0% (1228928/1880246440) finish=407.7min speed=76808K/sec
         
    unused devices: <none>

    The only strange thing is that the drives were all renamed to something high, md125,126 and 127 when I originally created them as 0,1,2

    What if you don't want to assemble the array?

    You can just scan like this

    mdadm -D -s

    ARRAY /dev/md/diaghost05102010:2 metadata=1.2 name=diaghost05102010:2 UUID=d851091d:3d109a17:921ab0e1:3a465899
    ARRAY /dev/md/diaghost05102010:1 metadata=1.2 name=diaghost05102010:1 UUID=f841529d:a434b994:6f27c55b:64f4ef7d
    ARRAY /dev/md/diaghost05102010:0 metadata=1.2 name=diaghost05102010:0 UUID=cba74a1f:e1c83abe:1ea30dc3:cee425bd

    To see the details of a specific array just do this:

    mdadm -D /dev/md/diaghost05102010:2
    /dev/md/diaghost05102010:2:
            Version : 1.2
      Creation Time : Mon May 10 22:05:48 2010
         Raid Level : raid1
         Array Size : 1880246440 (1793.14 GiB 1925.37 GB)
      Used Dev Size : 1880246440 (1793.14 GiB 1925.37 GB)
       Raid Devices : 2
      Total Devices : 2
        Persistence : Superblock is persistent

        Update Time : Wed May 12 23:37:54 2010
              State : clean
     Active Devices : 2
    Working Devices : 2
     Failed Devices : 0
      Spare Devices : 0

               Name : diaghost05102010:2
               UUID : d851091d:3d109a17:921ab0e1:3a465899
             Events : 6

        Number   Major   Minor   RaidDevice State
           0       8        3        0      active sync   /dev/sda3
           1       8       19        1      active sync   /dev/sdb3


  • Linux 2.6.33.3 Kernel Error CC drivers/message/fusion/mptsas.o drivers/message/fusion/mptsas.c: In function `mptsas_port_delete': drivers/message/fusion/mptsas.c:106: sorry, unimplemented: inlining failed in call to 'mptsas_set_rphy': function b


      CC      drivers/message/fusion/mptsas.o
    drivers/message/fusion/mptsas.c: In function `mptsas_port_delete':
    drivers/message/fusion/mptsas.c:106: sorry, unimplemented: inlining failed in call to 'mptsas_set_rphy': function body not available
    drivers/message/fusion/mptsas.c:462: sorry, unimplemented: called from here
    make[3]: *** [drivers/message/fusion/mptsas.o] Error 1
    make[2]: *** [drivers/message/fusion] Error 2
    make[1]: *** [drivers/message] Error 2
    make: *** [drivers] Error 2

    drivers/message/fusion/mptsas.c: In function `mptsas_port_delete':
    drivers/message/fusion/mptsas.c:108: sorry, unimplemented: inlining failed in call to 'mptsas_set_rphy': function body not available
    drivers/message/fusion/mptsas.c:465: sorry, unimplemented: called from here
    drivers/message/fusion/mptsas.c: In function `mptsas_event_process':
    drivers/message/fusion/mptsas.c:5012: warning: unused variable `log_info'
    make[3]: *** [drivers/message/fusion/mptsas.o] Error 1
    make[2]: *** [drivers/message/fusion] Error 2
    make[1]: *** [drivers/message] Error 2
    make: *** [drivers] Error 2


    Solution (not really but the kernel won't compile properly with this driver and almost all kernels within the last 6 months are guilty of this):

     

    disable: CONFIG_FUSION_SAS

     

    In menuconfig for the kernel it can be found under:

     

    Device Drivers ---> Fusion MPT device support -> Fusion MPT ScsiHost drivers for SAS

     

    disable the "Fusion MPT ScsiHost drivers for SAS" option, all others can be left including the specific drivers in the SCSI section.

     

     


  • Choose Which GCC Version to compile with via CC environment variable.


    It's very common to have multiple GCC versions for different reasons, as annoying as it is.  Some newer/older programs only compile properly or at all on specific versions.

    You can export the following variable CC:

    export CC=gcc-4.1

    Replace gcc-4.1 with the filename of the gcc you want eg. gcc-99


  • SSH Automatic/Passwordless Logon - Setup Public Key Encryption In Single Command


    This is a very simple solution, but most guides out there make you login twice (once to scp the key) and once to put the key in authorized_keys.  There's no need for that. 

    If you don't already have a ~/.ssh/id_rsa.pub just type "ssh-keygen -t rsa" and keep hitting enter until it's done :)

    Just use this code to easily enable passwordless login with SSHD

    key=`cat ~/.ssh/id_rsa.pub`;ssh user@192.168.5.25 "echo $key >> ~/.ssh/authorized_keys"

    Copy and paste the above into your shell, just be sure to change the "user@" portion to the correct user and the 192.168.5.25 to the server that you want to login without any password authentication.

    Also be very sure to keep the backticks and the double quotes ", otherwise you'll find it won't work properly and tha tthe "~" will expand to the relative path on your current host, which is not what we want.  The double quotes force the shell to pass the command as it should be to the target host.

    An Even Better Way (just copy the below it prompts you for the login info so there's no need to hand edit anything.

    echo "Enter Target Info (eg. root@192.168.1.25";read ipaddress;key=`cat ~/.ssh/id_rsa.pub`;ssh $ipaddress "mkdir ~/.ssh;echo $key >> ~/.ssh/authorized_keys"

    Here is a handy bash script for automatic SSH Login/Keyexchange

    I just prompts for the login details eg. root@192.168.5.25 and then all you have to do is enter your password and the next time you try to login it will be automatic.  Remember to run "ssh-keygen -t rsa" if you haven't created your public/private keys in .ssh yet.

    #!/bin/bash
    #(c) 2016 - realtechtalk.com
    #free to distribute by keeping above credit
    echo "Enter the Host: username@ipaddress"
    read ipaddress
    echo "Setting Up Key Exchange with: "$ipaddress""
    key=`cat ~/.ssh/id_rsa.pub`
    target=$ipaddress
    ssh "$target" "mkdir -p ~/.ssh;echo $key >> ~/.ssh/authorized_keys;echo 0 > /selinux/enforce;sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config"
    #(c) 2010 - realtechtalk.com
    #free to distribute by keeping above credit

    *Disable SELinux or you can't login automatically on Centos 6.x

    #!/bin/bash

    #disable SELinux Immediately
    echo 0 > /selinux/enforce

    #disable SELinux Permanently
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
     


  • Starting online migration of CT 300 to 192.168.5.45 Error: vzcpt module is not loaded on the source node Error: Can't continue online migration Error: vzcpt module is not loaded on the source node Error: Can't continue online migration


    Starting online migration of CT 300 to 192.168.5.45
    Error:  vzcpt module is not loaded on the source node
    Error:  Can't continue online migration

    Error:  vzcpt module is not loaded on the source node
    Error:  Can't continue online migration

    This is a very easy fix, you just load the appropriate modules on the source and target node (although I don't know why the vzmigrate tool can't do that for the user on both ends):

    modprobe vzcpt


  • crontab Reference/How To/Info/Guide


    I can never actually remember the order and the number of parameters so here they are:

    minute hour day of month month day of week command
    0 5 * * * ~/backup.sh

    The above example means, at 5:00AM every single day, run the ~/backup.sh command.  Of course you can change the numbers to match what you intend to do.

    Here is something you can paste into your crontab if you want to have a handy reference of what each parameter means:

    #minute, hour, day of month, month, day of week, command

    Make sure that you have the "#" at the beginning of the line which means it is a comment and that the contents won't try to be interpreted/executed, this will break your crontab entries.


  • chroot into an off-line Linux version using a LiveCD/USB


    It's not just as simple as running the chroot command, you need to ensure the /proc and /dev entries are passed through and populated to the chroot environment.

    Step 1 - Mount Your Off-line OS

    mount /dev/sda1 /mnt

    Step 2 - Mount Proc

    mount -t proc none /mnt/proc

    Step 3 - Mount Dev

    Most guides will tell you to use this: mount -o bind /dev /mnt//dev but that doesn't work for some reason in many cases:

    mount: wrong fs type, bad option, bad superblock on /dev,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so

    So the work around is to use the following (unless the above works for you, I believe maybe newer versions of mount will be fine):

    cp -a /dev /mnt/dev-temp

    mount --bind /mnt/dev-temp/ /mnt/dev

    Chroot in!

    Everything should be fine, I can see my disks and everything functions as normal.  The bad part/side effect is the fact that for some reason I can't see my mdadm entries.


  • WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. The f


    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that the RSA host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    10:6b:89:c6:32:0f:37:88:42:4a:f4:14:09:5c:84:2e.
    Please contact your system administrator.
    Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
    Offending key in /home/user/.ssh/known_hosts:39
    RSA host key for 192.168.5.4 has changed and you have requested strict checking.
    Host key verification failed.

    Here is the simple fix for it:

    ssh-keygen -R 192.168.5.4

    /root/.ssh/known_hosts updated.
    Original contents retained as /root/.ssh/known_hosts.old


  • Unixbench Score on Core i5 750 with OpenVZ Kernel vs Xen/Openvz


    This was unbelievable how much the Xen kernel slows things down, keep in mind both tests were done on the hostnode, one was with the Openvz-Xen hybrid kernel and the other was just OpenVZ.  You can see the performance difference is nearly 300% better when not using the Xen kernel.

    OpenVZ-Xen Kernel Test Results (I was wondering what was wrong/so slow with my Core i5!)


       #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
       #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
       #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
       #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
       #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
        ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

                     4        1           Based on the Byte Magazine Unix Benchmark
                    44       11
       v   v       4 4        1
        v v       44444       1           v4.1 revisions mostly by David C. Niemi,
         v           4   o   111 - WHT.2  Reston, VA, USA  <niemi@tux.org>
     
    WHT Variant by Andy A. Lee <andylee@dslextreme.com>
    See: http://www.webhostingtalk.com/showthread.php?s=&threadid=308055


    Dhrystone 2 using register variables  1 2

    Double-Precision Whetstone  1 2

    Execl Throughput  1

    Filesystem Throughput 1024 bufsize 2000 maxblocks  1

    Filesystem Throughput 256 bufsize 500 maxblocks  1

    Filesystem Throughput 4096 bufsize 8000 maxblocks  1

    Pipe Throughput  1 2

    Pipe-based Context Switching  1 2

    Process Creation  1

    System Call Overhead  1 2

    Shell Scripts (8 concurrent)  1

    ==============================================================
    BYTE UNIX Benchmarks (Version 4.1-wht.2)
    System -- Linux localhost.localdomain 2.6.18-194.3.1.el5.028stab069.5xen #1 SMP Tue May 18 18:33:35 MSD 2010 i686 i686 i386 GNU/Linux
    /dev/sda3             19236340    177016  18082172   1% /mnt/sda3

    Start Benchmark Run: Sat May 29 01:28:00 EDT 2010
     01:28:00 up  2:38,  2 users,  load average: 0.32, 0.10, 0.02

    End Benchmark Run: Sat May 29 01:38:35 EDT 2010
     01:38:35 up  2:48,  2 users,  load average: 12.47, 5.83, 2.66


                         INDEX VALUES           
    TEST                                        BASELINE     RESULT      INDEX

    Dhrystone 2 using register variables        376783.7 24942262.7      662.0
    Double-Precision Whetstone                      83.1     1518.5      182.7
    Execl Throughput                               188.3     4822.1      256.1
    File Copy 1024 bufsize 2000 maxblocks         2672.0    69636.0      260.6
    File Copy 256 bufsize 500 maxblocks           1077.0    25286.0      234.8
    File Read 4096 bufsize 8000 maxblocks        15382.0   829674.0      539.4
    Pipe-based Context Switching                 15448.6   149570.1       96.8
    Pipe Throughput                             111814.6   416802.5       37.3
    Process Creation                               569.3     7657.1      134.5
    Shell Scripts (8 concurrent)                    44.8     1084.6      242.1
    System Call Overhead                        114433.5  3620305.9      316.4
                                                                     =========
         FINAL SCORE                                                     211.6

    OpenVZ only Kernel,now the Core i5 shows its performance!


       #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
       #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
       #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
       #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
       #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
        ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

                     4        1           Based on the Byte Magazine Unix Benchmark
                    44       11
       v   v       4 4        1
        v v       44444       1           v4.1 revisions mostly by David C. Niemi,
         v           4   o   111 - WHT.2  Reston, VA, USA  <niemi@tux.org>
     
    WHT Variant by Andy A. Lee <andylee@dslextreme.com>
    See: http://www.webhostingtalk.com/showthread.php?s=&threadid=308055


    Dhrystone 2 using register variables  1 2

    Double-Precision Whetstone  1 2

    Execl Throughput  1

    Filesystem Throughput 1024 bufsize 2000 maxblocks  1

    Filesystem Throughput 256 bufsize 500 maxblocks  1

    Filesystem Throughput 4096 bufsize 8000 maxblocks  1

    Pipe Throughput  1 2

    Pipe-based Context Switching  1 2

    Process Creation  1

    System Call Overhead  1 2

    Shell Scripts (8 concurrent)  1

    ==============================================================
    BYTE UNIX Benchmarks (Version 4.1-wht.2)
    System -- Linux localhost.localdomain 2.6.18-194.3.1.el5.028stab069.5PAE #1 SMP Tue May 18 18:26:13 MSD 2010 i686 i686 i386 GNU/Linux
    /dev/md0             297581760   1276412 280945208   1% /

    Start Benchmark Run: Sat May 29 01:55:39 EDT 2010
     01:55:39 up 2 min,  1 user,  load average: 0.57, 0.30, 0.11

    End Benchmark Run: Sat May 29 02:06:06 EDT 2010
     02:06:06 up 13 min,  2 users,  load average: 15.13, 6.61, 2.95


                         INDEX VALUES           
    TEST                                        BASELINE     RESULT      INDEX

    Dhrystone 2 using register variables        376783.7 24876280.4      660.2
    Double-Precision Whetstone                      83.1     1515.2      182.3
    Execl Throughput                               188.3    17397.6      923.9
    File Copy 1024 bufsize 2000 maxblocks         2672.0   379937.0     1421.9
    File Copy 256 bufsize 500 maxblocks           1077.0   107354.0      996.8
    File Read 4096 bufsize 8000 maxblocks        15382.0  2918897.0     1897.6
    Pipe-based Context Switching                 15448.6   973442.9      630.1
    Pipe Throughput                             111814.6  3216279.5      287.6
    Process Creation                               569.3    50262.7      882.9
    Shell Scripts (8 concurrent)                    44.8     3636.8      811.8
    System Call Overhead                        114433.5  3680141.7      321.6
                                                                     =========
         FINAL SCORE                                                     671.4

    The difference is easy to see

    Xen Kernel=211.6

    OpenVZ Kernel=671.4

    OpenVZ is more than 3x faster.  I would hate to see the poor results inside a Xen container.  How can Xen claim such high performance when this is clearly not the case?

     


    /proc/cpuinfo

    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 30
    model name      : Intel(R) Core(TM) i5 CPU         750  @ 2.67GHz
    stepping        : 5
    cpu MHz         : 2666.780
    cache size      : 8192 KB
    physical id     : 0
    siblings        : 4
    core id         : 0
    cpu cores       : 4
    apicid          : 0
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 11
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]
    bogomips        : 5333.56

    processor       : 1
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 30
    model name      : Intel(R) Core(TM) i5 CPU         750  @ 2.67GHz
    stepping        : 5
    cpu MHz         : 2666.780
    cache size      : 8192 KB
    physical id     : 0
    siblings        : 4
    core id         : 1
    cpu cores       : 4
    apicid          : 2
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 11
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]
    bogomips        : 5333.21

    processor       : 2
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 30
    model name      : Intel(R) Core(TM) i5 CPU         750  @ 2.67GHz
    stepping        : 5
    cpu MHz         : 2666.780
    cache size      : 8192 KB
    physical id     : 0
    siblings        : 4
    core id         : 2
    cpu cores       : 4
    apicid          : 4
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 11
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]
    bogomips        : 5333.24

    processor       : 3
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 30
    model name      : Intel(R) Core(TM) i5 CPU         750  @ 2.67GHz
    stepping        : 5
    cpu MHz         : 2666.780
    cache size      : 8192 KB
    physical id     : 0
    siblings        : 4
    core id         : 3
    cpu cores       : 4
    apicid          : 6
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 11
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]
    bogomips        : 5333.24
     

    This system has a GA-H57M-USB3 motherboard, 4Gigs of DDR3 and a RAID1 Western Digital 2TB 64Meg cache disk array, running Centos 5.5 32 bit.


  • Compile PHP 5.3.2 on Centos 5 and CPanel/WHM because of error - Fatal error: Call to > undefined function imagecreatefromjpeg()


    This function and others may not work with the stock PHP install on Centos/CPanel:  Fatal error:  Call to > undefined function imagecreatefromjpeg()

    Even with libjpeg-devel installed it won't work because PHP was not compiled with jpeg support, so we have to do the dirty work ourselves :)

    Here is the command/yum's I did to install missing libraries for PHP that configure will complain about (yes it is a one by one process).

    yum install bzip2-devel curl-devel enchant-devel t1lib-devel gmp-devel gettext-devel libibcommon-devel openldap-devel libmcrypt-devel freetds-devel unixODBC-devel pspell-devel readline-devel libedit-devel recode-devel

    imap error: (remove it unless you need it)

    configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

     

    Link error, with --with-xsl to fix the below error


    usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libxslt.so: undefined reference to `xmlXPathContextSetCache'

    replace --with-xsl with --with-dom-xslt
     

    Configure command for PHP below (it is fairly generic and should suit most uses/installs, but if it doesn't you need to add your own --with options).


    ./configure --with-openssl
    --with-kerberos
    --with-zlib
    --with-bz2
    --with-curl
    --with-curlwrappers
    --with-libxml-dir
    --with-enchant
    --with-pcre-dir
    --with-openssl-dir
    --with-gd
    --with-jpeg-dir
    --with-png-dir
    --with-zlib-dir
    --with-xpm-dir
    --with-freetype-dir
    --with-t1lib
    --with-gettext
    --with-gmp
    --with-mhash
    --with-kerberos
    --with-imap-ssl
    --with-ldap
    --with-ldap-sasl
    --with-libmbfl
    --with-onig
    --with-mcrypt
    --with-mssql
    --with-mysql-sock
    --with-unixODBC=/usr
    --with-dbmaker
    --with-pdo-dblib
    --with-pdo-mysql
    --with-zlib-dir
    --with-pspell
    --with-libedit
    --with-readline
    --with-recode
    --with-dom-xslt


  • Asus O!Play cannot access network/workgroup shares


    It always worked fine before but no amount of power unplugging/cycling does any good.  I can access one network share and that is one that I've already saved, but it can't see any workgroups.

    One silly thing is why is there no option to manually connect to a netbios name or IP?

    It seems there is a bug with the firmware and that the SMB client is not working properly.  Hopefully it fixes itself at some point.

    Between this and the lack of support for embedded subs, I really wish I didn't buy O!Play and that I went with the Western Digital instead.


  • Centos 5.5 RAID 1 boot issue


    I installed 5.5 with a 300GB RAID 1 partition (boot is also on this partition).  It booted up fine the first few times until after I used a Live CD and accessed the array, and it became named /dev/md127 for some reason.

    Now whenI boot into CentOS I get a kernel panic and different errors, once I got "invalid superblock", even though the array is fine (it didn't happen again, probably because I was sure to dismount and stop the mdadm array properly).

    Here's what I get when booting (the /dev/md127 is the problem I think):

    raid1: raid set md127 active with 2 out of 2 mirrors
    md: ... autorun DONE.
    Trying to resume from LABEL=SWAP-sda2
    No suspend signature on swap, no tresuming.
    Creating root device.
    Mounting root filesystem.
    mount: could not find filesystem '/dev/root'
    Setting up other filesystems.
    Setting up new root fs
    setuproot: moving /dev failed: No such file or directory.
    no fstab.sys, mounting internal defaults
    setuproot: error mounting /proc: No such file or directory
    setuproot: error mounting /sys: No such file or directory
    Switching to new root and running init.
    unmounting old /dev
    unmountin gold /proc
    unmounting old/sys
    switchroot: mount fialed: No such file or directory
    Kernel panic -no syncing: Attempted to kill init!

    I have tried specifying the root with UUID= with /dev/md0 and /dev/md127 without any different result. I'm really getting frustrated and stuck.  I also wonder if the issue might be that I used a very new 3.1.2 mdadm to access the array on my boot disc, could that have caused some incompatiblity problem with a different and likely older version of mdadm that Centos uses?

     

    Solved

    I think that when I accessed the raid array and it became md127, this screwed up all the initrd's or something else.  I don't know how to explain it.

    I got the idea to use single user mode and it booted fine.  Then I just made an initrd:

    mkinitrd /boot/yournewinitrd `uname -r` and make sure you boot with that initrd, I was able to boot again.  This should serve as a warning for anyone booting with RAID 1.  DON'T ACCESS THE RAID ARRAY WITH A LIVE CD UNLESS YOU USE THE SAME MD DEVICE.  I really think this is a Centos and mdadm bug in one.


  • Debian 5.04 RAID 1 mdadm boot problem GRUB error


    I successfully created a single RAID 1 partition which includes /boot inside it and my root directory through the Debian installer.  It said GRUB installed successfully but when I try booting the OS it seems GRUB can't read anything.

    When trying to boot from GRUB

    GRUB Loading stage 1.5.
    GRUB loading, please wait...
    Error 2

    I get "Error 2" when trying to boot Debian.  I also notice from a LiveCD that I can't even access hd0 or hd1 (both of which are part of the RAID 1 array).  I'm thinking if GRUB can't access it then this explains the boot error.  Is this a weird/problem/quick with Debian?  It seems like it must be.  Why can't they make this work like Centos does (I installed on 5.5 Centos in the same setup and it booted fine).

    From my LiveCD I can access the md array itself no problem, but inside GRUB I can't access any of the partitions individually.

    Error 2: Bad file or directory type.

    How can this happen?  It seems Centos sets up the RAID 1 so each partition can be access individually (which is what GRUB needs), but Debian sets it up so you can only access data through the md device/array only.

    Difference in mdadm versions:

    mdadm version 3.1.2 produces this output when querying a created array (I don't know if Debian uses this version or not but I've experienced a similar issue with other systems using this version of mdadm):

           Version : 1.2
      Creation Time : Mon May 10 22:05:12 2010
         Raid Level : raid1
         Array Size : 14658185 (13.98 GiB 15.01 GB)
      Used Dev Size : 14658185 (13.98 GiB 15.01 GB)
       Raid Devices : 2
      Total Devices : 2
        Persistence : Superblock is persistent

        Update Time : Thu May 13 05:17:33 2010
              State : clean
     Active Devices : 2
    Working Devices : 2
     Failed Devices : 0
      Spare Devices : 0

    With the Centos mdadm array it says the following (the Centos array is readable by GRUB):

    Version: .9

    I tested and the Debian install returns "Version .9" which is the same one that works fine in Centos (at least for the ability for GRUB to access the partitions individually). 

    I don't get it, I can mount the two Debian partitions, but GRUB cannot read it, I get Error 2 just like when attempting to boot with GRUB.

    *The issue here is clearly the difference in superblocks ".9" and "1.2".  GRUB cannot access the new type of superblock, I read something about it here, where the structure and layout is different.  This is something that neither GRUB or mdadm has accounted for. https://raid.wiki.kernel.org/index.php/RAID_superblock_formats#mdadm_v3.0_--_Adding_the_Concept_of_User-Space_Managed_External_Metadata_Formats

    It seems that starting with version 3.0 of mdadm that the new superblock came into play.  GRUB really needs to be maintained (the. 97) so the distro maintainers don't need to keep making their own updates.

    Solution/How to Create a Proper 0.90 metadata Superblock that GRUB boot with

    mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 --metadata=0.90

    *Note the "--metadata=0.90", that is the only metadata format that GRUB will be able to boot from (at this time).

    I did a test using mdadm version 3.1.2 from my LiveCD (where I also can't access individual partitions), then I used an older Debian mdadm - v2.5.6 - 9 November 2006 and the partitions are accessible.  Obviously Debian 5.04 is using a newer mdadm which is buggy and causes this issue.  So my solution will be to ignore the Debian installer and re-create my RAID array manually!

    I have confirmed the following versions produce RAID 1 arrays that GRUB can read: 2.5.6 and  2.6.9


  • Great way to backup/clone/dd your Linux partitions


    Partclone is a great tool that is basically like dd only it does not waste space, it doesn't take the whole partition, yet it does the same thing as dd, only with huge space/cost savings.

    Clonezilla uses partclone and is more of an integrated/easy to use suite I guess you could say.  I've personally only used partclone but I wish there was an easy way to mount partclone images.

    I believe with Clonezilla you can do that, so I will probably give it a shot next time.


  • MySQL Recover/Reset Lost/Forgotten root Password


    One note is to secure MySQL, I don't know for sure but I believe you could login to MySQL remotely with no password during this operation (I'm not sure, maybe it doesn't accept blank passwords but I firewall MySQL port anyway and recommend you do the same).

    First edit /etc/my.cf

    Under the [mysqld] field add the following line somewhere:

    skip-grant-tables

    Now restart mysql: service mysql restart or on Debian style systems: /etc/init.d/mysqld restart

    You can now login to mysql as root with no password.

    mysql -u root

    Enter the following commands (you can copy and paste below, remember to change "YOURNEWPASSWORD" to whatever you want the password to be.

    use mysql;
    UPDATE user SET password=password("YOURNEWPASSWORD") WHERE user='root';
    flush privileges;
    quit

    *Note more note is that if you are using Plesk, the root user is probably called/renamed "admin" so you'll need to replace everything above with "admin" if that's the case.  Of course an easier way if Plesk is actually running is to use the Forgot Password function of the Control Panel itself.


  • Openvz Enable Most Common iptables modules


    The default options for iptables are very basic.  Here is what you need to do in order to enable them in OpenVZ.

    1.) Add the modules to iptables and restart iptables:

    vi /etc/sysconfig/iptables-config

    Edit the line as so:

    IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"

    2.) Enable/Add the modules into Openvz

    vi /etc/sysconfig/vz

    Edit the following line as so:

    IPTABLES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpms
    s ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"

    3.) Restart the VZ service or move the container to a node that has the iptables modules enabled.


  • mdadm force/fix proper md127 name


    I have an md0 arary that my Centos install refers to.  I feel this is half the reason why it won't boot anymore.

    I saw the initrd for Centos was assembling it as md127 even though it was known as md0.

    The reason for this is because I used mdadm --assemble --scan to detect the array on a LiveCD.  I had no idea this name would stick (but now I realize the name is permanently stored in the metadata once you mount md127 or whatever random name assemble gives it).  Why can't mdadm read the metadata first and assemble it is as the correct name?  This will kill a live server if you access the RAID array using the scan/assemble mode, the server won't boot again until you take the corrective/action/solution below!

    So back in my LiveCD I forced it to go back to md0 (now initrd reports it as md0 since doing this):

    Solution - Manually Assemble the md device with the correct name and mount it

    mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1

    *Note that you must actually mount the md device for it to keep the new name.

    I think mdadm should store some information about the name of the device and default to the original md device even if it was assembled by some LiveCD as md127.

    This is one of many things that make me question how practical and well thought out mdadm really is.


  • Why does mdadm have two sets of UUID's?


    Which one does the OS care about?  blkid says the UUID is "787f1fa4-b010-4d77-a010-795b42884f56" while md insists its UUID is "4d96dd3b:deb5d555:7adb93cb:ce9182d9"

    When in doubt, do we assume the OS takes the one from blkid? 

    /dev/md0: UUID="787f1fa4-b010-4d77-a010-795b42884f56" TYPE="ext3"
    [root@localhost ~]# mdadm -D /dev/md0
    /dev/md0:
            Version : 0.90
      Creation Time : Fri May 28 15:48:07 2010
         Raid Level : raid1
         Array Size : 307202816 (292.97 GiB 314.58 GB)
      Used Dev Size : 307202816 (292.97 GiB 314.58 GB)
       Raid Devices : 2
      Total Devices : 2
    Preferred Minor : 0
        Persistence : Superblock is persistent

        Update Time : Mon May 31 05:23:48 2010
              State : clean
     Active Devices : 2
    Working Devices : 2
     Failed Devices : 0
      Spare Devices : 0

               UUID : 4d96dd3b:deb5d555:7adb93cb:ce9182d9
             Events : 0.4

        Number   Major   Minor   RaidDevice State
           0       8        1        0      active sync   /dev/sda1
           1       8       17        1      active sync   /dev/sdb1

     

    The real answer about the two sets of UUIDs

    The blkid UUID above "787f1fa4-b010-4d77-a010-795b42884f56" is the correct one, that is what the OS will use to find the RAID array.

    But mdadm has it's own "internal" UUID which is not used directly by the OS and is what you use in the mdadm.conf file eg:

    ARRAY /dev/md0 level=raid1 num-devices=2 uuid=ffb40f02:91eebca2:cf946fc5:a655d98e
    ARRAY /dev/md1 level=raid1 num-devices=2 uuid=0d4ae4bf:1b435759:c8f99160:83b906ee

    This is another silly thing that programmers do without the implications of.  mdadm shouldn't call anything UUID when it is separate from the one that blkid and the OS recognize.  Maybe it should be called mduuid or something else to avoid confusion.


  • CPanel Use /scripts/easyapache to recompile Apache/PHP with different options


    I used the "Image Manipulation and Security Options" and let the script do the rest.

    /scripts/easyapache

    For whatever reason, doing a manual compile of PHP myself broke everything and I've never seen that before, that's why I resorted to the cheat of easyapache.


  • How To Set DHCP/Static IP Address in Centos/RHEL/Fedora & Debian/Ubuntu/Kubuntu/MEPIS Set DHCP/Static IP Address


    Basically the two main types of distros are Debian and RHEL/Centos based.  I'm just going to give a quick overview of how the configuration of IP interfaces works in Debian/Centos based distros.

    *Just one thing to remember, when setting IPs statically you have to manually specify a DNS server in /etc/resolv.conf (since DHCP is what normally does it automatically)

    Debian/Ubuntu/Kubuntu/MEPIS

    The IP (DHCP & Static) configuration is done from the following file: /etc/network/interfaces

    Here is how the default DHCP configuration looks:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    auto eth0
    iface lo inet loopback

    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet dhcp

    Here is an example of setting it statically:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    auto eth0
    iface lo inet loopback

    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
            address 192.168.1.147
            netmask 255.255.255.0
            gateway 192.168.1.1

     

    How to Add Multiple IPs in Debian/Ubuntu

    auto eth0:0

    iface eth0:0 inet static

        address  192.168.1.148

        netmask 255.255.255.0

        gateway 192.168.1.1


    auto eth0:1

    iface eth0:1 inet static

        address  192.168.1.149

        netmask 255.255.255.0

        gateway 192.168.1.1

     

    *Just one thing to remember, when setting IPs statically you have to manually specify a DNS server in /etc/resolv.conf (since DHCP is what normally does it automatically)

     

     


     

    Centos/RHEL/Fedora/Mandriva

    The IP (DHCP & Static) configuration is done from the following file : /etc/sysconfig/network-scripts/ifcfg-eth0

    *Note the "eth0" at the end, each device has it's own entry within the network-scripts directory.

    Here is how the default DHCP configuration looks:

    # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
    DEVICE=eth0
    BOOTPROTO=dhcp
    HWADDR=5A:G1:29:4A:1C:76
    ONBOOT=yes

    Here is an example of setting it statically:

    DEVICE=eth0
    BOOTPROTO=static
    IPADDR=192.168.1.245
    GATEWAY=192.168.1.1
    NETMASK=255.255.255.0
    ONBOOT=YES

    *Just one thing to remember, when setting IPs statically you have to manually specify a DNS server in /etc/resolv.conf (since DHCP is what normally does it automatically)


  • CPanel Solution for Error Missing HOST Config Line in /etc/wwwacct.conf, please reconfigure with Edit Setup.


    Edit /etc/wwwacct.conf

    Then add/edit the HOST line to add your hostname. eg:

    HOST yourcpanelserver.com


  • rsync skipping non-regular file


    skipping non-regular file "mnt/lib/udev/devices/console"
    skipping non-regular file "mnt/lib/udev/devices/kmem"
    skipping non-regular file "mnt/lib/udev/devices/loop0"
    skipping non-regular file "mnt/lib/udev/devices/null"
    skipping non-regular file "mnt/lib/udev/devices/ppp"
    skipping non-regular file "mnt/lib/udev/devices/net/tu

    Solution for skipping non-regular file

    You need the -D switch which is a hybrid of --specials and --devices so all special and device files will be copied as well.


  • Warning: get_browser(): browscap ini directive not set. PHP Error Solution Fix


    Warning: get_browser(): browscap ini directive not set.

    Solution is to edit /etc/php.ini

    Uncomment this:

    [browscap]
    browscap = extra/browscap.ini


  • Linux Centos/RHEL can't find php/apache/httpd/mysql/ftp/exim/sendmail ?


    I wasted a lot of time wondering why I could never find those packages.

    Check the /etc/yum.conf file and at the bottom look for the "exclude=" line. 

    Below is what I found in mine

    exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* php* bind-chroot*

    Just remove those entries or uncomment that line and you'll get access to the missing applications.


  • Centos How To Add Static Network Route


    route add -net 192.16.5.0 netmask 255.255.255.0 eth0

    Of course adjust as you need (eg. the 192.16.5.0 should be changed to the subnet you need access to and eth0 should be changed to the network device that you want that subnet routed through).   I also use the /etc/sysconfig/rc.local script and add the above into it (remember that this route only gets added AFTER all other init scripts have finished though).


  • mdadm can you downgrade the superblock?


    Why would you want to downgrade the superblock?  Old mdadm verisons like mdadm 2.5.6 only use the 0.90 superblock/metadata and new versions use 1,1.0,1.1 and 1.2 superblocks by default.

    There are some annoying caveats with this, first of all the new superblocks (later than 0.90) CANNOT be read by GRUB, so you won't even be able to install GRUB.  Even worse, old versions of mdadm CANNOT automatically detect arrays even if they were created with a new version of mdadm with the -e 0.90 superblock flag.  And of course old versions of mdadm cannot even manually mount the new superblock format (I'm not sure what would happen if you tried).

    So I thought I'd try to downgrade an existing 1.2 superblock array, I had already backed up data to another partition and it's good because my experience didn't go well.  Unfortunately it's not possible to downgrade the superblock and below are my nresults and observations from trying.

    First of all more details from the mdadm man page:

    -e , --metadata=
        Declare the style of superblock (raid metadata) to be used. The default is 0.90 for --create, and to guess for other operations.

        Options are:
        0, 0.90, default

    Use the original 0.90 format superblock. This format limits arrays to 28 componenet devices and limits component devices of levels 1 and greater to 2 terabytes.

        1, 1.0, 1.1, 1.2

    Use the new version-1 format superblock. This has few restrictions. The different subversion store the superblock at different locations on the device, either at the end (for 1.0), at the start (for 1.1) or 4K from the start (for 1.2).

    Trying with superblock 1.1


    mdadm --create /dev/md0 -e 1.1 --assume-clean --level=1 --raid-devices=2 /dev/sda3 missing
    mdadm: /dev/sda3 appears to be part of a raid array:
        level=raid1 devices=2 ctime=Wed May 12 20:16:56 2010
    Continue creating array? y
    mdadm: array /dev/md0 started.


    *Version 1.1 is not readable by GRUB either


    md0 : active raid1 sda3[0]
          461017216 blocks [2/1] [U_]

     

    Trying with superblock 0.90


    mdadm --create /dev/md0 -e 0.90 --assume-clean --level=1 --raid-devices=2 /dev/sda3 missing  
    mdadm: /dev/sda3 appears to be part of a raid array:
        level=raid1 devices=2 ctime=Tue Jun  8 23:01:54 2010
    Continue creating array? y
    mdadm: array /dev/md0 started.


    *Now I can't mount the partition individually or as md0 for some reason.  It seems this wiped out the superblock and/or trying to create things with this new (even older version) superblock broke something.
     


  • cPanel complaint - No Shared SSL! cPanel 11.25.0-R46156 - WHM 11.25.0 - X 3.9


    I've recently used CPanel on the admin side for the first time and have to say I hate it.  Everything from the layout to the functionality screams "hackish".  It just lacks so many common sense features and way of working.

    I was never 100% impressed with Plesk but the basics were definitely laid out and done in a sensible manner, even though it is made by a Russian company, they definitely thought about how to make a Control Panel.

    I have no idea why people like CPanel, it's even more bloated and inefficient than Plesk.

    Another thing is why is there no shared SSL?

    People just say use "https://host/~username", well that doesn't cut it.  Plesk has true shared SSL and does not require a dedicated IP/SSL certificate.  It took me long enough to find out that CPanel doesn't really have shared SSL at all.

    What if you host in a country where IPs are limited/expensive?  CPanel really expects you to have a dedicated IP just to secure your admin login etc...?

    CPanel is just extremely dated and I have no idea why anyone likes it.  When I first logged in I really thought that I had an old version of CPanel.


  • mdadm: /dev/sda1 is too small: 0K - solution


    I was creating a RAID array and got this error: mdadm: /dev/sda1 is too small: 0K
    mdadm: create aborted

    Of course sda1 is not too small, both partitions sda1 and sdb1 are identical in size:

    Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         974     7823623+  83  Linux
    /dev/sda2             975        3407    19543072+  83  Linux
    /dev/sda3   *        3408       60801   461017305   83  Linux
    /dev/sda4           60802      243201  1465128000    5  Extended
    /dev/sda5           60802      231009  1367195728+  83  Linux
    /dev/sda6          231010      243201    97932208+  83  Linux

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1         974     7823623+  83  Linux
    /dev/sdb2             975        3407    19543072+  83  Linux
    /dev/sdb3   *        3408       60801   461017305   83  Linux

     The solution is simple, use partprobe to read-read the partitions

    Just run:

    partprobe

    And it will work, but the weird thing is that these partitions were created a few reboots ago.  This is obviously some weird quick with the older mdadm version.


  • Fix Slow 2D Graphics Xorg.conf Ubuntu/Debian/Mandriva Linux


    I'm using Ubuntu 8.04 but anyone using older kernels will find this may apply to them.  My Intel graphics are very slow with the default Xorg settings but by using "EXA" acceleration, scrolling down windows of text becomes pretty snappy.

    Just edit /etc/X11/xorg.conf

    Section "Device"
            Identifier      "Configured Video Device"
            Option          "AccelMethod" "EXA"
            #Option         "MigrationHeuristic" "greedy"
            #don't use the "greedy" option, it just causes the screen to lockup/stall along with other problems
    EndSection

    You'll notice that I disabled the "MigrationHeuristic" "greedy" option, it causes the screen to lockup/stall unnecessarily for some reason.

    Just enabling EXA acceleration and rebooting and/or restaring XServer gave me a huge improvement in 2D graphics performance, especially when scrolling.

    I am still never satisfied with the Linux graphics performance though, it really does hold Linux back and is another huge thing holding back/slowing down Linux Desktop adoption.


  • Use rcconf to edit startup/init.d/init scripts on Debian/Ubuntu based distributions


    I've never understood how to enable and disable services for different run levels in Debian based distros, it's just weird, annoying and doesn't make sense.  I much prefer chkconfig from RHEL.

    Just install the package called 'rcconf' and be done with it.  rcconf makes things easy for you.

    apt-get install rcconf
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      rcconf
    0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
    Need to get 19.8kB of archives.
    After this operation, 119kB of additional disk space will be used.
    Get:1 http://us.archive.ubuntu.com intrepid/universe rcconf 1.21 [19.8kB]
    Fetched 19.8kB in 0s (20.6kB/s)
    Selecting previously deselected package rcconf.
    (Reading database ... 195757 files and directories currently installed.)
    Unpacking rcconf (from .../archives/rcconf_1.21_all.deb) ...
    Processing triggers for man-db ...
    Setting up rcconf (1.21) ...

                                                                                                                       │ ”€â”€â”‚    [*] NetworkManager                                                                                              ↑   │    │    [*] acpi-support                                                                                                â–®   │    │    [*] acpid                                                                                                       â–’   │    │    [*] anacron                                                                                                     â–’   │    │    [*] apmd                                                                                                        â–’   │    │    [*] apparmor                                                                                                    â–’   │    │    [*] apport                                                                                                      â–’   │    │    [*] atd                                                                                                         â–’   │    │    [*] avahi-daemon                                                                                                â–’   │    │    [*] binfmt-support                                                                                              â–’   │    │    [*] bluetooth                                                                                                   â–’   │    │    [*] bootmisc.sh                                                                                                 â–’   │    │    [*] brltty                                                                                                      â–’   │    │    [*] checkfs.sh                                                                                                  â–’   │    │    [*] checkroot.sh                                                                                                â–’   │    │    [*] console-screen.kbd.sh                                                                                       â–’   │    │    [*] console-setup                                                                                               â–’   │    │    [*] cron                                                                                                        â–’   │    │    [*] cryptdisks                                                                                                  â–’   │    │    [*] cryptdisks-early                                                                                            â–’   │    │    [*] cups                                                                                                        â–’   │    │    [*] dbus                                                                                                        â–’   │    │    [*] dkms_autoinstaller                                                                                          â–’   │    │    [*] dns-clean                                                                                                   â–’   │    │    [*] exim4                                                                                                       â–’   │    │    [*] fancontrol                                                                                                  â–’   │    │    [*] gdm                                                                                                         â–’   │    │    [*] hal                                                                                                         â–’   │    │    [*] halt                                                                                                        â–’   │    │    [*] hddtemp                                                                                                     â–’   │    │    [*] hostname.sh                                                                                                 â–’   │    │    [*] hotkey-setup                                                                                                â–’   │    │    [*] hwclock.sh                                                                                                  â–’   │    │    [*] hwclockfirst.sh                                                                                             â–’   │    │    [*] keyboard-setup                                                                                              â–’   │    │    [*] killprocs                                                                                                   â–’   │    │    [*] klogd                                                                                                       â–’   │    │    [*] laptop-mode                                                                                                 â–’   │    │    [*] linux-restricted-modules-common                                                                             â–’   │    │    [*] lm-sensors                                                                                                  â–’   │    │    [*] loopback                                                                                                    â–’   │    │    [*] mdadm                                                                                                       â–’   │    │    [*] module-init-tools                                                                                           â–’   │    │    [*] mountall-bootclean.sh                                                                                       â–’   │    │    [*] mountall.sh                                                                                                 â–’   │    │    [*] mountdevsubfs.sh                                                                                            â–’   │    │    [*] mountkernfs.sh                                                                                              â–’   │    │    [*] mountnfs-bootclean.sh                                                                                       â–’   │    │    [*] mountnfs.sh                                                                                                 â–’   │    │    [*] mountoverflowtmp                                                                                            â–’   │    │    [*] mtab.sh                                                                                                     â–’   │    │    [*] networking                                                                                                  â–’   │    │    [*] pcmciautils                                  


  • LUKS/cryptsetup Tutorial for Linux Hard Drive Partition Encryption


    This is based on Debian Linux but should apply equally to any *nix distro.

    Install LUKS/crypt-setup

    apt-get install cryptsetup

    Setup your LUKS Partition

    Of course change /dev/md2 with whatever partition you intend to use LUKS on.

    cryptsetup --verbose --verify-passphrase luksFormat /dev/md2

    You'll be asked to verify your decryption password twice

    *DO NOT FORGET THIS PASSWORD AS IT IS NOT RECOVERABLE!

    Open/Unlock your LUKS Partition

    cryptsetup luksOpen /dev/md2 mylukspartition

    You'll be asked for your passphrase at this point (the one you entered above, hopefully you haven't forgotten it already!)

    You can change "mylukspartition" to whatever you would like to call it, it just controls the name created in /dev/mapper which is the device you will use to mount the encrypted LUKS partition.

    You'll find that the above command creates /dev/mapper/mylukspartition

    This will create the device for your LUKS partition (remember you will never be able to open it directly and you'll always need the LUKS tools to unlock the partition, so keep this in mind when using a Live/Recovery CD etc...)

    CREATE the filesystem on the LUKS device

    mkfs.ext3 /dev/mapper/mylukspartition

    *Of course you can use any filesystem over top of LUKS but most will probably use ext3

    Mount the LUKS Partition

    mkdir /mnt/luks

    mount /dev/mapper/mylukspartition /mnt/luks

    To Umount and Secure Your Data

    cryptsetup luksClose /dev/mapper/mylukspartition

    Now your data is safe and in order to mount (luksOpen) you will need the passphrase which only you should know.


  • Install Mac OS X 10.4.6 Tiger on AMD32 VMWare


    *Note OS X is strange to install, I thought my HDD was not being detected by you just have to go to Diskutil and create a partition for the root filesystem and then close/move the Window and proceed with the install.

    After install Mac OS X 10.4.6 Tiger I get a black screen that says:

    b0 error

    Most people say the partition has to be marked as "active", actually that just means marked as "bootable".  Instead of the Mac OS X disc, you can use any Linux boot disc and mark the partition as bootable.

    fdisk /dev/hda1
    #list partitions
    p
    #set active
    a
    #choose partition to make active
    1

    But after that I get a screen with a power symbol in the background that says:

     

    You need to restart your computer. Hold down the Power button for several seconds or press the Restart button

    I heard this is caused by not having an SSE2/SSE3 patch.


  • FUSE/Curlftpfs mount ftp account as drive partition in Linux


    This is a great way to use your ftp server space, for example on your web hosting account (although I believe many hosts don't allow storage like this), but if you have a VPS/Dedicated Server etc.., this would be perfect.  Imagine how easy it is to work with an ftp account that you can just mount as a normal partition or directory in Linux, it would be great for backups etc..

     

    Name

    curlftpfs - mount a ftp host as a local directory

    Synopsis

    curlftpfs [options] host

    path

    Description

    The program

    curlftpfs

    is a tool to mount remote ftp hosts as local directories. It connects to the

    host

    FTP server and maps its directory structure to the

    path

    directory.

    curlftpfs is powered by libcurl for all transfer-related features. See libcurl(3) for details. The filesystem part is implemented on top of FUSE. See http://fuse.sourceforge.net/ for details.

    Ftp Options

    -h/--help
    Print help options.
    -v/--verbose
    Make libcurl print verbose debug output.
    -V/--version
    Print curlftpfs, libcurl and fuse versions.
    -o
    Options are specified with a -o flag followed by a comma separated string of options.
    cacert=<file>
    (SSL) Pass a string naming a file holding one or more certificates to verify the peer with.

    Note that option is by default set to the system path where libcurl's cacert bundle is assumed to be stored, as established at build time.

    capath=<directory>
    (SSL) Tells curlftpfs to use the specified certificate directory to verify the peer. The certificates must be in PEM format, and the directory must have been processed using the c_rehash utility supplied with openssl. Using capath can allow curlftpfs to make connections much more efficiently than using cacert if the cacert file contains many CA certificates.
    cert=<certificate>
    (SSL) Tells curlftpfs to use the specified certificate file. The default format is "PEM" and can be changed with cert_type.
    cert_type=<type>
    (SSL) Tells curlftpfs what certificate type the provided certificate is in. PEM, DER and ENG are recognized types.
    ciphers=<list of ciphers>
    (SSL) Specifies which ciphers to use in the connection. The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, , - and + can be used as operators. Valid examples of cipher lists include 'RC4-SHA', 'SHA1+DES', 'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL.

    Read up on SSL cipher list details on this URL: http://www.openssl.org/docs/apps/ciphers.html

    codepage=<name>
    Sets the encoding the ftp server uses to encode file names.
    connect_timeout=<seconds>
    Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once curlftpfs has connected this option is of no more use.
    disable_eprt
    Tell curlftpfs to disable the use of the EPRT and LPRT commands when doing active FTP transfers. Curlftpfs will normally always first attempt to use EPRT, then LPRT before using PORT, but with this option, it will use PORT right away. EPRT and LPRT are extensions to the original FTP protocol, may not work on all servers but enable more functionality in a better way than the traditional PORT command.
    disable_epsv
    Tell curlftpfs to disable the use of the EPSV command when doing passive FTP transfers. Curlftpfs will normally always first attempt to use EPSV before PASV, but with this option, it will not try using EPSV.
    engine=<name>
    Select the OpenSSL crypto engine to use for cipher operations. Use:
    curl --engine list
    to print a list of build-time supported engines. Note that not all (or none) of the engines may be available at run-time.
    ftpfs_debug
    Make curlftpfs print lots of debug information. Useful only in conjunction with the -d option.
    ftp_port=<address>
    Reverses the initiator/listener roles when connecting with ftp. This switch makes curlftpfs use the PORT command instead of PASV. In practice, PORT tells the server to connect to the client's specified address and port, while PASV asks the server for an ip address and port to connect to. <address> should be one of:
    interface
    i.e "eth0" to specify which interface's IP address you want to use
    IP address
    i.e "192.168.10.1" to specify exact IP number
    host name
    i.e "my.host.domain" to specify machine
    -

    make curlftpfs pick the same IP address that is already used for the control connection

    Disable the attempt to use the EPRT command instead of PORT by using disable_eprt. EPRT is really PORT++.

    httpproxy
    Set the proxy type to HTTP. This is the default type.
    interface=<name>
    Pass a string as parameter. This set the interface name to use as outgoing network interface. The name can be an interface name, an IP address or a host name.
    iocharset=<name>
    Sets the charset used by the client side for codepage to charset translation. Default: UTF8.
    ipv4
    If libcurl is capable of resolving an address to multiple IP versions (which it is if it is ipv6-capable), this option tells libcurl to resolve names to IPv4 addresses only.
    ipv6
    If libcurl is capable of resolving an address to multiple IP versions (which it is if it is ipv6-capable), this option tells libcurl to resolve names to IPv6 addresses only.
    key=<key>
    (SSL) Private key file name. Allows you to provide your private key in this separate file. The default format is "PEM" and can be changed with key_type.
    key_type=<type>
    (SSL) Pass a string in the format of your private key. Supported formats are "PEM", "DER" and "ENG".

    The format "ENG" enables you to load the private key from a crypto engine. In this case key is used as an identifier passed to the engine. You have to set the crypto engine with engine option. "DER" format key file currently does not work because of a bug in OpenSSL.

    krb4=<level>
    Enable kerberos4 authentication and use. The level must be entered and should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use a level that is not one of these, 'private' will instead be used.

    This option requires that the libcurl library was built with kerberos4 support. This is not very common.

    no_verify_hostname
    (SSL) Curlftpfs will not verify the hostname when connecting to a SSL enabled server.
    no_verify_peer
    (SSL) Curlftpfs will not verify the certificate when connecting to a SSL enabled server.
    pass=<password>
    (SSL) Pass phrase for the private key.
    proxy=<host[:port]>
    Use specified HTTP proxy. If the port number is not specified, it is assumed at port 1080.

    This option overrides existing environment variables that sets proxy to use. If there's an environment variable setting a proxy, you can set proxy to "" to override it.

    This options implies the proxytunnel option.

    Starting with libcurl version 7.14.1, the proxy host can be specified the exact same way as the proxy environment variables, including protocol prefix (http://) and embedded user + password.

    proxytunnel
    Tells curlftpfs to use a tunnel proxy. This option is implied by the proxy option but you need to set it manually if you use the proxy environment variable.
    proxy_anyauth
    Tells curl to pick a suitable authentication method when communicating with the given proxy. This will cause an extra request/response round-trip.
    proxy_basic
    Tells curlftpfs to use HTTP Basic authentication when communicating with the given proxy. Basic is the default authentication method curlftpfs is used with proxies.
    proxy_digest
    Tells curlftpfs to use HTTP Digest authentication when communicating with the given proxy.
    proxy_ntlm
    Tells curlftpfs to use HTTP NTLM authentication when communicating with the given proxy.
    proxy_user=<user:password>
    Specify user and password to use for proxy authentication.
    skip_pasv_ip
    Tell curlftpfs to not use the IP address the server suggests in its response to curlftpfs's PASV command when curlftpfs connects the data connection. Instead curlftpfs will re-use the same IP address it already uses for the control connection.
    socks4
    Set the proxy type to SOCKS4.
    socks5
    Set the proxy type to SOCKS5.
    ssl
    Make curlftpfs use SSL/TLS for both control and data connections.
    sslv3
    Forces curlftpfs to use SSL version 3 when negotiating with a remote SSL server.
    ssl_control
    Make curlftpfs use SSL/TLS only for the control connection.
    ssl_try
    Curlftpfs will try to use SSL/TLS for both the control and data connections but if the server doesn't support it, it will still connect unencrypted.
    tcp_nodelay
    Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man page for details about this option.
    tlsv1
    (SSL) Forces curlftpfs to use TLS version 1 when negotiating with a remote TLS server.
    transform_symlinks
    Append path to the absolute symlinks so that they still point inside the ftp directory structure. Otherwise those links will very probably be broken.
    user=<user:password>
    Specify user and password to use for server authentication. Overrides netrc configuration.
    utf8
    Try to transfer file list with UTF-8 encoding. Send OPTS UTF8 ON at the beginning of file list transfer.

    Fuse Options

    -d
    Enable FUSE debug output. Implies -f.
    -f
    Run curlftpfs in foreground mode.
    -r
    Mount read-only.
    -s
    Disable multi-threaded operation.
    -o
    Options are specified with a -o flag followed by a comma separated string of options.
    allow_other
    Allow access to other users. By default the mount point is only accessible to the user that mounted it and not even to root.
    allow_root
    Allow access to root user. By default the mount point is only accessible to the user that mounted it and not even to root.
    debug
    enable debug output
    direct_io
    use direct I/O
    fsname=NAME
    set filesystem name in mtab
    gid=N
    set file group
    hard_remove
    immediate removal (don't hide files)
    kernel_cache
    Let the kernel VFS do some caching of the files.
    large_read
    issue large read requests (2.4 only)
    max_read=N
    set maximum size of read requests
    nonempty
    allow mounts over non-empty file/dir
    readdir_ino
    try to fill in d_ino in readdir
    uid=N
    set file owner
    umask=M
    set file permissions (octal)
    use_ino

    let filesystem set inode numbers

    Authors

    Robson Braga Araujo is the author and maintainer of CurlFtpFS.

    Www

    http://curlftpfs.sourceforge.net

    See Also

    mount(8)
  • MySQL Insert Statement ONLY IF a duplicate entry does not exist


    This is a great way to reduce MySQL code/mistakes/annoyance when doing things, take for example this statement:

    INSERT IGNORE INTO sometable(CatName) VALUES("someitem");

    Notice the "IGNORE", that is what does the magic.

    Normally if the entry "someitem" existed you'd get an error message back such as "Duplicate entry for whatever".  What I have normally done in PHP or whatever language is manually coded or made a helper function to return true/false if the same result/name already exists in the database.

    Just note that the syntax has changed from a normal INSERT.


  • RAID 1 and Non-RAID Hard Drive Performance Comparison using tiobench


    Here is a RAID 1 partition (500GB Seagate & 2TB WD):

    Sequential Reads
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1   86.46 25.43%     0.044     1498.90   0.00000  0.00000   340
    2.6.27-16-generic             1792  4096    2  145.66 86.49%     0.042     1629.59   0.00000  0.00000   168
    2.6.27-16-generic             1792  4096    4  156.01 186.7%     0.074     2226.75   0.00044  0.00000    84
    2.6.27-16-generic             1792  4096    8  200.13 471.4%     0.130     1519.34   0.00000  0.00000    42

    Random Reads
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1    2.15 2.529%     1.817       92.54   0.00000  0.00000    85
    2.6.27-16-generic             1792  4096    2    3.03 3.873%     1.665       69.56   0.00000  0.00000    78
    2.6.27-16-generic             1792  4096    4    4.89 8.890%     2.292      159.16   0.00000  0.00000    55
    2.6.27-16-generic             1792  4096    8    4.85 20.62%     4.840      263.46   0.00000  0.00000    24

    Sequential Writes
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1   21.36 25.66%     0.177     5462.31   0.00109  0.00000    83
    2.6.27-16-generic             1792  4096    2   23.07 63.22%     0.301     7352.31   0.00109  0.00000    36
    2.6.27-16-generic             1792  4096    4   23.78 161.6%     0.631     4570.67   0.00305  0.00000    15
    2.6.27-16-generic             1792  4096    8   20.13 278.8%     1.406     6773.69   0.00763  0.00000     7

    Random Writes
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1    0.11 0.092%     0.017        0.07   0.00000  0.00000   118
    2.6.27-16-generic             1792  4096    2    0.10 0.181%     0.019        0.07   0.00000  0.00000    57
    2.6.27-16-generic             1792  4096    4    0.11 0.468%     0.023        0.11   0.00000  0.00000    23
    2.6.27-16-generic             1792  4096    8    0.10 0.609%     0.027       13.54   0.00000  0.00000    16

    Here is a non-RAID 1 partition:

    Non-RAID 2TB 64MB WD

                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1  119.20 33.15%     0.032      240.85   0.00000  0.00000   360
    2.6.27-16-generic             1792  4096    2  109.59 65.63%     0.069      802.35   0.00000  0.00000   167
    2.6.27-16-generic             1792  4096    4  112.27 122.8%     0.127      659.32   0.00000  0.00000    91
    2.6.27-16-generic             1792  4096    8  110.35 234.3%     0.270      952.49   0.00000  0.00000    47

    Random Reads
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1    2.30 1.236%     1.697      419.69   0.00000  0.00000   186
    2.6.27-16-generic             1792  4096    2    2.03 2.395%     3.469      903.90   0.00000  0.00000    85
    2.6.27-16-generic             1792  4096    4    1.63 3.803%     6.019     2352.58   0.05000  0.00000    43
    2.6.27-16-generic             1792  4096    8    1.57 7.796%    14.564     2342.62   0.17500  0.00000    20

    Sequential Writes
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1   55.37 62.93%     0.068     2175.37   0.00022  0.00000    88
    2.6.27-16-generic             1792  4096    2   61.63 158.7%     0.119     3028.74   0.00044  0.00000    39
    2.6.27-16-generic             1792  4096    4   62.15 338.7%     0.223     3053.16   0.00174  0.00000    18
    2.6.27-16-generic             1792  4096    8   62.34 757.1%     0.434     2561.85   0.00153  0.00000     8

    Random Writes
                                  File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
    Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
    ---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
    2.6.27-16-generic             1792  4096    1    1.42 1.093%     0.017        0.07   0.00000  0.00000   130
    2.6.27-16-generic             1792  4096    2    1.32 1.927%     0.018        0.16   0.00000  0.00000    69
    2.6.27-16-generic             1792  4096    4    1.06 3.132%     0.020        0.12   0.00000  0.00000    34
    2.6.27-16-generic             1792  4096    8    1.26 9.106%     0.028       13.84   0.00000  0.00000    14

    Conclusion

    On average RAID 1 does increase sequential read speeds by 50%.  It also decreases sequential write speeds by more than 50% as well, which is obviously bad.

    Random Writes suffer big time, .11MB/sec vs 1.42MB/sec.

    RAID 1 is great where read performance is important, but write performance is severely affected. 


  • RAID 5 doomed in 2009?


    http://www.tomshardware.com/news/RAID-5-Doomed-2009,6525.html

    I found this article interesting, it basically says that with 2TB hard drives or larger sizes, you are more likely to encounter an unrecoverable read error.  But is this just another Y2K doomsday?  Don't HDD's have enough advanced hardware ECC error and read recovery to prevent this from happening?

    I'm almost tempted to build a 3 x 2TB RAID 5 array and pull one drive out and rebuild to see what happens.  I do agree with larger sizes, you have a more likely risk of failure and uncoverable RAID 5 arrays though.


  • Realtek r8169 1gbit/1000mbit NIC/Ethernet Goes Down/Halts on Large File Transfer/Heavy Network Usage


    This is obviously a bug in the r8169 kernel module and it seems to affect a lot of people.  I upgraded to the latest kernel and hope this won't happen anymore, as it is a very serious error.  This is especially serious for those who are running servers with this chipset, who can afford for the NIC to randomly go off-line for no apparent reason?

     

    [655548.189113] type=1505 audit(1277067560.902:5): operation="profile_load" name="/usr/bin/freshclam" name2="default" pid=31671
    [701564.988039] ------------[ cut here ]------------
    [701564.988055] WARNING: at /build/buildd/linux-2.6.27/net/sched/sch_generic.c:219 dev_watchdog+0x21a/0x230()
    [701564.988062] NETDEV WATCHDOG: eth0 (r8169): transmit timed out
    [701564.988067] Modules linked in: nls_cp437 cifs sha256_generic aes_i586 aes_generic cbc isofs udf crc_itu_t sr_mod cdrom usb_storage libusual i915 drm binfmt_misc bridge stp bnep rfcomm sco l2cap bluetooth vboxdrv ppdev cpufreq_userspace cpufreq_conservative cpufreq_stats cpufreq_powersave cpufreq_ondemand freq_table pci_slot sbs sbshc video output ac wmi container battery ipv6 iptable_filter ip_tables x_tables dm_crypt crypto_blkcipher lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy evdev snd_seq_oss snd_seq_midi psmouse snd_rawmidi serio_raw snd_seq_midi_event parport_pc parport snd_seq snd_timer snd_seq_device snd button pcspkr iTCO_wdt iTCO_vendor_support soundcore snd_page_alloc intel_agp agpgart shpchp pci_hotplug ext3 jbd mbcache sd_mod crc_t10dif sg ata_piix pata_acpi ata_generic libata scsi_mod dock r8169 ehci_hcd mii uhci_hcd usbcore raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear md_mod thermal processor fan fbcon tileblit font bitblit softcursor fuse dm_raid4_5 dm_region_hash dm_mem_cache dm_message dm_mirror dm_log dm_mod
    [701564.988291] Pid: 0, comm: swapper Not tainted 2.6.27-16-generic #1
    [701564.988298]  [<c0132f05>] warn_slowpath+0x65/0x90
    [701564.988315]  [<c0125b8a>] ? enqueue_entity+0xda/0x2f0
    [701564.988325]  [<c012b758>] ? enqueue_task_fair+0x48/0x50
    [701564.988340]  [<c0122057>] ? enqueue_task+0x57/0x70
    [701564.988350]  [<c012c60e>] ? try_to_wake_up+0xde/0x290
    [701564.988361]  [<c0119e48>] ? read_hpet+0x8/0x20
    [701564.988371]  [<c014fedb>] ? getnstimeofday+0x5b/0x120
    [701564.988383]  [<c0137b16>] ? set_normalized_timespec+0x16/0x90
    [701564.988392]  [<c0155687>] ? timer_stats_update_stats+0x17/0x250
    [701564.988403]  [<c02564d9>] ? strlen+0x9/0x20
    [701564.988412]  [<c025455d>] ? strlcpy+0x1d/0x60
    [701564.988422]  [<c02f3557>] ? netdev_drivername+0x37/0x40
    [701564.988432]  [<c03087da>] dev_watchdog+0x21a/0x230
    [701564.988441]  [<c0145086>] ? __queue_work+0x36/0x50
    [701564.988451]  [<c013d128>] run_timer_softirq+0x138/0x210
    [701564.988460]  [<c03085c0>] ? dev_watchdog+0x0/0x230
    [701564.988468]  [<c03085c0>] ? dev_watchdog+0x0/0x230
    [701564.988477]  [<c0138822>] __do_softirq+0x92/0x120
    [701564.988485]  [<c013890d>] do_softirq+0x5d/0x60
    [701564.988493]  [<c0138a85>] irq_exit+0x55/0x90
    [701564.988505]  [<c01141cd>] smp_apic_timer_interrupt+0x5d/0x90
    [701564.988514]  [<c01050f8>] apic_timer_interrupt+0x28/0x30
    [701564.988528]  [<c010acda>] ? mwait_idle+0x4a/0x50
    [701564.988536]  [<c010288d>] cpu_idle+0x7d/0x140
    [701564.988544]  [<c037d781>] start_secondary+0x9d/0xcc
    [701564.988558]  =======================
    [701564.988563] ---[ end trace b699db82d00423f1 ]---
    [701565.005988] r8169: eth0: link up


  • Linux Burn MP3 CD On the Fly using "mp3burn"


    I finally decided to look into some utils that did this, and the first one I found is "mp3burn".  It is unbelievable simple and perfect.

    Just install the package and it gets all required libraries to convert and then burn's on the fly.  And you won't believe how simple it is.

    I just want to a directory that had the MP3's I wanted to burn to an audio CD and typed "mp3burn *"

    As you can see below, it detected my DVD burner and did the rest, it couldn't have been quicker or simpler.  This is one amazing utility that impressed me.  The author really thought things out here.

     

    ~/newsongs$ mp3burn *
    wodim: No write mode specified.
    wodim: Asuming -tao mode.
    wodim: Future versions of wodim may have different drive dependent defaults.
    wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limits.Device was not specified. Trying to find an appropriate drive...
    Detected CD-R drive: /dev/cdrw
    Using /dev/cdrom of unknown capabilities
    Device type    : Removable CD-ROM
    Version        : 0
    Response Format: 2
    Capabilities   :
    Vendor_info    : 'TSSTcorp'
    Identification : 'CDDVDW SH-S223F '
    Revision       : 'SB02'
    Device seems to be: Generic mmc2 DVD-R/DVD-RW.
    Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
    Driver flags   : MMC-3 SWABAUDIO BURNFREE
    Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
    Speed set to 8468 KB/s
    Starting to write CD/DVD at speed  48.0 in real TAO mode for single session.
    Last chance to quit, starting real write in    0 seconds. Operation starts.

    WARNING: padding up to secsize.
    Track 01: Total bytes read/written: 38979072/38979696 (16573 sectors).

    WARNING: padding up to secsize.
    Track 02: Total bytes read/written: 42149376/42150192 (17921 sectors).

    WARNING: padding up to secsize.
    Track 03: Total bytes read/written: 31237632/31239264 (13282 sectors).

    WARNING: padding up to secsize.
    Track 04: Total bytes read/written: 41107968/41108256 (17478 sectors).

    WARNING: padding up to secsize.
    Track 05: Total bytes read/written: 58945536/58945824 (25062 sectors).

    WARNING: padding up to secsize.
    Track 06: Total bytes read/written: 42398208/42399504 (18027 sectors).

    WARNING: padding up to secsize.
    Track 07: Total bytes read/written: 47660544/47660928 (20264 sectors).

    WARNING: padding up to secsize.
    Track 08: Total bytes read/written: 38827008/38829168 (16509 sectors).

    WARNING: padding up to secsize.
    Track 09: Total bytes read/written: 44587008/44589216 (18958 sectors).

    WARNING: padding up to secsize.
    Track 10: Total bytes read/written: 48628224/48629952 (20676 sectors).

    WARNING: padding up to secsize.
    Track 11: Total bytes read/written: 47983104/47983152 (20401 sectors).

    WARNING: padding up to secsize.
    Track 12: Total bytes read/written: 38544384/38544576 (16388 sectors).

    WARNING: padding up to secsize.
    Track 13: Total bytes read/written: 39421440/39421872 (16761 sectors).

    WARNING: padding up to secsize.
    Track 14: Total bytes read/written: 38181888/38182368 (16234 sectors).

    WARNING: padding up to secsize.
    Track 15: Total bytes read/written: 46476288/46477872 (19761 sectors).

    WARNING: padding up to secsize.
    Track 16: Total bytes read/written: 39241728/39243120 (16685 sectors).

    WARNING: padding up to secsize.
    Track 17: Total bytes read/written: 48815616/48815760 (20755 sectors).
    cleaning up children: 9097 9101 9105 9109 9113 9117 9121 9125 9129 9133 9137 9141 9145 9149 9153 9157 9161


  • mdadm "auto-read-only" Linux Software RAID solution


    If you have the "(auto-read-only)" beside an array I have no idea why that happens but it is easy to fix.

    Just run "mdadm --readwrite /dev/md1" (rename md0 to the device with the problem and it will begin to resync.

     

    md1 : active (auto-read-only) raid1 sdb2[0] sda2[1]
          19534976 blocks [2/2] [UU]
            resync=PENDING
         
    md0 : active raid1 sda1[2] sdb1[0]
          488287488 blocks [2/1] [U_]
          [>....................]  recovery =  1.9% (9341504/488287488) finish=302.1min speed=26421K/sec
         
    unused devices: <none>
    # cat /proc/mdstat
    # mdadm --readwrite /dev/md1
    # cat /proc/mdstat         
    Personalities : [raid1]
    md1 : active raid1 sdb2[0] sda2[1]
          19534976 blocks [2/2] [UU]
            resync=DELAYED
    md0 : active raid1 sda1[2] sdb1[0]
          488287488 blocks [2/1] [U_]
          [>....................]  recovery =  1.9% (9677184/488287488) finish=302.5min speed=26368K/sec
         
    unused devices: <none>


  • mdadm when a RAID 1 member dies


    [27969.398749] sd 5:0:0:0: [sdb] 3907029168 512-byte hardware sectors (2000399 MB)
    [27969.398749] sd 5:0:0:0: [sdb] Write Protect is off
    [27969.398749] sd 5:0:0:0: [sdb] Mode Sense: 00 3a 00 00
    [27969.398749] sd 5:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [27972.117543] ata6.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
    [27972.117543] ata6.00: irq_stat 0x48000000
    [27972.117543] ata6.00: cmd 60/08:00:ff:71:79/00:00:07:00:00/40 tag 0 ncq 4096 in
    [27972.117543]          res 41/40:00:00:72:79/24:00:07:00:00/40 Emask 0x409 (media error) <F>
    [27972.117543] ata6.00: status: { DRDY ERR }
    [27972.117543] ata6.00: error: { UNC }
    [27972.126765] ata6.00: configured for UDMA/133
    [27972.126765] ata6: EH complete
    [27972.126765] sd 5:0:0:0: [sdb] 3907029168 512-byte hardware sectors (2000399 MB)
    [27972.126765] sd 5:0:0:0: [sdb] Write Protect is off
    [27972.126765] sd 5:0:0:0: [sdb] Mode Sense: 00 3a 00 00
    [27972.126765] sd 5:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [27975.172076] ata6.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
    [27975.172076] ata6.00: irq_stat 0x48000000
    [27975.172076] ata6.00: cmd 60/08:00:ff:71:79/00:00:07:00:00/40 tag 0 ncq 4096 in
    [27975.172076]          res 41/40:00:00:72:79/24:00:07:00:00/40 Emask 0x409 (media error) <F>
    [27975.172076] ata6.00: status: { DRDY ERR }
    [27975.172076] ata6.00: error: { UNC }
    [27975.181327] ata6.00: configured for UDMA/133
    [27975.181327] ata6: EH complete
    [27975.186757] sd 5:0:0:0: [sdb] 3907029168 512-byte hardware sectors (2000399 MB)
    [27975.186757] sd 5:0:0:0: [sdb] Write Protect is off
    [27975.186757] sd 5:0:0:0: [sdb] Mode Sense: 00 3a 00 00
    [27975.186757] sd 5:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [27977.659491] ata6.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
    [27977.659491] ata6.00: irq_stat 0x48000000
    [27977.659491] ata6.00: cmd 60/08:00:ff:71:79/00:00:07:00:00/40 tag 0 ncq 4096 in
    [27977.659491]          res 41/40:00:00:72:79/24:00:07:00:00/40 Emask 0x409 (media error) <F>
    [27977.659491] ata6.00: status: { DRDY ERR }
    [27977.659491] ata6.00: error: { UNC }
    [27977.852642] ata6.00: configured for UDMA/133
    [27977.852642] ata6: EH complete
    [27977.854748] sd 5:0:0:0: [sdb] 3907029168 512-byte hardware sectors (2000399 MB)
    [27977.854748] sd 5:0:0:0: [sdb] Write Protect is off
    [27977.854748] sd 5:0:0:0: [sdb] Mode Sense: 00 3a 00 00
    [27977.854748] sd 5:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [27980.573764] ata6.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
    [27980.573764] ata6.00: irq_stat 0x48000000
    [27980.573764] ata6.00: cmd 60/08:00:ff:71:79/00:00:07:00:00/40 tag 0 ncq 4096 in
    [27980.573764]          res 41/40:00:00:72:79/24:00:07:00:00/40 Emask 0x409 (media error) <F>
    [27980.573764] ata6.00: status: { DRDY ERR }
    [27980.573764] ata6.00: error: { UNC }
    [27980.583204] ata6.00: configured for UDMA/133
    [27980.583204] sd 5:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK
    [27980.583204] sd 5:0:0:0: [sdb] Sense Key : Medium Error [current] [descriptor]
    [27980.583204] Descriptor sense data with sense descriptors (in hex):
    [27980.583204]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
    [27980.583204]         07 79 72 00
    [27980.583204] sd 5:0:0:0: [sdb] Add. Sense: Unrecovered read error - auto reallocate failed
    [27980.583204] end_request: I/O error, dev sdb, sector 125399552
    [27980.583204] ata6: EH complete
    [27980.583204] raid1: sdb: unrecoverable I/O read error for block 125399424
    [27980.583204] sd 5:0:0:0: [sdb] 3907029168 512-byte hardware sectors (2000399 MB)
    [27980.583204] sd 5:0:0:0: [sdb] Write Protect is off
    [27980.583204] sd 5:0:0:0: [sdb] Mode Sense: 00 3a 00 00
    [27980.583204] sd 5:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [27981.086035] md: md0: recovery done.

    md0 : active raid1 sda1[2] sdb1[0]
          488287488 blocks [2/1] [U_]
          [==>..................]  recovery = 12.8% (62687872/488287488) finish=269546.4min speed=24K/sec
         
    unused devices: <none>
    # mdadm --fail /dev/sdb1
    mdadm: /dev/sdb1 does not appear to be an md device
    # mdadm --fail /dev/sdb1
    # mdadm --manage /dev/md0 --fail /dev/sdb1
    mdadm --manage /dev/md0 --fail /dev/sdb1
    mdadm: set /dev/sdb1 faulty in /dev/md0
     


  • Linux looking for a way to convert XLS/Excel Spreadsheets into Plain Text?


    catdoc.i386 : Decodes MS Word files into plain text or TeX format

    I haven't figured out how to use it, it is really not clear or obvious but it should do the job if you can figure it out.

    Usage:
     catdoc [-vu8btawxlV] [-m number] [-s charset] [-d charset] [ -f format] files


  • mencoder Linux CLI video editing how to encode video file into xvid and split by time into multiple parts


    Mencoder is great, you can throw anything at it, including video files from your camera and have it encode into xvid or almost any other format.

    In my case I took 640x480 video from my Canon and reduced the size by 1/3 with the options below (there are many other options that you can read about in the manual but I like to keep it simple). 

    Mencoder Encode

    mencoder <filename.avi> -ovc xvid -oac mp3lame -xvidencopts fixed_quant=4 -o <output.avi>

    Mencoder Split

    Split the first 9 minutes of video into a part

    mencoder -endpos 00:09:00 -ovc copy -oac copy inputfile.xvid -o outputfile.xvid

    *We're kind of cheating because without specifying "-ss" (the start position) it defaults to starting at the beginning which would be the same as "-ss 00:00:00"

    Note that we don't need the -ss (start time) flag because we are taking the first 9 minutes of the video.  It gets a little tricky (and this is not well documented or known by some) when you want to take a portion of videon in the middle (meaning not the first x minutes and not the last x minutes).

    Split 9 minutes of video starting from the 9 minute point

    This is where I consider mencoder to be unintuitive, here is the code I was using and lots would ask "why is mencoder ignoring the endpos"?  It actually isn't, what you thought you were telling mencoder is different than what is actually happening.

    Take this code for example:

    mencoder -ss 00:09:00 -endpos 00:18:00 -ovc copy -oac copy inputfile.xvid -o outputfile.xvid

    At first I assumed this means "start at 9 minutes" and "end at 18 minutes".  Actually it means "start at 9 minutes" and "end at 27 minutes".  In other words "endpos" doesn't work as I believe it should and here's why from the mencoder manual:

      -endpos <[[hh:]mm:]ss[.ms]|size[b|kb|mb]> (also see -ss and -sb)
                  Stop at given time or byte position.
                  NOTE: Byte position is enabled only for MEncoder and will not be accurate, as it  can  only  stop  at  a
                  frame  boundary.   When  used in conjunction with -ss option, -endpos time will shift forward by seconds
                  specified with -ss.

    So what the manual means is that endpos is relative to ss.  That means if you say you "start at 5 minutes" and "end at 9 minutes", you're actually saying 5 minutes + 9 minutes = end at 14 minutes.   So you can see that mencoder isn't ignoring you, it just takes the start position and adds the end position value and that is what ultimately becomes the endpos.  I don't agree with that, mencoder is a great tool but I think this stumps a lot of people because it doesn't make sense.

    Split 9 minutes of video from the end

    mencoder -ss 00:18:00 -ovc copy -oac copy inputfile.xvid -o outputfile.xvid

    *This is cheating again by just specifying the start, it will take everything from the start point until the video finishes.

    In essence you're specifying "-endpos 00:27:00" assuming the movie ends at 27 minutes, but you get the idea.


  • md: kicking non-fresh sda1 from array! - fix/solution



    md: Autodetecting RAID arrays.
    md: autorun ...
    md: considering sdb1 ...
    md:  adding sdb1 ...
    md:  adding sda1 ...
    md: created md0
    md: bind<sda1>
    md: bind<sdb1>
    md: running: <sdb1><sda1>
    md: kicking non-fresh sda1 from array!
    md: unbind<sda1>
    md: export_rdev(sda1)
    raid1: raid set md0 active with 1 out of 2 mirrors

    The md0 raid kicked sda1 out because either I never synced it before rebooting or it was "halted" because md1 was rebuilding.

    The solution is just to add it to the array so it will sync

    mdadm --manage /dev/md0 --add /dev/sda1

    After it syncs you'll see it shows both disks as active and up:

    md0 : active raid1 sdb1[0] sda1[1]
          307202816 blocks [2/2] [UU]

    As you can see below, md1 was just fine:


    md: autorun ...
    md: considering sda1 ...
    md:  adding sda1 ...
    md: md0 already running, cannot run sda1
    md: export_rdev(sda1)
    md: ... autorun DONE.
    md: md1 stopped.
    md: bind<sda2>
    md: bind<sdb2>
    raid1: raid set md1 active with 2 out of 2 mirrors


  • After installation Directadmin does not work directadmin dead but pid file exists on OpenVZ VPS when browsing http://ip.ip.ip.ip:2222


    After installation Directadmin does not work on OpenVZ VPS when browsing http://ip.ip.ip.ip:2222


    service directadmin status
    directadmin dead but pid file exists

    tail /var/log/directadmin/error.log

    Check the value of your ethernet_dev=eth0 setting in your /usr/local/directadmin/conf/directadmin.conf file and the output of /sbin/ifconfig<br>

    2010:07:10-12:44:01: ioctl can't find the server's ip address for eth0 : No such device
    2010:07:10-12:44:02: The ip of this machine () does not match the ip in the license file.<br>
    Check the value of your ethernet_dev=eth0 setting in your /usr/local/directadmin/conf/directadmin.conf file and the output of /sbin/ifconfig<br>

    2010:07:10-12:44:11: ioctl can't find the server's ip address for eth0 : No such device
    2010:07:10-12:44:12: The ip of this machine () does not match the ip in the license file.<br>
    Check the value of your ethernet_dev=eth0 setting in your /usr/local/directadmin/conf/directadmin.conf file and the output of /sbin/ifconfig<br>

    Edit: /usr/local/directadmin/conf/directadmin.conf

    replace ethernet_dev=eth0

    with ethernet_dev=venet0:0
     


  • exim high load and dozens of processes


    This server was experiencing loads of up to 80 and maxing out the RAM and kmemsize on a CPanel VPS.  There were literally dozens if not hundreds of exim processes.  I have no idea why exim has such a design that would allow it to consume this much CPU and RAM.  Any normal MTA should not be spawning so many processes, it should be processing them in sequence and if it is going to spawn hundreds of processes in response to a large volume of mail, it's better to have a delayed delivery than a crash etc..

    The following settings in exim.conf are what fixed it (and should be the default to avoid a DOS effect), I never observed more than two exim proceses or a load about 1.57 after setting that and restarting Exim.

    The true culprit of the high load were thousands of e-mails being sent without a recipient/to field from a form based contact script though.

    Solution Fix is to set the following in exim.conf and restart

    deliver_queue_load_max = 3
    queue_only = true
    queue_only_load = 3
    queue_run_in_order = true

     


  • jailkit for chroot ssh account security tutorial and fix for error


    This was done on Centos but I think it's easier on Debian machines, the paths that it is set to use are tailored towards Debian, so there is some fiddling that needs to be done on Centos.

    This is for chrooting ssh, but jailkit has other uses than just SSH jails but I won't cover them in this writeup.

    1. Install jailkit

    yum install jailkit

    2. Setup Jail Home

    mkdir /home/jail
    chown root:root /home/jail

    3. Enable Jailed Programs For Your Users

    jk_init -v -j /home/jail basicshell editors extendedshell netutils ssh sftp scp

    You'll see a lot of text scrolling, basically it is copying all the executables and their dependencies to the chroot environment.

    For more specialized setups/extra programs you can edit /etc/jailkit/jk_init.ini to enable or add more programs.

    4. Enable the Jail on an Existing User

    jk_jailuser -m -j /home/jail "testguy"


    invalid shell, /home/jail/usr/sbin/jk_lsh does not exist
    enter jail directory:

    Fix the error with the following:

    You need to copy "jk_lsh" and should have done it from the start (bad documentation)

    jk_init -v -j /home/jail jk_lsh

     Now you can add whatever use you want to the jail.

    And just to confirm notice the changed /etc/passwd entry for testguy:

    testguy:x:500:500::/home/jail/./home/testguy:/usr/sbin/jk_chrootsh

    5. Finalize Settings

    Set the shell you want for your user in /home/jail/etc/passwd

    root:x:0:0:root:/root:/bin/bash
    testguy:x:500:500::/home/testguy:/usr/sbin/jk_lsh

    I don't know why "root" is there, I deleted that line.  I also changed the shell for testguy to bash, and so my new file looks like:

    testguy:x:500:500::/home/testguy:/bin/bash

     


  • OpenVZ iptables v1.3.5: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. Solution


    This error is annoying, in a Virtuozzo KB entry about this ip tables nat problem they say the kernel needs to be ugpraded:

    Symptoms

    The node runs 2.6.18-x kernel older than 2.6.18-028stab053.10.
    NAT module does not work in container, you get "can't initialize iptables table 'nat'" error:

    # iptables  -t nat  -L -n
    iptables v1.2.11: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.

    Resolution

    Upgrade your kernel to the latest version (see http://kb.parallels.com/en/4004).

    The problem is that I do have the latest kernel!

    This is the latest VZ kernel from July:

    Linux test.chi 2.6.18-194.8.1.el5.028stab070.2PAE #1 SMP Tue Jul 6 15:30:49 MSD 2010 i686 i686 i386 GNU/Linux

    iptables v1.3.5: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
    Perhaps iptables or your kernel needs to be upgraded.

     

     The real solution - manually load "iptable_nat" in the conf

    I always read that the modules specified in /etc/sysconfig/iptables-config and /etc/vz/vz.conf are the modules that get loaded by default into all the containers...........but this is not true. "Modules you defined will be available for all Containers", no that wasn't the case for me.  I had to manually specify it for my container before it worked.

    You have to explicitly tell each container what iptables modules it can have.

    *Actually this is not true, if you get errors saying "X Module cannot be found", it means you have a mistake or linebreak in your vz.conf for IPTABLES.  Just fix it and then you'll be good.  What was I thinking, questioning Parallels?


  • OpenVZ/vzctl how to do an on-line migration without downtime


    vzmigrate --online dest-host VEIDNO
    
    eg.: 
    
    vzmigrate --oneline 192.168.1.55 101
    

    One option I would recommend is "--keep-dst", that way if the migration is interrupted you can still bring the VPS back up on the original host.  After the migration is successful you can manually destroy it.

    OpenVZ has a good writeup on this including Checkpointing and Restoring etc: http://wiki.openvz.org/Checkpointing_and_live_migration


  • How to Enable SMART on a device


    smartctl -a -d ata -T permissive --smart=on /dev/sda

    -d ata is usually required for most SATA drives or you get an error.

    -T permissive is required if it's the first time you are running SMART on this device (it's not enough just to enable SMART in the BIOS)

    --smart=on is also required for the first time


  • Shutdown/Power/Halt In Debian/Ubuntu/Centos Guide Systems Doesn't Work


    Different distributions such as Debian and Centos behave differently when trying to shutdown your system.

    shutdown -H now on Debian does not do what you'd expect.  The system won't power down, it will halt and do everything but power down.

    shutdown -PH now will do the job though (actually power the system off).  This is important to test especially if you are not near the system.  If you just use -P it forcefully shuts off which is not good since it won't stop the services or even unmount drives/arrays etc..

    For Centos 5.5 here is how you power down

    shutdown -hP now

    Broadcast message from root (pts/0) (Wed Aug 25 02:04:08 2010):
    The system is going down for system halt NOW!

     


  • GNOME/Ubuntu how to navigate without a keyboard


    The most basic is the start menu, which is accessed with Alt+F1


  • Ubuntu 10.04 Linux is still not ready for the Desktop world


    I am a huge fan of Linux and the idea of OpenSource but I've said it many times, there are still hurdles in today in 2010 for Linux as a Desktop.  Linux is still intended for servers at its very core.  This can be changed succesfully though, as Apple has shown us with Mac OS X based on FreeBSD.

    Half of the issue is lack of driver support and the other half is the Linux Kernel and Window Manages, KDE and GNome still both don't cut it (but they're getting closer).

    I'll give my complaints from the Ubuntu perspective since I believe it's one of the most polished OS's out there as far as Linux Desktop is concerned (I've tried many times to replace Windows as my Desktop but failed for many reasons).

    1.) Graphics performance is improved but graphics performance is sitll not as good and reliable as Windows.  Linux at the kernel level needs to be thought out better.  Proprietary drivers should be easy to install, as simple as something like a .dll for Windows.  There is still no central way of modifying xorg.conf and it is something I am not comfortable doing.

    In Ubuntu I'm shocked that at least by default there is no graphics setings installed!  This is a basic and essential feature, it's not nice to have.

    As usual drivers from ATI and NVIDIA just don't work, or at least not well.  I have manually installed the Catalyst drivers and they won't work, when using the Ubuntu supplied ones the screen becomes garbled.

    2.) Linux just doesn't have enough good software, nothing comparable to Windows.  If there could be a standard Linux API that applies to all software and GUI based applications, then we would see far more support from software developers.  Right now Linux is just a hobbyists OS/server OS and

    There are a lots of "nice" projects with "potential" but even for media players nothing cuts it.  I am used to using Winamp in Windows for MP3s, I tried using QMMP (I believe the replacement for Amarok which is similar to Winamp) and it just isn't polished.  You can't even drag in MP3s into it like Winamp can.

    In fact Winamp generally works better than any other MP3 player for Linux, and it still works fairly well using Wine (but not perfectly.

    I tried Rhythmbox but eventually it segfaulted and won't startup, again Rhythmbox doesn't support dragging files into it.

    3.) There is no Roboform equivalent that works as well, and Roboform arrogantly insists that they have no intention of doing this despite the interest.

    4.) Change is bad, everything needs to be backwards compatible.  I don't know how to explain it, but the way Linux works just does not make sense for a Desktop, the other problem is that the OpenSource coders are the ones making the GUI and interface decisions, and even coming from a programming perspective I still find Linux (better) but frustrating and mundane to use.

    There are some goodpoints, I find a lot of things work more fluidly such as the ability to mount remote SSH filesystems and work with them from Nautilus etc...

    Linux has the potential, but that's been there for well over a decade and things have improved but I don't think it will ever get to the Windows or Mac level until someone creates a more proprietary Linux or if Linux makes standard APIs for software and drivers which make it easy to include drivers.

    That's the other thing, so many things need to be compiled such as drivers and this needs to be done with each kernel update.


  • VirtualBox OSE/VBOX Can't Access Shared Folder Solution


    I shared a directory on my hostnode/local system (running Ubuntu 10.04) with my Guest system running Windows XP.  I have no idea why it's not mentioned or documented in an obvious way, but in the Windows client you just access it with "\Vboxsvr"

    Once you access that share you'll have access to all of the VBOX shares on your local host.  I think it should indicate it somewhere when you enable the sharing.  Yes, I'm sure it's buried somewhere pages deep in a wiki and I believe I found the answer first on a Ubuntu forum.


  • VirtualBox/VBOX Centos 5.5 Installation Kernel Freeze Problem "NET: Registered protocol family 2" And Solution


    NET: Registered protocol family 2

    The above is the last thing that I ever saw, I tried pci=routeirq etc.. and it wouldn't work.

    The solution is to enable IOAPIC in the VBOX Settings

    Just enable "IOAPIC" in the settings for your Centos Guest and you'll find the kernel boots just fine.  I wonder if a physical system might stall in this same way if the BIOS has IOAPIC disabled which many people do as a troubleshooting method.

     


  • Linux Kernel Freeze/Hang during boot on io scheduler cfq registered (default)


    You'll see the following and the boot process will freeze:

    io scheduler noop registered

    io scheduler anticipatory registered
    io scheduler deadline registered
    io scheduler cfq registered (default)

    I have struggled with this issue on various systems using all sorts of kernels, kernels where the issue should be "fixed".  As far as I can recall through debugging, this is a hang during pci_init.

    It's beyond me why such a critical thing could happen and has not been fixed. 

    Some Common Solutions (but don't work in many cases)

    1. Add kernel parameter "pci=noacpi" and/or disable ACPI in BIOS
    2. Add kernel paremeter "noapic" and/or disable IOAPIC in BIOS
    3. Add kernel parameters "i915.modeset=0 xforcevesa radeon.modeset=0 noswap nomodeset acpi=off irqpoll noapic noapm nodma nomce nolapic nosmp ip=frommedia vga=normal nosplash"

     


  • Linux Kernel Boot Black Screen of Death Freeze/Halt Solution


    This happens on some systems due to a video issue with Intel Videocards, after you see the kernel load you may see almost immediately that you get a black screen.

    The following kernel parameters usually solve it:

    nomodeset i915.modeset=0 xforcevesa

    some people just use "nomodeset" and others use "i915.modeset=0".  I think nomodeset may also do the same for each video driver so it may imply i915.modeset=0 anyway but I am not sure.


  • Solution - error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory


    error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory

    Solution Install gd:

    yum install gd

    After that whatever you are compliing should be happy.


  • Ubuntu Linux HTML Rendering left bracket < problem appears as 003C box


    In Ubuntu when quoting in a forum that would include a left < bracket it often appears garbled as a box with 003C inside.

    Also with phpbb anything inside the "code" field appears garbled and as gibberish.

    For some reason I can't find anyone else complaining about this and have not found a solution for it, but it's very annoying.


  • DirectAdmin Install Webalizer Stats


    I can't believe it comes without any sort of stats built-in and they don't make it easy to find out how to integrate it.

    I downloaded the following:

    wget -O /usr/bin/webalizer http://files.directadmin.com/services/es_5.3/webalizer

    chmod 755 /usr/bin/webalizer

    echo "action=tally&value=all" >> /usr/local/directadmin/data/task.queue


  • OpenOffice Writer Default Paragraph Annoyance


    I'm not impressed with OpenOffice writer, it can't beat Office XP still and speaking of that, after all these years, Wine still can't run Office XP Properly.

    Back to the OpenOffice issue though, it likes to default paragraphs like this:


     

    This is an OpenOffice Annoyance Example
          See this indentation.  It can be changed but I don't see a way to default it back to the normal!

     

     


  • Openvz Live Migration Error - Error: undump failed: Invalid argument Restoring failed: Error: iptables-restore exited with 2 Error: Most probably some iptables modules are not loaded Error: rst_restore_net: -22


    Adding IP address(es): 192.168.5.8 192.168.5.9
    Setting CPU units: 1000
    Error: undump failed: Invalid argument
    Restoring failed:
    Error: iptables-restore exited with 2
    Error: Most probably some iptables modules are not loaded
    Error: rst_restore_net: -22
    Container start failed
    Stopping container ...
    Container was stopped
    Container is unmounted
    Error:  Failed to undump VE
    Resuming...
    vzquota : (error) Quota is not running for id 5555

    Solution

    Compare our iptables-config "modules" and vz "iptables modules" between the two nodes.  Basically it means the destination node does not have the required iptables modules that the source container wants to use.  Correct this, restart the destination VZ and IPTables and the issue will be resolved.


  • Installing Virtualbox on Centos 5.5


    wget http://download.virtualbox.org/virtualbox/3.2.8/VirtualBox-3.2-3.2.8_64453_rhel5-1.i386.rpm
    rpm -i http://download.virtualbox.org/virtualbox/3.2.8/VirtualBox-3.2-3.2.8_64453_rhel5-1.i386.rpm


    error: Failed dependencies:
        libGLU.so.1 is needed by VirtualBox-3.2-3.2.8_64453_rhel5-1.i386
        libSDL-1.2.so.0 is needed by VirtualBox-3.2-3.2.8_64453_rhel5-1.i386
        libXmu.so.6 is needed by VirtualBox-3.2-3.2.8_64453_rhel5-1.i386



    yum install mesa-libGLU SDL libXmu
    rpm -i http://download.virtualbox.org/virtualbox/3.2.8/VirtualBox-3.2-3.2.8_64453_rhel5-1.i386.rpm

    warning: VirtualBox-3.2-3.2.8_64453_rhel5-1.i386.rpm: Header V4 DSA signature: NOKEY, key ID 98ab5139
    Preparing...                ########################################### [100%]
       1:VirtualBox-3.2         ########################################### [100%]

    Creating group 'vboxusers'. VM users must be member of that group!

    No precompiled module for this kernel found -- trying to build one. Messages
    emitted during module compilation will be logged to /var/log/vbox-install.log.

    Compilation of the kernel module FAILED! VirtualBox will not start until this
    problem is fixed. Please consult /var/log/vbox-install.log to find out why the
    kernel module does not compile. Most probably the kernel sources are not found.
    Install them and execute

      /etc/init.d/vboxdrv setup

    as root.


    *We need our kernel source

    yum install kernel-devel

    /etc/init.d/vboxdrv setup

    *Oops it failed again, I didn't have GCC installed :)


  • VirtualBox Error Failed to start the virtual machine Centos 5.5 Mirror. Medium '/home/testuser/.VirtualBox/HardDisks/Centos 5.5 Mirror.vdi' is not accessible. UUID {a1a9fad7-0402-4867-b8f3-39fb49454bc5} of the medium '/home/testuser/.VirtualBox/HardD


    Virtualbox Error

    I tried to copy a .vdi of one container to use in another one, basically to clone instead of having to install the OS again.

    Failed to start the virtual machine Centos 5.5 Mirror.
    Medium '/home/testuser/.VirtualBox/HardDisks/Centos 5.5 Mirror.vdi' is not accessible. UUID {a1a9fad7-0402-4867-b8f3-39fb49454bc5} of the medium '/home/testuser/.VirtualBox/HardDisks/Centos 5.5 Mirror.vdi' does not match the value {4945a0e8-0ed5-4736-9088-bcaf7b9d07f1} stored in the media registry ('/home/testuser/.VirtualBox/VirtualBox.xml').
    Method GetVRDPServer is not implemented.


    This command gives it a new UUID, but that's not the problem, I get the same message as above.  VBOX has a certain UUID associated with this .vdi name stored an .xml file

    vboxmanage internalcommands sethduuid "Centos 5.5 Mirror.vdi"

    Sun VirtualBox Command Line Management Interface Version 3.1.6_OSE
    (C) 2005-2010 Sun Microsystems, Inc.
    All rights reserved.

    UUID changed to: bd57d074-a562-4712-bf44-892441215720


    The final solution was to go to "File -> Virtual Media Manager" find the .vdi and click "Remove", then add it back to the Virtual Media and choose it as the boot device for your Virtual Machine.
     


  • HeartBeat Error/High Load heartbeat: [7120]: WARN: Gmain_timeout_dispatch: Dispatch function for retransmit request took too long to execute: 20 ms (> 10 ms) (GSource: 0x926b390)


    My LOG is flooded with those messages many times per second.

    I don't know what is wrong with heartbeat, but restarting the service fixed it.


  • mdadm Linux Software RAID QuickStart Guide


     

    Create New RAID 1 Array:

    First setup your partitions (make sure they are exactly the same size)
    In my example I have sda3 and sdb3 which are 500GB in size.

    mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
    mdadm: array /dev/md2 started.

    Check Status Of The Array

    *Note I already have other arrays md0 and md1.

    You can see below that md2 is syncing at a speed of about 91MB per sec.

    cat /proc/mdstat


    Personalities : [raid1]
    md2 : active raid1 sdb3[1] sda3[0]
          488287552 blocks [2/2] [UU]
          [>....................]  resync =  0.5% (2460992/488287552) finish=88.8min speed=91147K/sec
         
    md1 : active raid1 sda2[0] sdb2[1]
          29302464 blocks [2/2] [UU]
         
    md0 : active raid1 sdb1[1] sda1[0]
          58604992 blocks [2/2] [UU]
         
    unused devices: <none>

    Check the basic details of an array:



    mdadm /dev/md0
    /dev/md0: 55.89GiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail.
    /dev/md0: No md super block found, not an md component.


    More Detail

    mdadm --detail /dev/md0

    /dev/md0:
            Version : 0.90
      Creation Time : Tue Aug 31 22:37:52 2010
         Raid Level : raid1
         Array Size : 58604992 (55.89 GiB 60.01 GB)
      Used Dev Size : 58604992 (55.89 GiB 60.01 GB)
       Raid Devices : 2
      Total Devices : 2
    Preferred Minor : 0
        Persistence : Superblock is persistent

        Update Time : Wed Sep  1 18:39:53 2010
              State : active
     Active Devices : 2
    Working Devices : 2
     Failed Devices : 0
      Spare Devices : 0

               UUID : 7b4e9a42:823c7ee5:0d6ee1b8:30df68a8
             Events : 0.7

        Number   Major   Minor   RaidDevice State
           0       8        1        0      active sync   /dev/sda1
           1       8       17        1      active sync   /dev/sdb1

    Update /etc/mdadm.conf File



    mdadm --brief --detail /dev/md0

    ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=7b4e9a42:823c7ee5:0d6ee1b8:30df68a8

    To edit the /etc/mdadm.conf file directly just run the command like this make sure to use the ">>" or you will wipe out any existing array info.

    mdadm --brief --detail /dev/md0 >> /etc/mdadm.conf

     


  • sed script to automatically update IPs in named/BIND and httpd/Apache


    Always make a backup of the original file before trying this, I find this kind of thing when updating IPs etc.. to use a script.

    Where the old IP is "192.168.5.8" and the new IP is "10.10.5.8"

    sed -i s/192.168.5.8/10.10.5.8/g testdomain.org.db

    The -i with sed means "inline" meaning we edit the file directly, but without the -i we could just use > and output the results to another file or do whatever else we wanted.

    Of course instead of it being a zone file, it could be an Apache VHOST just as easily.


  • How not to change an IP address in CPanel during a migration


    /usr/local/cpanel/bin/swapip <oldip> <newip> <ftpip> domain(s)

    It simply doesn't work, the Apache VHOSTS remain 100% unchanged, why does this script exist?   I'm sure it would work from the control panel but I am locked out because my IP was changed and it doesn't match the CPanel license.  I wish CPanel would make it easier to update the license IP.

    I even took it a step farther, I manually edited the vhosts and restarted Apache and it didn't work.

    I read someone to edit the info in /var/cpanel/users/username and /var/cpanel/userdata/username but that still did not work even with a full CPanel restart.

    The only way that actually works is to login into CPanel and use the "IP Migration" or "Change Multiple Sites IPs" and then it will be good.  This is a drawback compared to Directadmin's easy update script that works from the command line.


  • DRBD WFConnection Problem/Solution


    This has stumped me  a few times because I keep forgetting that Centos 5.5 comes with a default iptables configuration that ends up blocking DRBD traffic, I tried all the normal things and couldn't understand why I couldn't make my normal DRBD config work.  So if you have WFConnection problems and have tried the normal "mailing list" fixes, check your firewall status first!


    Both Nodes Say the Following:

    version: 8.3.8 (api:88/proto:86-94)
    GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:16
     0: cs:WFConnection ro:Secondary/Unknown ds:Diskless/DUnknown C r----
        ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0

    drbdadm primary r0

    0: State change failed: (-2) Need access to UpToDate data
    Command 'drbdsetup 0 primary' terminated with exit code 1

    drbdadm invalidate-remote r0

    0: State change failed: (-4) Can not resync without local disk
    Command 'drbdsetup 0 invalidate-remote' terminated with exit code 16

    Here's what I should have done:

    drbdadm create-md r0

    Writing meta data...
    initializing activity log
    NOT initialized bitmap
    New drbd meta data block successfully created.

    On both nodes:

    drbdadm attach r0
    drbdadm connect r0

    On Primary:

    drbdsetup /dev/drbd0 primary -o
     


  • Linux How To Add/Delete A Default Route/Gateway


    Remember to replace "eth0" with your NIC device although usually it will be eth0.

    Replace 192.168.1.1 with your default gateway, remember you can also add multiple gateways by adding a second/different default gateway.

    route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     *               255.255.255.0   U     1      0        0 eth0
    link-local      *               255.255.0.0     U     1000   0        0 eth0
    default         DD-WRT          0.0.0.0         UG    0      0        0 eth0

    route del default gw 192.168.1.1 eth0

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     *               255.255.255.0   U     1      0        0 eth0
    link-local      *               255.255.0.0     U     1000   0        0 eth0

    route add default gw 192.168.1.1 eth0

    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     *               255.255.255.0   U     1      0        0 eth0
    link-local      *               255.255.0.0     U     1000   0        0 eth0
    default         DD-WRT          0.0.0.0         UG    0      0        0 eth0


  • Subnet Mask Lengths / Quick Reference


    Subnet Mask Lengths / Quick Reference

    This is for when you say how many IPs would be in a /20 or /24
    Now instead of doing math just remember this table or visit here more often :)

    /32 1 IP Address(es)  
    /31 2 IP Address(es)  
    /30 4 IP Address(es)  
    /29 8 IP Address(es)  
    /28 16 IP Address(es)  
    /27 32 IP Address(es)  
    /26 64 IP Address(es)  
    /25 128 IP Address(es)  
    /24 256 IP Address(es)  
    /23 512 IP Address(es)  
    /22 1024 IP Address(es)  
    /21 2048 IP Address(es)  
    /20 4096 IP Address(es)  
    /19 8192 IP Address(es)  
    /18 16384 IP Address(es)  
    /17 32768 IP Address(es)  
    /16 65536 IP Address(es)  
    /15 131072 IP Address(es)  
    /14 262144 IP Address(es)  
    /13 524288 IP Address(es)  
    /12 1048576 IP Address(es)  
    /11 2097152 IP Address(es)  
    /10 4194304 IP Address(es)  
     /9 8388608 IP Address(es)  
     /8 16777216 IP Address(es)  
         
         
         
         
         










     


  • Openvz Quick Install for CentOS 5 Tutorial


    cd /etc/yum.repos.d
    wget http://download.openvz.org/openvz.repo
    rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ
    yum install ovz-kernel-PAE

    Now remember to set /etc/sysctl.conf to "net.ipv4.ip_forward = 1"

    You can apply the change immediately by running sysctl -w net.ipv4.ip_forward = 1 but remember that you still have to set sysctl.conf

    sysctl -p will load and apply any changes to sysctl.conf as well


  • OpenVZ: failed to load module vzmon [FAILED] vzmon: Unknown symbol ve_snmp_proc_init vzmon: Unknown symbol addrconf_sysctl_free vzmon: Unknown symbol ve_ndisc_init vzmon: Unknown symbol addrconf_ifdown vzmon: Unknown symbol ip6_frag_cleanup vzm


    service vz start
    Starting OpenVZ: failed to load module vzmon               [FAILED]

     vzmon: Unknown symbol ve_snmp_proc_init
     vzmon: Unknown symbol addrconf_sysctl_free
     vzmon: Unknown symbol ve_ndisc_init
     vzmon: Unknown symbol addrconf_ifdown
     vzmon: Unknown symbol ip6_frag_cleanup
     vzmon: Unknown symbol fini_ve_route6
     vzmon: Unknown symbol addrconf_sysctl_init
     vzmon: Unknown symbol ve_snmp_proc_fini
     vzmon: Unknown symbol ve_ndisc_fini
     vzmon: Unknown symbol init_ve_route6
     vzmon: Unknown symbol addrconf_sysctl_fini

    OpenVZ "failed to load module vzmon" solution

     

    The cause of the error is simply lack of ipv6 kernel support, it means that the ipv6 kernel module is not getting loaded or is blocked/disabled in something like modprobe.conf.


    make sure the ipv6 kernel module is getting loaded (I had mine disabled in /etc/modprobe.conf).

     


  • Kernel Error - 2.6.35.2 stuck on the following: msgmni has been set to 1466 request_module: run away loop modprobe char-major-5-1


    2.6.35.2 stuck on the following:
    msgmni has been set to 1466
    request_module: run away loop modprobe char-major-5-1

    I don't know the fix for it, but it is an old bug that has reappeared.


  • Openvz Error Starting OpenVZ: failed to load module vzmon [FAILED]


    service vz start
    Starting OpenVZ: failed to load module vzmon               [FAILED]

     vzmon: Unknown symbol ve_snmp_proc_init
     vzmon: Unknown symbol addrconf_sysctl_free
     vzmon: Unknown symbol ve_ndisc_init
     vzmon: Unknown symbol addrconf_ifdown
     vzmon: Unknown symbol ip6_frag_cleanup
     vzmon: Unknown symbol fini_ve_route6
     vzmon: Unknown symbol addrconf_sysctl_init
     vzmon: Unknown symbol ve_snmp_proc_fini
     vzmon: Unknown symbol ve_ndisc_fini
     vzmon: Unknown symbol init_ve_route6
     vzmon: Unknown symbol addrconf_sysctl_fini


    Solution


    make sure ipv6 is getting loaded (I had mine disabled in /etc/modprobe.conf)


  • Direcatdmin Install AWStats


    cd /usr/local/directadmin/scripts/

    scripts]# ./awstats.sh

    --23:49:28--  http://files.directadmin.com/services/all/awstats/awstats-6.9.tar.gz
    Resolving files.directadmin.com... 72.35.85.222
    Connecting to files.directadmin.com|72.35.85.222|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1125906 (1.1M) [application/x-gzip]
    Saving to: `/usr/local/directadmin/scripts/packages/awstats-6.9.tar.gz'

    100%[=====================================================================>] 1,125,906    659K/s   in 1.7s  

    23:49:31 (659 KB/s) - `/usr/local/directadmin/scripts/packages/awstats-6.9.tar.gz' saved [1125906/1125906]

    AWstats package is installed


  • Directadmin License Error The ip of this machine (xx.xx.xx.xx) does not match the ip in the license file.
    Check the value of your ethernet_dev=venet0:0 setting in your /usr/local/directadmin/conf/directadmin.conf file and the output of /sbin/ifco


    2010:09:09-22:22:11: The ip of this machine (xx.xx.xx.xx) does not match the ip in the license file.<br>
    Check the value of your ethernet_dev=venet0:0 setting in your /usr/local/directadmin/conf/directadmin.conf file and the output of /sbin/ifconfig<br>

    Solution

    /usr/local/directadmin/scripts/getLicense.sh


  • Revert to GRUB 0.97/1 instead of GRUB2


    had trouble trying to revert Ubuntu 10.04 LTS from grub2, won't boot mdraid and did not even install mdadm during the installation!
    I have tried moving back to GRUB 0.97

    backed up original /boot and then copied /boot from an old Debian install.  Modified device.map and menu.lst and put the appropriate kernels and initrd for Ubuntu back in /boot

    I ran grub:
    root (hd0,1)
    grub> setup (hd0)
     Checking if "/boot/grub/stage1" exists... yes
     Checking if "/boot/grub/stage2" exists... yes
     Checking if "/boot/grub/e2fs_stage1_5" exists... yes
     Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
    succeeded
     Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
    Done.




    I was successful.
    But when booting I get a _ line that goes from top to the bottom and ends with a weird face/shape inside a rectangle.
    I even wiped out the MBR dd if=/dev/zero of=/dev/sda bs=512 count=1 and then ran grub setup again as above with the same result.

    I believe the issue is in the boot sector of /dev/sda2 where grub is, perhaps grub2 installs something/in addition sectors that grub 0.97 cannot erase or overwrite.

     


  • SolusVM/Xen Central Backup Warning - Takes System Off-line!


    This really gives me a bad impression of SolusVM.

    I tried the "Central Backup" option and it does not warn that your server gets shutdown instantly in order to do the backup!

    Further, there is no way to pause or cancel the backup.  Thankfully this is a test/small disk usage VPS but what if someone was running something production with a large filesize?

    I haven't used QuickBackup but hope that isn't the same thing.

    Everyone should be vary careful of this feature when using SolusVM.


  • NotifyByPopup::slotDBusNotificationClosed: 465 -> 0 knotify(31135) NotifyByPopup::slotDBusNotificationClosed: failed to find knotify id for dbus_id 465


    I keep getting this in my SSH/Bash console:



    NotifyByPopup::slotDBusNotificationClosed: 465   ->  0
                                                                                            knotify(31135) NotifyByPopup::slotDBusNotificationClosed: failed to find knotify id for dbus_id 465
     


  • [function.vB-Registry-include]: failed to open stream: No such file or directory in /www/vhosts/site.com/forums/includes/class_core.php on line 2394


    [function.vB-Registry-include]: failed to open stream: No such file or directory in /www/vhosts/site.com/forums/includes/class_core.php on line 2394

    This happens on a new vBulletin install where you haven't created the config.php file.  Simply copy the config.php.new file into config.php and you'll be good to go.


  • expect script debugging


    expect script debugging
    Add the "-d" switch.

    #!/usr/bin/expect


    I have a problem writing something to a telnet session:

    send: sending "statusn" to { exp6 }
    send: sending "quitr" to { exp6 }
    write() failed to write anything - will sleep(1) and retry...

    The solution for my telnet script was to add the "interact" command after the statements you want sent to the session:

    send quitrn
    interact
    #you need interact otherwise the command won't get sent


  • Buffer I/O error on device fd0, logical block 0


    Virtually no system has a floppy disk drive anymore but you will often find your Linux distribution insists that you do or should have one :)

    The solution is to remove the floppy module and prevent it from loading on the next reboot.

    rmmod floppy

    Centos/RHEL

    echo "blacklist floppy" >> /etc/modprobe.d/blacklist

    Debian/Ubuntu

    sudo echo "blacklist floppy" >> /etc/modprobe.d/blacklist.conf


  • Nautilus/GNOME/Ubuntu File Manager not applying appearance style/changes


    I thought it was a GNOME problem because no matter what styles I applied Nautilus wouldn't change, but it was only Nautilus that wouldn't change/update anymore so I should have known.

    The only fix/solution I knew of other than rebooting is the following:

    sudo killall nautilus

    I tried closing all instances of nautilus that were visible and it had no effect.

    And another thing to remember is that only will appearances/styles/themes not apply to Nautilus if one process of it is hung/crashed but I added the option to resize and rotate images by right clicking in Nautilus but the option didn't appear until I killed all nautilus's as shown above.


  • GNOME/Nautilus Resize Images/Pictures from File Manager by right clicking


    Just install the following package "nautilus-image-converter" and you will be able to right click any image and convert the size and rotate it.

    My only wish is that you could also convert the image type from say tiff to jpg etc...

    This is an awesome/handy/feature and great tool to have.  This is one way where GNOME/Nautilus excel, the possibilities are endless to simplify and make simple/mundane tasks quicker and more efficient than ever.


  • Nautilus/GNOME File Manager handy list of extensions


    nautilus-gksu - privilege granting extension for nautilus using gksu
    nautilus-sendto - integrates Evolution and Pidgin into the Nautilus file manager
    nautilus-share - Nautilus extension to share folder using Samba
    nautilus-actions - nautilus extension to configure programs to launch
    nautilus-bzr - Bazaar (bzr) integration for nautilus
    nautilus-cd-burner - CD Burning front-end for Nautilus
    nautilus-clamscan - Antivirus scanning for Nautilus
    nautilus-filename-repairer - Nautilus extension for filename encoding repair
    nautilus-image-converter - nautilus extension to mass resize or rotate images
    nautilus-open-terminal - nautilus plugin for opening terminals in arbitrary local paths
    nautilus-pastebin - Nautilus extension to send files to a pastebin
    nautilus-script-audio-convert - A nautilus audio converter script
    nautilus-script-collection-svn - Nautilus subversion management scripts
    nautilus-script-debug - Simple nautilus debugging script
    nautilus-script-manager - A simple management tool for nautilus scripts
    nautilus-scripts-manager - simple tool for nautilus scripts management
    nautilus-wallpaper - Nautilus extension. Add a "set as wallpaper" entry in context menu
    nautilus - file manager and graphical shell for GNOME
    nautilus-data - data files for nautilus
    nautilus-dbg - file manager and graphical shell for GNOME - debugging version
    nautilus-sendto-empathy - GNOME multi-protocol chat and call client (nautilus-sendto plugin)

     

    I think all of these should be fully integrated by default but they aren't.


  • Wine stopped working/won't work Solution


    After an upgrade wine wouldn't open anything, not even the pre-installed notepad.

    There are no wine logs and nothing is mentioned in any standard log file about why.

    I finally decided to run wine from the shell and see what's going on:

    wine client error:0: version mismatch 398/402.
    Your wineserver binary was not upgraded correctly,
    or you have an older one somewhere in your PATH.
    Or maybe the wrong wineserver is still running?

    I've already removed and re-installed wine without any luck.  Obviously it isn't getting cleaned out or reinstalled properly.

    Here's what dpkg says I have installed right now:

    ii  wine                                 1.2-0ubuntu6~lucid5                             Microsoft Windows Compatibility Layer (dummy
    ii  wine1.2                              1.2-0ubuntu6~lucid5                             Microsoft Windows Compatibility Layer (Binar
    ii  wine1.2-gecko                        1.0.0-0ubuntu4                                  Microsoft Windows Compatibility Layer (Web B

    *One warning before running the below with --purge it does remove your wine programs and other settings.

    sudo apt-get --purge remove wine1.2 wine1.2-gecko

    Now let's reinstall wine and see if it works:

    sudo apt-get install wine
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      libswfdec-0.8-0
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      wine1.2 wine1.2-gecko
    Recommended packages:
      winetricks wisotool
    The following NEW packages will be installed:
      wine wine1.2 wine1.2-gecko
    0 upgraded, 3 newly installed, 0 to remove and 8 not upgraded.
    Need to get 8,123kB/18.6MB of archives.
    After this operation, 95.4MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://mirror.its.uidaho.edu/pub/ubuntu/ lucid/multiverse wine1.2-gecko 1.0.0-0ubuntu4 [8,123kB]
    Fetched 8,123kB in 1s (5,687kB/s)       
    Preconfiguring packages ...
    Selecting previously deselected package wine1.2.
    (Reading database ... 281968 files and directories currently installed.)
    Unpacking wine1.2 (from .../wine1.2_1.2-0ubuntu6~lucid5_i386.deb) ...

    No I still get the same error, I think I need to remove the "~/.wine" directory.

    wine client error:0: version mismatch 398/402.
    Your wineserver binary was not upgraded correctly,
    or you have an older one somewhere in your PATH.
    Or maybe the wrong wineserver is still running?

    Yes removing the current .wine made notepad start.  This is obviously a config issue and I'm not sure how else it could have been resolved other than removing the old .wine.


  • http://apt.sw.be/redhat/el5/en/i386/test/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror.


    http://apt.sw.be/redhat/el5/en/i386/test/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge-testing. Please verify its path and try again

    Notice it is complaining about "rpmforge-testing", just disable it for now:

    Solution is to edit the repo:


    vi /etc/yum.repos.d/rpmforge-testing.repo

    set "enabled" to 0

     


  • EOL for Kubuntu/Ubuntu 8.04 - W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/universe/source/Sources.gz 404 Not Found [IP: 91.189.92.171 80]


    I couldn't figure out why I couldn't install a simple package.  This is what's annoying about cutting edge Debian distros, yes we know you support each license on average for 1-2 years but why take down the supporting binary packages and basically disable the older versions?

    sudo apt-get install update
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    E: Couldn't find package update
    sudo apt-get update
    Ign http://ca.archive.ubuntu.com intrepid Release.gpg
    Ign http://ca.archive.ubuntu.com intrepid/main Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid/restricted Translation-en_CA
    Ign http://security.ubuntu.com intrepid-security Release.gpg
    Ign http://security.ubuntu.com intrepid-security/main Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid/universe Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid/multiverse Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid-updates Release.gpg
    Ign http://ca.archive.ubuntu.com intrepid-updates/main Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid-updates/restricted Translation-en_CA
    Ign http://security.ubuntu.com intrepid-security/restricted Translation-en_CA
    Ign http://security.ubuntu.com intrepid-security/universe Translation-en_CA
    Ign http://security.ubuntu.com intrepid-security/multiverse Translation-en_CA
    Ign http://security.ubuntu.com intrepid-security Release
    Ign http://ca.archive.ubuntu.com intrepid-updates/universe Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid-updates/multiverse Translation-en_CA
    Ign http://ca.archive.ubuntu.com intrepid Release
    Ign http://ca.archive.ubuntu.com intrepid-updates Release
    Ign http://security.ubuntu.com intrepid-security/main Packages
    Ign http://ca.archive.ubuntu.com intrepid/main Packages
    Ign http://ca.archive.ubuntu.com intrepid/restricted Packages
    Ign http://ca.archive.ubuntu.com intrepid/main Sources
    Ign http://ca.archive.ubuntu.com intrepid/restricted Sources
    Ign http://ca.archive.ubuntu.com intrepid/universe Packages
    Ign http://ca.archive.ubuntu.com intrepid/universe Sources
    Ign http://security.ubuntu.com intrepid-security/restricted Packages
    Ign http://ca.archive.ubuntu.com intrepid/multiverse Packages
    Ign http://security.ubuntu.com intrepid-security/main Sources
    Ign http://security.ubuntu.com intrepid-security/restricted Sources
    Ign http://security.ubuntu.com intrepid-security/universe Packages
    Ign http://ca.archive.ubuntu.com intrepid/multiverse Sources
    Ign http://ca.archive.ubuntu.com intrepid-updates/main Packages
    Ign http://ca.archive.ubuntu.com intrepid-updates/restricted Packages
    Ign http://ca.archive.ubuntu.com intrepid-updates/main Sources
    Ign http://ca.archive.ubuntu.com intrepid-updates/restricted Sources
    Ign http://ca.archive.ubuntu.com intrepid-updates/universe Packages
    Ign http://ca.archive.ubuntu.com intrepid-updates/universe Sources
    Ign http://security.ubuntu.com intrepid-security/universe Sources
    Ign http://security.ubuntu.com intrepid-security/multiverse Packages
    Ign http://security.ubuntu.com intrepid-security/multiverse Sources
    Err http://security.ubuntu.com intrepid-security/main Packages
      404 Not Found [IP: 91.189.88.37 80]
    Ign http://ca.archive.ubuntu.com intrepid-updates/multiverse Packages
    Err http://security.ubuntu.com intrepid-security/restricted Packages
      404 Not Found [IP: 91.189.88.37 80]
    Ign http://ca.archive.ubuntu.com intrepid-updates/multiverse Sources
    Err http://ca.archive.ubuntu.com intrepid/main Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://security.ubuntu.com intrepid-security/main Sources
      404 Not Found [IP: 91.189.88.37 80]
    Err http://ca.archive.ubuntu.com intrepid/restricted Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid/main Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid/restricted Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid/universe Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid/universe Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid/multiverse Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid/multiverse Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/main Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://security.ubuntu.com intrepid-security/restricted Sources
      404 Not Found [IP: 91.189.88.37 80]
    Err http://security.ubuntu.com intrepid-security/universe Packages
      404 Not Found [IP: 91.189.88.37 80]
    Err http://security.ubuntu.com intrepid-security/universe Sources
      404 Not Found [IP: 91.189.88.37 80]
    Err http://security.ubuntu.com intrepid-security/multiverse Packages
      404 Not Found [IP: 91.189.88.37 80]
    Err http://security.ubuntu.com intrepid-security/multiverse Sources
      404 Not Found [IP: 91.189.88.37 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/restricted Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/main Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/restricted Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/universe Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/universe Sources
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/multiverse Packages
      404 Not Found [IP: 91.189.92.171 80]
    Err http://ca.archive.ubuntu.com intrepid-updates/multiverse Sources
      404 Not Found [IP: 91.189.92.171 80]
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/main/binary-i386/Packages.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/main/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/restricted/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/main/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/restricted/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/universe/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/universe/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/restricted/binary-i386/Packages.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/multiverse/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/main/source/Sources.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/restricted/source/Sources.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/universe/binary-i386/Packages.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid/multiverse/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/main/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/restricted/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/main/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/restricted/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/universe/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/universe/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/universe/source/Sources.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/multiverse/binary-i386/Packages.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/intrepid-security/multiverse/source/Sources.gz  404 Not Found [IP: 91.189.88.37 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/multiverse/binary-i386/Packages.gz  404 Not Found [IP: 91.189.92.171 80]

    W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/intrepid-updates/multiverse/source/Sources.gz  404 Not Found [IP: 91.189.92.171 80]

    E: Some index files failed to download, they have been ignored, or old ones used instead.

     

     

    Solution Upgrade your Ubuntu/Kubuntu distro

    You're being forced to upgrade to a newer distro so run the following.

    sudo apt-get install update-manager-core

    vi /etc/update-manager/release-upgrades and set Prompt=normal

     

    sudo do-release-upgrade

    This will download a lot of packages and then run through an upgrade/prompt process replacing/upating different packages and will then finally reboot.

    I was impressed that the upgrade was quite smooth and without problem or event so that's the good news.  I only did it though because I couldn't install new packages.


  • How to chroot properly into your OS/distro


    From a LiveCD or if you're doing something like converting your non-RAID install to mdadm here's how you would chroot properly (you have to mount your proc, sys and dev on the running system/LiveCD to your chroot environment if you want things to work right, especially if you need to run update-initramfs due to a driver change etc..)

    *replace "path" with your mount/chroot path

    mount -o bind /proc /mnt/path/proc
    mount -o bind /dev/ mnt/path/dev
    mount -o bind /sys /mnt/path/sys
    chroot /mnt/path


  • GRUB2 won't show boot menu/options/silent boot


    This is a "pro" feature I guess so you don't have to see the ugly GRUB screen but if you're having boot problems or trying to update/customize your system it can be frustrating.  You have to do some Googling to find out that you have to hold shift to see the GRUB2 menu.

    You have to hold shift before GRUB2 loads and you will see it


  • Ubuntu 10.04/GRUB2 mdadm won't boot


    Moving to RAID was a pain.
    What you have to do is the following from an existing install:

    Install mdadm


    Create your mdadm RAID 1 array on your spare hard drive.
    Start it with the missing disk.

    rsync the entire contents of your current / to the md partition.

    Here's a good way of doing it:

    rsync -Pha --exclude=/proc/* --exclude=/sys/* --exclude=/mnt/* /. /mnt/md2

    "/mnt/md2" is the mount point of the md array I want to boot from.

    *Note the "/." at the end, the . makes sure that all hidden files will be copied (weirdly enough rsync and other commands will IGNORE and NOT copy hidden files without specifying the .)  Do not specify a ".*", bad and unexpected things copy/happen when you do that.

    chroot into your mdadm partition:

    mount -o bind /proc /mnt/$path/proc
    mount -o bind /dev/ mnt/$path/dev
    mount -o bind /sys /mnt/$path/sys
    chroot /mnt/$path

    You'll need to setup /etc/mdadm/mdadm.conf

    sudo mdadm --detail --brief /dev/md0 >> /etc/mdadm/mdadm.conf

    You'll need to install grub on the actual hard drive

    Use the correct device name for your RAID drives (for me it is sdb and sda).

    *Note it's not the actual device such as /dev/sda1, it's just the drive device name alone (GRUB 2 does the rest by default).


    grub-install /dev/sdb

    grub-install /dev/sda

    We run "update-grub" so that the UUID for your mdadm RAID array is specified when booting (otherwise booting will fail and you'll be frustrated/stressed out-that's how this guide was created).

    update-grub

    Update your initramfs with "update-initramfs -u".
    exit chroot
    unmount your /mnt/$path/*

    reboot and it should work.

    *Often it seems initramfs does not get mdadm added to it UNLESS mdadm is freshly installed in the chroot environment.  To be sure remove mdadm and then reinstall it and that should make 100% mdadm is added.  Just running update-initramfs has not always worked for me.

    *One problem I had is that at one point my OS install called my md0 /dev/md_d0 for some reason.  Even so my /etc/mdadm/mdadm.conf referred to it as md0.  Yet grub set the root as being "root=md_d0" and this caused booting/mounting to fail until I set it back to "root=UUID=".

     


  • mdadm won't boot due to fsck error


    Nov 29 20:17:58 ubuntu kernel: [ 1157.180789] md: md1 stopped.
    Nov 29 20:17:58 ubuntu kernel: [ 1157.180829]  md0: unknown partition table


    filesystem not responding/reading properly with du or rsync (this needed an fsck).


    [ 2571.489217] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35923106
    [ 2571.942299] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35923110
    [ 2571.956838] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35923112
    [ 2571.958105] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35923111
    [ 2571.959999] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35915170
    [ 2571.965613] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35915175
    [ 2572.018667] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 35923105
    [ 2572.999147] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 37949889
    [ 2573.524896] EXT3-fs error (device md2): ext3_lookup: deleted inode referenced: 21889031


    root@ubuntu:/mnt# fsck.ext3 /dev/md2
    e2fsck 1.41.12 (17-May-2010)
    /dev/md2 contains a file system with errors, check forced.
    Pass 1: Checking inodes, blocks, and sizes

    Pass 1: Checking inodes, blocks, and sizes
    Deleted inode 35914963 has zero dtime.  Fix<y>? yes

    Inodes that were part of a corrupted orphan linked list found.  Fix<y>? yes

    Inode 35914964 was part of the orphaned inode list.  FIXED.
    Inode 35914965 was part of the orphaned inode list.  FIXED.
    Inode 35914966 was part of the orphaned inode list.  FIXED.
    Inode 35914967 was part of the orphaned inode list.  FIXED.
    Inode 35914968 was part of the orphaned inode list.  FIXED.
    Inode 35914969 was part of the orphaned inode list.  FIXED.
    Inode 35914970 was part of the orphaned inode list.  FIXED.
    Inode 35915010 was part of the orphaned inode list.  FIXED.
    Inode 35915011 was part of the orphaned inode list.  FIXED.
    Inode 35915012 was part of the orphaned inode list.  FIXED.
    Inode 35915013 was part of the orphaned inode list.  FIXED.
    Inode 35915189 was part of the orphaned inode list.  FIXED.
    Inode 35915647 was part of the orphaned inode list.  FIXED.
    Inode 35916554 was part of the orphaned inode list.  FIXED.
    Inode 35921340 was part of the orphaned inode list.  FIXED.
    Inode 35921343 was part of the orphaned inode list.  FIXED.
    Inode 35921351 was part of the orphaned inode list.  FIXED.
    Inode 35921383 was part of the orphaned inode list.  FIXED.
    Inode 35921387 was part of the orphaned inode list.  FIXED.
    Inode 35921393 was part of the orphaned inode list.  FIXED.
    Inode 35921405 was part of the orphaned inode list.  FIXED.
    Inode 35921415 was part of the orphaned inode list.  FIXED.
    Inode 35921418 was part of the orphaned inode list.  FIXED.
    Inode 35921434 was part of the orphaned inode list.  FIXED.
    Inode 35921453 was part of the orphaned inode list.  FIXED.
    Inode 35921456 was part of the orphaned inode list.  FIXED.
    Inode 35921462 was part of the orphaned inode list.  FIXED.
    Inode 35921463 was part of the orphaned inode list.  FIXED.
    Inode 35921467 was part of the orphaned inode list.  FIXED.
    Inode 35921468 was part of the orphaned inode list.  FIXED.
    Inode 35922361 was part of the orphaned inode list.  FIXED.
    Inode 36850013, i_blocks is 4024, should be 4016.  Fix<y>? yes
     


  • VirtualBox some USB passthrough devices greyed/grayed out unavailable solution


    The solution is simple but it's a wonder why VBOX doesn't address it directly?

    Perhaps newer versions will but you have to add your user to the "vboxusers" group and then login and logout and you'll see the devices you wanted but couldn't access are now available.

    The weird thing is that the grayed out issue doesn't happen with all devcies but one notable thing is the Apple iPhone especially in DFU or Recovery Mode which is an big issue for some people.


  • Firefox plugin-container high CPU usage


    This is an easy fix and highlights a huge issue again with Linux and Flash still not playing nicely/working as well as Windows yet.

    Solution - Go to "about:config" and disable the two entries (set them to false):

     

    dom.ipc.plugins.enabled.libflashplayer.so

    dom.ipc.plugins.enabled.libnptest.so


  • WD (Western Digital) Advanced Format Drive Lagged/Slow Speed/Performance/Design Flaw EAD/EARS problem WDC WD20EARS-00S8B1


    Let the numbers speak for themselves, from what I read the Load_Cycle_Count which is very high (more than 500,000/half a million times) is the number of head parks.  What a stupid "Green" design and design flaw which will probably mean an early life for the drive.

    This is almost as silly as Seagate's new reputation for BSY/poor quality disks since the 7200.11 series.

    To make it worse this is also when Western Digital introduced "Advanced Format" or short for "big pain/slow performance" feature that no one asked for.

    Why should a special utility/specific sector be required for the disc to work properly?

    I have several of these 2TB EARS Western Digitals and it's not easy or practical for most to update the firmware either, nor is it easy or practical to reformat so many systems.

    I'll spend the extra money and go Hitachi from now on, this is a big blunder from Western Digital.  It has seriously affected my work with all the lag these drives have.

    === START OF INFORMATION SECTION ===
    Device Model:     WDC WD20EARS-00S8B1
    Serial Number:    WD-WCAVY
    Firmware Version: 80.00A80
    User Capacity:    2,000,398,934,016 bytes
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   8
    ATA Standard is:  Exact ATA specification draft version not indicated
    Local Time is:    Tue Nov 30 09:21:54 2010 CST
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled

    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED

    General SMART Values:
    Offline data collection status:  (0x82)    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:          (43200) seconds.
    Offline data collection
    capabilities:              (0x7b) SMART execute Offline immediate.
                        Auto Offline data collection on/off support.
                        Suspend Offline collection upon new
                        command.
                        Offline surface scan supported.
                        Self-test supported.
                        Conveyance Self-test supported.
                        Selective Self-test supported.
    SMART capabilities:            (0x0003)    Saves SMART data before entering
                        power-saving mode.
                        Supports SMART auto save timer.
    Error logging capability:        (0x01)    Error logging supported.
                        General Purpose Logging supported.
    Short self-test routine
    recommended polling time:      (   2) minutes.
    Extended self-test routine
    recommended polling time:      ( 255) minutes.
    Conveyance self-test routine
    recommended polling time:      (   5) minutes.
    SCT capabilities:            (0x3031)    SCT Status supported.
                        SCT Feature Control supported.
                        SCT Data Table supported.

    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
      3 Spin_Up_Time            0x0027   168   164   021    Pre-fail  Always       -       8566
      4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       15
      5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
      9 Power_On_Hours          0x0032   094   094   000    Old_age   Always       -       4808
     10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
     11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       13
    192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       12
    193 Load_Cycle_Count        0x0032   015   015   000    Old_age   Always       -       555565
    194 Temperature_Celsius     0x0022   109   101   000    Old_age   Always       -       43
    196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
    200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0


  • mdadm RAID 1 adventures


    I separated the 2 drives in the RAID 1 array.
    1 is the old one /dev/sda and is out of date, while the separated other one /dev/sdc was in another drive and mounted and used with more data (updated).

    I wonder how mdadm will handle this:

    usb-storage: device scan complete
    md: md127 stopped.
    md: bind<sda3>
    md: md127: raid array is not clean -- starting background reconstruction
    raid1: raid set md127 active with 1 out of 2 mirrors
    md: md126 stopped.
    md: bind<sda2>
    raid1: raid set md126 active with 1 out of 2 mirrors
    md: md125 stopped.
    md: bind<sda1>
    raid1: raid set md125 active with 1 out of 2 mirrors
    kjournald starting.  Commit interval 5 seconds
    EXT3-fs warning: checktime reached, running e2fsck is recommended
    EXT3 FS on md127, internal journal
    EXT3-fs: recovery complete.
    EXT3-fs: mounted filesystem with ordered data mode.
    spurious 8259A interrupt: IRQ7.
    md: md127 stopped.
    md: unbind<sda3>
    md: export_rdev(sda3)
    ata1: exception Emask 0x10 SAct 0x0 SErr 0x90202 action 0xe frozen
    ata1: irq_stat 0x00400000, PHY RDY changed
    ata1: SError: { RecovComm Persist PHYRdyChg 10B8B }
    ata1: hard resetting link
    ata1: link is slow to respond, please be patient (ready=0)
    ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata1.00: configured for UDMA/133
    ata1: EH complete
    sd 0:0:0:0: [sda] 3907029168 512-byte hardware sectors (2000399 MB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    ata3: exception Emask 0x10 SAct 0x0 SErr 0x40d0000 action 0xe frozen
    ata3: irq_stat 0x00400040, connection status changed
    ata3: SError: { PHYRdyChg CommWake 10B8B DevExch }
    ata3: hard resetting link
    ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata3.00: ATA-8: WDC WD20EARS-00S8B1, 80.00A80, max UDMA/133
    ata3.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
    ata3.00: configured for UDMA/133
    ata3: EH complete
    scsi 2:0:0:0: Direct-Access     ATA      WDC WD20EARS-00S 80.0 PQ: 0 ANSI: 5
    sd 2:0:0:0: [sdc] 3907029168 512-byte hardware sectors (2000399 MB)
    sd 2:0:0:0: [sdc] Write Protect is off
    sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
    sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    sd 2:0:0:0: [sdc] 3907029168 512-byte hardware sectors (2000399 MB)
    sd 2:0:0:0: [sdc] Write Protect is off
    sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
    sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
     sdc: sdc1 sdc3
    sd 2:0:0:0: [sdc] Attached SCSI disk
    sd 2:0:0:0: Attached scsi generic sg2 type 0

    -bash-3.1# fdisk -l

    Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1        1825    14659281   83  Linux
    /dev/sda2   *        1826        9121    58605120   83  Linux
    /dev/sda3            9122      243201  1880247600   83  Linux

    Disk /dev/sdb: 1002 MB, 1002438656 bytes
    255 heads, 63 sectors/track, 121 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1         122      978912+   c  W95 FAT32 (LBA)
    Partition 1 has different physical/logical endings:
         phys=(120, 254, 63) logical=(121, 222, 37)

    Disk /dev/md126: 60.0 GB, 60011577344 bytes
    2 heads, 4 sectors/track, 14651264 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes

    Disk /dev/md126 doesn't contain a valid partition table

    Disk /dev/md125: 15.0 GB, 15009981440 bytes
    2 heads, 4 sectors/track, 3664546 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes

    Disk /dev/md125 doesn't contain a valid partition table

    Disk /dev/sdc: 2000.3 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *           1        1825    14659281   83  Linux
    /dev/sdc3            9122      243201  1880247600   83  Linux
    -bash-3.1# mdadm -A -s
    mdadm: /dev/md/diaghost05102010:2 exists - ignoring
    mdadm: /dev/md127 has been started with 1 drive (out of 2).
    mdadm: /dev/md/diaghost05102010:2 exists - ignoring
    mdadm: /dev/md124 has been started with 1 drive (out of 2).
    -bash-3.1# cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [multipath]
    md124 : active raid1 sda3[1]
          1880246440 blocks super 1.2 [2/1] [_U]
         
    md125 : active raid1 sda1[1]
          14658185 blocks super 1.2 [2/1] [_U]
         
    md126 : active raid1 sda2[1]
          58605056 blocks [2/1] [_U]
         
    md127 : active raid1 sdc3[0]
          1880246440 blocks super 1.2 [2/1] [U_]
         
    unused devices: <none>

    dmesg:

    md: md127 stopped.
    md: bind<sda3>
    md: bind<sdc3>
    md: kicking non-fresh sda3 from array!
    md: unbind<sda3>
    md: export_rdev(sda3)
    raid1: raid set md127 active with 1 out of 2 mirrors
    md: md124 stopped.
    md: bind<sda3>
    raid1: raid set md124 active with 1 out of 2 mirrors

    =====================
    It seems it considers the new sdc (up to date) disc as /dev/md124
    The old one is /dev/md127

    So it somehow thinks they are totally separate arrays.

    mdadm -D /dev/md127
    /dev/md127:
            Version : 1.2
      Creation Time : Mon May 10 22:05:48 2010
         Raid Level : raid1
         Array Size : 1880246440 (1793.14 GiB 1925.37 GB)
      Used Dev Size : 1880246440 (1793.14 GiB 1925.37 GB)
       Raid Devices : 2
      Total Devices : 1
        Persistence : Superblock is persistent

        Update Time : Thu Dec  2 18:46:10 2010
              State : clean, degraded
     Active Devices : 1
    Working Devices : 1
     Failed Devices : 0
      Spare Devices : 0

               Name : diaghost05102010:2
               UUID : d851091d:3d109a17:921ab0e1:3a465899
             Events : 89394

        Number   Major   Minor   RaidDevice State
           0       8       35        0      active sync   /dev/sdc3
           1       0        0        1      removed

    ===========
    mdadm -D /dev/md124
    /dev/md124:
            Version : 1.2
      Creation Time : Mon May 10 22:05:48 2010
         Raid Level : raid1
         Array Size : 1880246440 (1793.14 GiB 1925.37 GB)
      Used Dev Size : 1880246440 (1793.14 GiB 1925.37 GB)
       Raid Devices : 2
      Total Devices : 1
        Persistence : Superblock is persistent

        Update Time : Fri Dec  3 02:34:08 2010
              State : clean, degraded
     Active Devices : 1
    Working Devices : 1
     Failed Devices : 0
      Spare Devices : 0

               Name : diaghost05102010:2
               UUID : d851091d:3d109a17:921ab0e1:3a465899
             Events : 38

        Number   Major   Minor   RaidDevice State
           0       0        0        0      removed
           1       8        3        1      active sync   /dev/sda3
     



    Actually this seems smart, it seems to know that /dev/sdc3 is the fresh one.
    I don't want to test this, but I wonder what would have happened if I had md127 mounted before using just sda3, how would mdadm react if it was part of a live filesystem?  I'm guessing (hopefully) it wouldn't allow sdc3 to join the array and let the user decide how to handle it.

    This could still be an issue, why did mdadm when I did a -A -s find md124 as a new array when the UUID for both is the same?
    I kind of get it, it sees md124 as being the other out of sync array.

    I'm going to manually kill md124

    mdadm --manage --stop /dev/md124

    Now let's add the out of sync/old one back manually to the array.

    mdadm --add /dev/md127 /dev/sda3
    mdadm: re-added /dev/sda3
    -bash-3.1# cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [multipath]
    md125 : active raid1 sda1[1]
          14658185 blocks super 1.2 [2/1] [_U]
         
    md126 : active raid1 sda2[1]
          58605056 blocks [2/1] [_U]
         
    md127 : active raid1 sda3[1] sdc3[0]
          1880246440 blocks super 1.2 [2/1] [U_]
          [>....................]  recovery =  0.0% (210496/1880246440) finish=446.5min speed=70165K/sec
     



    good it worked as it should, when checking mdadm it clearly sees sdc3 as the active device and sda3 as the spare (I wish the /proc/mdstat would clearly show which device is active and which one is being synced to):



     mdadm -E /dev/sda3
    /dev/sda3:
              Magic : a92b4efc
            Version : 1.2
        Feature Map : 0x0
         Array UUID : d851091d:3d109a17:921ab0e1:3a465899
               Name : diaghost05102010:2
      Creation Time : Mon May 10 22:05:48 2010
         Raid Level : raid1
       Raid Devices : 2

     Avail Dev Size : 3760493152 (1793.14 GiB 1925.37 GB)
         Array Size : 3760492880 (1793.14 GiB 1925.37 GB)
      Used Dev Size : 3760492880 (1793.14 GiB 1925.37 GB)
        Data Offset : 2048 sectors
       Super Offset : 8 sectors
              State : clean
        Device UUID : 3f924621:bd0d3b67:917ec834:90ef479f

        Update Time : Fri Dec  3 03:01:21 2010
           Checksum : 4acbcec8 - correct
             Events : 89460


       Device Role : spare
       Array State : A. ('A' == active, '.' == missing)
    -bash-3.1# mdadm -E /dev/sdc3
    /dev/sdc3:
              Magic : a92b4efc
            Version : 1.2
        Feature Map : 0x0
         Array UUID : d851091d:3d109a17:921ab0e1:3a465899
               Name : diaghost05102010:2
      Creation Time : Mon May 10 22:05:48 2010
         Raid Level : raid1
       Raid Devices : 2

     Avail Dev Size : 3760493152 (1793.14 GiB 1925.37 GB)
         Array Size : 3760492880 (1793.14 GiB 1925.37 GB)
      Used Dev Size : 3760492880 (1793.14 GiB 1925.37 GB)
        Data Offset : 2048 sectors
       Super Offset : 8 sectors
              State : clean
        Device UUID : 5302b74a:fbb3097e:5f960dc5:b2d1461a

        Update Time : Fri Dec  3 03:01:21 2010
           Checksum : 964edf09 - correct
             Events : 89460


       Device Role : Active device 0
       Array State : A. ('A' == active, '.' == missing)
    -bash-3.1#



    So today we learned that mdadm isn't as smart as we think, it shouldn't have created two separate arrays when the UUID's matched.
    It should have just kicked the unfresh device from the array like it did but not create a separate array.

    It also isn't as smart as say DRBD (yes I know it's network block replication) but it's basically RAID 1 over the network and doesn't sync the entire disc contents.  I think it would be interesting if the DRBD method of marking blocks as being out of sync could apply to mdadm.  It is rather silly that if there are any changes to the disk, it has to be entirely rebuilt, whereas DRBD would just rebuild the changed contents.
     


  • yum error with some versions of Centos Refusing to automatically import keys when running unattended. Use "-y" to override.


    Refusing to automatically import keys when running unattended.
    Use "-y" to override.


    When using echo y|yum install gcc

    Fix with rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*


  • WD EARS/Green 2TB Cannot Disable Power Saving/Head Parking with hdparm


    hdparm -B 255 /dev/sdb

    /dev/sdb:
     setting Advanced Power Management level to disabled
     HDIO_DRIVE_CMD failed: Input/output error

     

    The one thing you can do though is to set hdparm spindown time lower (it doesn't seem to work that well).

     -S   set standby (spindown) timeout
     

    hdparm -S 251 /dev/sda

    /dev/sda:
     setting standby to 251 (5 hours + 30 minutes)

     

    I still found the "Load_Cycle_Count" from SMART to increase but at a much lower rate.  The head was definitely still parking itself quite frequently and not the 5.5 hours that the above command implies since nothing but WD's utility can disable that stupid feature.

    The only real solution since WD doesn't support industry standard commands found in utilties such as HDPARM is to run their propietary utility that works only from an ancient DOS boot disk.

    http://support.wdc.com/product/download.asp?groupid=609&sid=113

     


    hdparm -S 251 /dev/sda

    /dev/sda:
     setting standby to 251 (5 hours + 30 minutes)
    hdparm -S 251 /dev/sdb

    /dev/sdb:
     setting standby to 251 (5 hours + 30 minutes)



     hdparm -S 255 /dev/sda

    /dev/sda:
     setting standby to 255 (21 minutes + 15 seconds)

     



    hdparm -S 255 /dev/sdb

    /dev/sdb:
     setting standby to 255 (21 minutes + 15 seconds

    sda
    -------
    193 Load_Cycle_Count        0x0032   164   164   000    Old_age   Always       -       109580

    sdb
    --------
    193 Load_Cycle_Count        0x0032   099   099   000    Old_age   Always       -       303040

    -----------

    [root@server10 ~]# smartctl -a /dev/sda|grep Load
    193 Load_Cycle_Count        0x0032   164   164   000    Old_age   Always       -       109580
    [root@server10 ~]# smartctl -a /dev/sdb|grep Load
    193 Load_Cycle_Count        0x0032   099   099   000    Old_age   Always       -       303051

    =======================

    ***Other server

    [root@server09 ~]# hdparm -S 251 /dev/sda

    /dev/sda:
     setting standby to 251 (5 hours + 30 minutes)
    [root@server09 ~]# hdparm -S 251 /dev/sdb

    /dev/sdb:
     setting standby to 251 (5 hours + 30 minutes)

    193 Load_Cycle_Count        0x0032   158   158   000    Old_age   Always       -       127195
    [root@server09 ~]# smartctl -a /dev/sdb|grep Load
    193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       328090

    --------
    [root@server09 ~]# smartctl -a /dev/sda|grep Load
    193 Load_Cycle_Count        0x0032   158   158   000    Old_age   Always       -       127195
    [root@server09 ~]# smartctl -a /dev/sdb|grep Load
    193 Load_Cycle_Count        0x0032   091   091   000    Old_age   Always       -       328096

     


    *Update the above doesn't seem to be helping at all.  It seems the drive is accepting but not using the values hdparm is passing to it:

    193 Load_Cycle_Count        0x0032   156   156   000    Old_age   Always       -       133604
    193 Load_Cycle_Count        0x0032   085   085   000    Old_age   Always       -       347417
     


  • yum in Centos 5/Xen halts and exits suddenly


    yum exits in the middle

    The problem is this VPS seems to be an OpenVZ template from HyperVM.  The only way to make it work was to disable i386 packages since this was an x64 kernel.  That shouldn't be necessary but it was the only way to make yum stop quitting after the first package or two.  I couldn't find any issue by checking the logs either.

    echo y|yum install vim-minimal telnet expect jwhois net-tools slocate iptables elinks gawk


    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
     * rpmforge: ftp-stud.fht-esslingen.de
     * extras: ftp.estpak.ee
     * updates: ftp.estpak.ee
     * base: ftp.estpak.ee
     * addons: ftp.estpak.ee
    Setting up Install Process
    Parsing package install arguments
    Package vim-minimal - 2:7.0.109-6.el5.x86_64 is already installed.
    Package gawk - 3.1.5-14.el5.x86_64 is already installed.
    Resolving Dependencies
    --> Running transaction check
    ---> Package iptables.x86_64 0:1.3.5-5.3.el5_4.1 set to be updated
    ---> Package elinks.x86_64 0:0.11.1-6.el5_4.1 set to be updated
    ---> Package net-tools.x86_64 0:1.60-81.el5 set to be updated
    ---> Package telnet.x86_64 1:0.17-39.el5 set to be updated
    ---> Package mlocate.x86_64 0:0.15-1.el5.2 set to be updated
    ---> Package expect.i386 0:5.43.0-5.1 set to be updated
    --> Processing Dependency: libtcl8.4.so for package: expect
    ---> Package jwhois.x86_64 0:3.2.3-8.el5 set to be updated
    ---> Package expect.x86_64 0:5.43.0-5.1 set to be updated
    --> Running transaction check
    ---> Package tcl.i386 0:8.4.13-4.el5 set to be updated
    --> Finished Dependency Resolution

    Dependencies Resolved

    =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Installing:
     elinks                  x86_64     0.11.1-6.el5_4.1  base              1.0 M
     expect                  i386       5.43.0-5.1       base              158 k
     expect                  x86_64     5.43.0-5.1       base              160 k
     iptables                x86_64     1.3.5-5.3.el5_4.1  base              242 k
     jwhois                  x86_64     3.2.3-8.el5      base               95 k
     mlocate                 x86_64     0.15-1.el5.2     base               48 k
     telnet                  x86_64     1:0.17-39.el5    base               59 k
    Updating:
     net-tools               x86_64     1.60-81.el5      base              367 k
    Installing for dependencies:
     tcl                     i386       8.4.13-4.el5     base              956 k

    Transaction Summary
    =============================================================================
    Install      8 Package(s)        
    Update       1 Package(s)        
    Remove       0 Package(s)        

    Total download size: 3.1 M
    Is this ok [y/N]: Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing: expect                       ####################### [ 1/10]
      Installing: jwhois                       ####################### [ 2/10]



    yum install centos-release.x86_64
    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
     * base: ftp.estpak.ee
     * updates: ftp.estpak.ee
     * addons: ftp.estpak.ee
     * extras: ftp.estpak.ee
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package centos-release.x86_64 10:5-5.el5.centos set to be updated
    --> Finished Dependency Resolution

    Dependencies Resolved

    =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Updating:
     centos-release          x86_64     10:5-5.el5.centos  base               19 k

    Transaction Summary
    =============================================================================
    Install      0 Package(s)        
    Update       1 Package(s)        
    Remove       0 Package(s)        

    Total download size: 19 k
    Is this ok [y/N]: y
    Downloading Packages:
    (1/1): centos-release-5-5 100% |=========================|  19 kB    00:00    
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating  : centos-release               ######################### [1/2]
      Cleanup   : centos-release               ######################### [2/2]

    Updated: centos-release.x86_64 10:5-5.el5.centos
    Complete!
    #yum update
    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
     * base: ftp.estpak.ee
     * updates: ftp.estpak.ee
     * addons: ftp.estpak.ee
     * extras: ftp.estpak.ee
    Setting up Update Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package rpm-python.x86_64 0:4.4.2.3-20.el5_5.1 set to be updated
    ---> Package wget.x86_64 0:1.11.4-2.el5_4.1 set to be updated
    ---> Package openssh-clients.x86_64 0:4.3p2-41.el5_5.1 set to be updated
    --> Processing Dependency: libfipscheck.so.1()(64bit) for package: openssh-clients
    ---> Package newt.x86_64 0:0.52.2-15.el5 set to be updated
    ---> Package rpm.x86_64 0:4.4.2.3-20.el5_5.1 set to be updated
    --> Processing Dependency: crontabs for package: rpm
    --> Processing Dependency: logrotate for package: rpm
    ---> Package bzip2-libs.x86_64 0:1.0.3-6.el5_5 set to be updated
    ---> Package libxml2.x86_64 0:2.6.26-2.1.2.8.el5_5.1 set to be updated
    ---> Package gzip.x86_64 0:1.3.5-11.el5.centos.1 set to be updated
    ---> Package openssh.x86_64 0:4.3p2-41.el5_5.1 set to be updated
    ---> Package openldap.x86_64 0:2.3.43-12.el5_5.3 set to be updated
    ---> Package m2crypto.x86_64 0:0.16-6.el5.6 set to be updated
    ---> Package findutils.x86_64 1:4.2.27-6.el5 set to be updated
    ---> Package psmisc.x86_64 0:22.2-7 set to be updated
    ---> Package audit-libs.x86_64 0:1.7.17-3.el5 set to be updated
    ---> Package procps.x86_64 0:3.2.7-16.el5 set to be updated
    ---> Package db4.x86_64 0:4.3.29-10.el5_5.2 set to be updated
    ---> Package krb5-libs.x86_64 0:1.6.1-36.el5_5.6 set to be updated
    ---> Package initscripts.x86_64 0:8.45.30-3.el5.centos set to be updated
    ---> Package libacl.x86_64 0:2.2.39-6.el5 set to be updated
    ---> Package pam.x86_64 0:0.99.6.2-6.el5_5.2 set to be updated
    ---> Package e2fsprogs.x86_64 0:1.39-23.el5_5.1 set to be updated
    ---> Package bash.x86_64 0:3.2-24.el5 set to be updated
    ---> Package iputils.x86_64 0:20020927-46.el5 set to be updated
    ---> Package tzdata.x86_64 0:2010l-1.el5 set to be updated
    ---> Package coreutils.x86_64 0:5.97-23.el5_4.2 set to be updated
    ---> Package authconfig.x86_64 0:5.3.21-6.el5 set to be updated
    ---> Package nss.x86_64 0:3.12.8-1.el5.centos set to be updated
    ---> Package sysklogd.x86_64 0:1.4.1-46.el5 set to be updated
    ---> Package shadow-utils.x86_64 2:4.0.17-15.el5 set to be updated
    ---> Package mcstrans.x86_64 0:0.2.11-3.el5 set to be updated
    ---> Package expat.x86_64 0:1.95.8-8.3.el5_5.3 set to be updated
    ---> Package device-mapper.x86_64 0:1.02.39-1.el5_5.2 set to be updated
    ---> Package yum-metadata-parser.x86_64 0:1.1.2-3.el5.centos set to be updated
    ---> Package python.x86_64 0:2.4.3-27.el5_5.3 set to be updated
    ---> Package nspr.x86_64 0:4.8.6-1.el5_5 set to be updated
    ---> Package yum.noarch 0:3.2.22-26.el5.centos set to be updated
    ---> Package popt.x86_64 0:1.10.2.3-20.el5_5.1 set to be updated
    ---> Package python-urlgrabber.noarch 0:3.1.0-5.el5 set to be updated
    ---> Package tzdata.noarch 0:2010e-1.el5 set to be updated
    ---> Package grep.x86_64 0:2.5.1-55.el5 set to be updated
    ---> Package centos-release-notes.x86_64 0:5.5-0 set to be updated
    ---> Package dhclient.x86_64 12:3.0.5-23.el5_5.2 set to be updated
    ---> Package e2fsprogs-libs.x86_64 0:1.39-23.el5_5.1 set to be updated
    ---> Package openssl.x86_64 0:0.9.8e-12.el5_4.6 set to be updated
    ---> Package bzip2.x86_64 0:1.0.3-6.el5_5 set to be updated
    ---> Package libsepol.x86_64 0:1.15.2-3.el5 set to be updated
    ---> Package elfutils-libelf.x86_64 0:0.137-3.el5 set to be updated
    ---> Package cyrus-sasl-lib.x86_64 0:2.1.22-5.el5_4.3 set to be updated
    ---> Package filesystem.x86_64 0:2.4.0-3.el5 set to be updated
    ---> Package usermode.x86_64 0:1.88-3.el5.2 set to be updated
    ---> Package sqlite.x86_64 0:3.3.6-5 set to be updated
    ---> Package SysVinit.x86_64 0:2.86-15.el5 set to be updated
    ---> Package libselinux.x86_64 0:1.33.4-5.5.el5 set to be updated
    ---> Package udev.x86_64 0:095-14.21.el5_5.1 set to be updated
    ---> Package yum-fastestmirror.noarch 0:1.1.16-14.el5.centos.1 set to be updated
    ---> Package readline.x86_64 0:5.1-3.el5 set to be updated
    ---> Package chkconfig.x86_64 0:1.3.30.2-2.el5 set to be updated
    ---> Package ethtool.x86_64 0:6-4.el5 set to be updated
    ---> Package libstdc++.x86_64 0:4.1.2-48.el5 set to be updated
    ---> Package setup.noarch 0:2.5.58-7.el5 set to be updated
    ---> Package libuser.x86_64 0:0.54.7-2.1.el5_4.1 set to be updated
    ---> Package libgcc.x86_64 0:4.1.2-48.el5 set to be updated
    ---> Package tcp_wrappers.x86_64 0:7.6-40.7.el5 set to be updated
    ---> Package less.x86_64 0:436-2.el5 set to be updated
    ---> Package module-init-tools.x86_64 0:3.3-0.pre3.1.60.el5_5.1 set to be updated
    --> Processing Dependency: binutils for package: module-init-tools
    --> Processing Dependency: mkinitrd for package: module-init-tools
    ---> Package util-linux.x86_64 0:2.13-0.52.el5_4.1 set to be updated
    ---> Package glib2.x86_64 0:2.12.3-4.el5_3.1 set to be updated
    ---> Package rpm-libs.x86_64 0:4.4.2.3-20.el5_5.1 set to be updated
    ---> Package iproute.x86_64 0:2.6.18-11.el5 set to be updated
    ---> Package openssh-server.x86_64 0:4.3p2-41.el5_5.1 set to be updated
    --> Running transaction check
    ---> Package crontabs.noarch 0:1.10-8 set to be updated
    ---> Package binutils.x86_64 0:2.17.50.0.6-14.el5 set to be updated
    ---> Package mkinitrd.x86_64 0:5.1.19.6-61.el5_5.2 set to be updated
    --> Processing Dependency: kpartx >= 0.4.7-9 for package: mkinitrd
    --> Processing Dependency: cpio for package: mkinitrd
    --> Processing Dependency: nash = 5.1.19.6-61.el5_5.2 for package: mkinitrd
    --> Processing Dependency: hmaccalc for package: mkinitrd
    --> Processing Dependency: lvm2 for package: mkinitrd
    --> Processing Dependency: dmraid for package: mkinitrd
    --> Processing Dependency: tar for package: mkinitrd
    --> Processing Dependency: device-mapper-multipath >= 0.4.7-9 for package: mkinitrd
    ---> Package fipscheck-lib.x86_64 0:1.2.0-1.el5 set to be updated
    --> Processing Dependency: /usr/bin/fipscheck for package: fipscheck-lib
    ---> Package logrotate.x86_64 0:3.7.4-9.el5_5.2 set to be updated
    --> Running transaction check
    ---> Package nash.x86_64 0:5.1.19.6-61.el5_5.2 set to be updated
    ---> Package hmaccalc.x86_64 0:0.9.6-3.el5 set to be updated
    ---> Package kpartx.x86_64 0:0.4.7-34.el5_5.6 set to be updated
    ---> Package fipscheck.x86_64 0:1.2.0-1.el5 set to be updated
    ---> Package device-mapper-multipath.x86_64 0:0.4.7-34.el5_5.6 set to be updated
    --> Processing Dependency: libsysfs.so.2()(64bit) for package: device-mapper-multipath
    ---> Package tar.x86_64 2:1.15.1-30.el5 set to be updated
    ---> Package lvm2.x86_64 0:2.02.56-8.el5_5.6 set to be updated
    --> Processing Dependency: device-mapper-event for package: lvm2
    ---> Package cpio.x86_64 0:2.6-23.el5_4.1 set to be updated
    ---> Package dmraid.x86_64 0:1.0.0.rc13-63.el5 set to be updated
    --> Processing Dependency: dmraid-events for package: dmraid
    --> Running transaction check
    ---> Package libsysfs.x86_64 0:2.0.0-6 set to be updated
    ---> Package dmraid-events.x86_64 0:1.0.0.rc13-63.el5 set to be updated
    --> Processing Dependency: sgpio for package: dmraid-events
    ---> Package device-mapper-event.x86_64 0:1.02.39-1.el5_5.2 set to be updated
    --> Running transaction check
    ---> Package sgpio.x86_64 0:1.2.0_10-2.el5 set to be updated
    filelists.sqlite.bz2      100% |=========================| 4.0 MB    00:00    
    filelists.sqlite.bz2      100% |=========================| 3.6 MB    00:00    
    filelists.sqlite.bz2      100% |=========================| 228 kB    00:00    
    filelists.xml.gz          100% |=========================|  197 B    00:00    
    --> Finished Dependency Resolution

    Dependencies Resolved

    =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Updating:
     SysVinit                x86_64     2.86-15.el5      base              117 k
     audit-libs              x86_64     1.7.17-3.el5     base               78 k
     authconfig              x86_64     5.3.21-6.el5     base              454 k
     bash                    x86_64     3.2-24.el5       base              1.9 M
     bzip2                   x86_64     1.0.3-6.el5_5    updates            50 k
     bzip2-libs              x86_64     1.0.3-6.el5_5    updates            35 k
     centos-release-notes    x86_64     5.5-0            base               39 k
     chkconfig               x86_64     1.3.30.2-2.el5   base              159 k
     coreutils               x86_64     5.97-23.el5_4.2  base              3.5 M
     cyrus-sasl-lib          x86_64     2.1.22-5.el5_4.3  base              130 k
     db4                     x86_64     4.3.29-10.el5_5.2  updates           899 k
     device-mapper           x86_64     1.02.39-1.el5_5.2  updates           758 k
     dhclient                x86_64     12:3.0.5-23.el5_5.2  updates           282 k
     e2fsprogs               x86_64     1.39-23.el5_5.1  updates           995 k
     e2fsprogs-libs          x86_64     1.39-23.el5_5.1  updates           118 k
     elfutils-libelf         x86_64     0.137-3.el5      base               53 k
     ethtool                 x86_64     6-4.el5          base               64 k
     expat                   x86_64     1.95.8-8.3.el5_5.3  updates            76 k
     filesystem              x86_64     2.4.0-3.el5      base              1.0 M
     findutils               x86_64     1:4.2.27-6.el5   base              294 k
     glib2                   x86_64     2.12.3-4.el5_3.1  base              693 k
     grep                    x86_64     2.5.1-55.el5     base              176 k
     gzip                    x86_64     1.3.5-11.el5.centos.1  base              104 k
     initscripts             x86_64     8.45.30-3.el5.centos  updates           1.6 M
     iproute                 x86_64     2.6.18-11.el5    base              822 k
     iputils                 x86_64     20020927-46.el5  base              131 k
     krb5-libs               x86_64     1.6.1-36.el5_5.6  updates           675 k
     less                    x86_64     436-2.el5        base              107 k
     libacl                  x86_64     2.2.39-6.el5     base               19 k
     libgcc                  x86_64     4.1.2-48.el5     base               98 k
     libselinux              x86_64     1.33.4-5.5.el5   base               77 k
     libsepol                x86_64     1.15.2-3.el5     base              131 k
     libstdc++               x86_64     4.1.2-48.el5     base              352 k
     libuser                 x86_64     0.54.7-2.1.el5_4.1  base              450 k
     libxml2                 x86_64     2.6.26-2.1.2.8.el5_5.1  updates           807 k
     m2crypto                x86_64     0.16-6.el5.6     base              494 k
     mcstrans                x86_64     0.2.11-3.el5     base               17 k
     module-init-tools       x86_64     3.3-0.pre3.1.60.el5_5.1  updates           443 k
     newt                    x86_64     0.52.2-15.el5    base              113 k
     nspr                    x86_64     4.8.6-1.el5_5    updates           119 k
     nss                     x86_64     3.12.8-1.el5.centos  updates           1.1 M
     openldap                x86_64     2.3.43-12.el5_5.3  updates           303 k
     openssh                 x86_64     4.3p2-41.el5_5.1  updates           287 k
     openssh-clients         x86_64     4.3p2-41.el5_5.1  updates           450 k
     openssh-server          x86_64     4.3p2-41.el5_5.1  updates           274 k
     openssl                 x86_64     0.9.8e-12.el5_4.6  base              1.4 M
     pam                     x86_64     0.99.6.2-6.el5_5.2  updates           978 k
     popt                    x86_64     1.10.2.3-20.el5_5.1  updates            77 k
     procps                  x86_64     3.2.7-16.el5     base              214 k
     psmisc                  x86_64     22.2-7           base               62 k
     python                  x86_64     2.4.3-27.el5_5.3  updates           6.0 M
     python-urlgrabber       noarch     3.1.0-5.el5      base              131 k
     readline                x86_64     5.1-3.el5        base              228 k
     rpm                     x86_64     4.4.2.3-20.el5_5.1  updates           1.2 M
     rpm-libs                x86_64     4.4.2.3-20.el5_5.1  updates           923 k
     rpm-python              x86_64     4.4.2.3-20.el5_5.1  updates            63 k
     setup                   noarch     2.5.58-7.el5     base              125 k
     shadow-utils            x86_64     2:4.0.17-15.el5  base              1.1 M
     sqlite                  x86_64     3.3.6-5          base              206 k
     sysklogd                x86_64     1.4.1-46.el5     base               76 k
     tcp_wrappers            x86_64     7.6-40.7.el5     base              112 k
     tzdata                  x86_64     2010l-1.el5      updates           796 k
     tzdata                  noarch     2010e-1.el5      base              794 k
     udev                    x86_64     095-14.21.el5_5.1  updates           2.4 M
     usermode                x86_64     1.88-3.el5.2     base              155 k
     util-linux              x86_64     2.13-0.52.el5_4.1  base              1.8 M
     wget                    x86_64     1.11.4-2.el5_4.1  base              582 k
     yum                     noarch     3.2.22-26.el5.centos  base              1.0 M
     yum-fastestmirror       noarch     1.1.16-14.el5.centos.1  base               19 k
     yum-metadata-parser     x86_64     1.1.2-3.el5.centos  base               25 k
    Installing for dependencies:
     binutils                x86_64     2.17.50.0.6-14.el5  base              2.9 M
     cpio                    x86_64     2.6-23.el5_4.1   base              122 k
     crontabs                noarch     1.10-8           base              5.0 k
     device-mapper-event     x86_64     1.02.39-1.el5_5.2  updates            21 k
     device-mapper-multipath  x86_64     0.4.7-34.el5_5.6  updates           3.0 M
     dmraid                  x86_64     1.0.0.rc13-63.el5  base              741 k
     dmraid-events           x86_64     1.0.0.rc13-63.el5  base               24 k
     fipscheck               x86_64     1.2.0-1.el5      base               13 k
     fipscheck-lib           x86_64     1.2.0-1.el5      base              6.7 k
     hmaccalc                x86_64     0.9.6-3.el5      base               21 k
     kpartx                  x86_64     0.4.7-34.el5_5.6  updates           434 k
     libsysfs                x86_64     2.0.0-6          base               45 k
     logrotate               x86_64     3.7.4-9.el5_5.2  updates            41 k
     lvm2                    x86_64     2.02.56-8.el5_5.6  updates           2.7 M
     mkinitrd                x86_64     5.1.19.6-61.el5_5.2  updates           454 k
     nash                    x86_64     5.1.19.6-61.el5_5.2  updates           1.1 M
     sgpio                   x86_64     1.2.0_10-2.el5   base               11 k
     tar                     x86_64     2:1.15.1-30.el5  base              747 k

    Transaction Summary
    =============================================================================
    Install     18 Package(s)        
    Update      70 Package(s)        
    Remove       0 Package(s)        

    Total download size: 53 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/88): openssh-server-4. 100% |=========================| 274 kB    00:00    
    (2/88): iproute-2.6.18-11 100% |=========================| 822 kB    00:00    
    (3/88): rpm-libs-4.4.2.3- 100% |=========================| 923 kB    00:00    
    (4/88): logrotate-3.7.4-9 100% |=========================|  41 kB    00:00    
    (5/88): glib2-2.12.3-4.el 100% |=========================| 693 kB    00:00    
    (6/88): util-linux-2.13-0 100% |=========================| 1.8 MB    00:00    
    (7/88): module-init-tools 100% |=========================| 443 kB    00:00    
    (8/88): less-436-2.el5.x8 100% |=========================| 107 kB    00:00    
    (9/88): tcp_wrappers-7.6- 100% |=========================| 112 kB    00:00    
    (10/88): libgcc-4.1.2-48. 100% |=========================|  98 kB    00:00    
    (11/88): libuser-0.54.7-2 100% |=========================| 450 kB    00:00    
    (12/88): setup-2.5.58-7.e 100% |=========================| 125 kB    00:00    
    (13/88): libstdc++-4.1.2- 100% |=========================| 352 kB    00:00    
    (14/88): ethtool-6-4.el5. 100% |=========================|  64 kB    00:00    
    (15/88): chkconfig-1.3.30 100% |=========================| 159 kB    00:00    
    (16/88): dmraid-1.0.0.rc1 100% |=========================| 741 kB    00:00    
    (17/88): readline-5.1-3.e 100% |=========================| 228 kB    00:00    
    (18/88): yum-fastestmirro 100% |=========================|  19 kB    00:00    
    (19/88): fipscheck-lib-1. 100% |=========================| 6.7 kB    00:00    
    (20/88): udev-095-14.21.e 100% |=========================| 2.4 MB    00:00    
    (21/88): libselinux-1.33. 100% |=========================|  77 kB    00:00    
    (22/88): SysVinit-2.86-15 100% |=========================| 117 kB    00:00    
    (23/88): sqlite-3.3.6-5.x 100% |=========================| 206 kB    00:00    
    (24/88): cpio-2.6-23.el5_ 100% |=========================| 122 kB    00:00    
    (25/88): usermode-1.88-3. 100% |=========================| 155 kB    00:00    
    (26/88): filesystem-2.4.0 100% |=========================| 1.0 MB    00:00    
    (27/88): cyrus-sasl-lib-2 100% |=========================| 130 kB    00:00    
    (28/88): elfutils-libelf- 100% |=========================|  53 kB    00:00    
    (29/88): libsepol-1.15.2- 100% |=========================| 131 kB    00:00    
    (30/88): device-mapper-ev 100% |=========================|  21 kB    00:00    
    (31/88): lvm2-2.02.56-8.e 100% |=========================| 2.7 MB    00:00    
    (32/88): bzip2-1.0.3-6.el 100% |=========================|  50 kB    00:00    
    (33/88): openssl-0.9.8e-1 100% |=========================| 1.4 MB    00:00    
    (34/88): e2fsprogs-libs-1 100% |=========================| 118 kB    00:00    
    (35/88): dmraid-events-1. 100% |=========================|  24 kB    00:00    
    (36/88): tar-1.15.1-30.el 100% |=========================| 747 kB    00:00    
    (37/88): dhclient-3.0.5-2 100% |=========================| 282 kB    00:00    
    (38/88): mkinitrd-5.1.19. 100% |=========================| 454 kB    00:00    
    (39/88): centos-release-n 100% |=========================|  39 kB    00:00    
    (40/88): grep-2.5.1-55.el 100% |=========================| 176 kB    00:00    
    (41/88): tzdata-2010e-1.e 100% |=========================| 794 kB    00:00    
    (42/88): binutils-2.17.50 100% |=========================| 2.9 MB    00:00    
    (43/88): device-mapper-mu 100% |=========================| 3.0 MB    00:00    
    (44/88): python-urlgrabbe 100% |=========================| 131 kB    00:00    
    (45/88): fipscheck-1.2.0- 100% |=========================|  13 kB    00:00    
    (46/88): popt-1.10.2.3-20 100% |=========================|  77 kB    00:00    
    (47/88): yum-3.2.22-26.el 100% |=========================| 1.0 MB    00:00    
    (48/88): nspr-4.8.6-1.el5 100% |=========================| 119 kB    00:00    
    (49/88): python-2.4.3-27. 100% |=========================| 6.0 MB    00:00    
    (50/88): yum-metadata-par 100% |=========================|  25 kB    00:00    
    (51/88): device-mapper-1. 100% |=========================| 758 kB    00:00    
    (52/88): expat-1.95.8-8.3 100% |=========================|  76 kB    00:00    
    (53/88): sgpio-1.2.0_10-2 100% |=========================|  11 kB    00:00    
    (54/88): mcstrans-0.2.11- 100% |=========================|  17 kB    00:00    
    (55/88): shadow-utils-4.0 100% |=========================| 1.1 MB    00:00    
    (56/88): sysklogd-1.4.1-4 100% |=========================|  76 kB    00:00    
    (57/88): nss-3.12.8-1.el5 100% |=========================| 1.1 MB    00:00    
    (58/88): authconfig-5.3.2 100% |=========================| 454 kB    00:00    
    (59/88): libsysfs-2.0.0-6 100% |=========================|  45 kB    00:00    
    (60/88): coreutils-5.97-2 100% |=========================| 3.5 MB    00:00    
    (61/88): tzdata-2010l-1.e 100% |=========================| 796 kB    00:00    
    (62/88): iputils-20020927 100% |=========================| 131 kB    00:00    
    (63/88): bash-3.2-24.el5. 100% |=========================| 1.9 MB    00:00    
    (64/88): e2fsprogs-1.39-2 100% |=========================| 995 kB    00:00    
    (65/88): pam-0.99.6.2-6.e 100% |=========================| 978 kB    00:00    
    (66/88): libacl-2.2.39-6. 100% |=========================|  19 kB    00:00    
    (67/88): kpartx-0.4.7-34. 100% |=========================| 434 kB    00:00    
    (68/88): hmaccalc-0.9.6-3 100% |=========================|  21 kB    00:00    
    (69/88): initscripts-8.45 100% |=========================| 1.6 MB    00:00    
    (70/88): crontabs-1.10-8. 100% |=========================| 5.0 kB    00:00    
    (71/88): krb5-libs-1.6.1- 100% |=========================| 675 kB    00:00    
    (72/88): db4-4.3.29-10.el 100% |=========================| 899 kB    00:00    
    (73/88): procps-3.2.7-16. 100% |=========================| 214 kB    00:00    
    (74/88): audit-libs-1.7.1 100% |=========================|  78 kB    00:00    
    (75/88): psmisc-22.2-7.x8 100% |=========================|  62 kB    00:00    
    (76/88): findutils-4.2.27 100% |=========================| 294 kB    00:00    
    (77/88): m2crypto-0.16-6. 100% |=========================| 494 kB    00:00    
    (78/88): openldap-2.3.43- 100% |=========================| 303 kB    00:00    
    (79/88): nash-5.1.19.6-61 100% |=========================| 1.1 MB    00:00    
    (80/88): openssh-4.3p2-41 100% |=========================| 287 kB    00:00    
    (81/88): gzip-1.3.5-11.el 100% |=========================| 104 kB    00:00    
    (82/88): libxml2-2.6.26-2 100% |=========================| 807 kB    00:00    
    (83/88): bzip2-libs-1.0.3 100% |=========================|  35 kB    00:00    
    (84/88): rpm-4.4.2.3-20.e 100% |=========================| 1.2 MB    00:00    
    (85/88): newt-0.52.2-15.e 100% |=========================| 113 kB    00:00    
    (86/88): openssh-clients- 100% |=========================| 450 kB    00:00    
    (87/88): wget-1.11.4-2.el 100% |=========================| 582 kB    00:00    
    (88/88): rpm-python-4.4.2 100% |=========================|  63 kB    00:00    
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating  : bash                         ##################### [  1/157] 


  • Outsourced VPS Support


    The Xen VPS I had was not working properly and when they asked for the login information I found the support was coming directly from India:

     

    whois 122.178.148.*
    [Querying whois.apnic.net]
    [whois.apnic.net]
    % [whois.apnic.net node-5]
    % Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

    inetnum:        122.178.128.0 - 122.178.191.255
    netname:        BNLT-256821-Chennai
    descr:          Bharti Telenet Ltd. Tamilnadu
    descr:          B.no101
    descr:          SANTHOME HIGH ROAD
    descr:          FORESHORE ESTATE
    descr:          Chennai
    descr:          Tamil Nadu
    descr:          India
    descr:          Contact Person: Narasimhan. k.r
    descr:          Email: kr.narasimhan@airtel.in
    descr:          Phone: 9840299134
    country:        IN
    admin-c:        NA40-AP
    tech-c:         NA40-AP
    mnt-by:         MAINT-IN-BBIL
    status:         ASSIGNED NON-PORTABLE
    changed:        rar.data@airtel.in 20100111
    source:         APNIC

    route:          122.178.148.0/24
    descr:          ABTS-TN-DSL-CBT
    descr:          ABTS Tamilnadu
    descr:          DSL Services 101,
    descr:          Santhome High Road,
    descr:          Coimbtore, Tamilnadu
    descr:          INDIA
    country:        IN
    origin:         AS24560
    mnt-by:         MAINT-IN-TELEMEDIA
    changed:        blrdslnoc@airtel.in 20090723
    source:         APNIC

    person:         Network Administrator
    nic-hdl:        NA40-AP
    e-mail:         rar.data@airtel.in
    address:        Bharti Airtel Ltd.
    address:        ISP Division - Transport Network Group
    address:        234 , Okhla Industrial Estate,
    address:        Phase III, New Delhi-110020, INDIA
    phone:          +91-11- 4161 5050
    fax-no:         +91-11- 4171 1050
    country:        IN
    changed:        techsupport@bharti.com 20081023
    mnt-by:         MAINT-IN-BBIL
    source:         APNIC
     


  • bash script count unique/dupllicate lines in a file


    For many reasons you may be dealing with a standard text file and you want to know if there are any duplicate lines:

    Here's how you do it:

    cat filename|uniq -c

    The "uniq -c" program counts how many time each line occurs.


  • VirtualBox Convert Import/Boot .vmdk VMWare Hard Disk/Drive Image Won't Work


    I wanted to Import/Use a .vmdk hard disk image file from VMWare.  Generally you can just "point" VirtualBox to it and use it and it will work but I found an exception.

    One of my Centos 4.4 x64 images wouldn't boot.  I had two copies, an older one and the newer one.  The older one booted as normal (once I changed the VirtualBox driver to IDE from SATA).  The newer one stopped at the "GRUB loading" message no matter what I tried.

    As far as I can tell the size of the image was being reported incorrectly and perhaps this is a fallback/failure of Virtualbox to account for a situation with virtual disk files. 

    The solution to boot this .vmdk was to convert using QEMU

    qemu-img convert /location/of/your.vmdk your.bin

    Then use VBoxManage to convert the QEMU image back to a native VirtualBox Image

    VBoxManage convertdd your.bin your.vdi

    After doing the above I was able to make the VMWare image boot.

    I imagine this has happened to a lot of people and makes them panic/abandon the idea of using their VMDK/VMWare hard disk image with VirtualBox.

    I also believe that the majority of them work fine.

    To make things more scary, even if you boot using a LiveCD and have the .vmdk loaded, you won't be able to access the partitions unless you've done the conversion and this is what almost made me abandon the idea.  I thought I'd give the conversion a chance and was actually surprised that it worked since my other .vmdk images worked without modification and this one di dnot.


  • VMWare Server is on SSL port 8333


    I'm mentioning this because I keep forgetting what port the management is on for the web interface (since newer releases of VMWare server took away the superior stand alone client).

    So remember it is port 8333 and sometimes you need to restart vmware-mgmt service and also enable sslv2 in your Firefox or it won't connect.


  • VMWare Server cannot connect to web interface SSL Handshake on client connection failed: SSL Exception


    VMWare log: /var/log/vmware/hostd.log
    SSL Handshake on client connection failed: SSL Exception


    sudo /etc/init.d/vmware-mgmt restart
    Stopping VMware management services:
       VMware Virtual Infrastructure Web Access
       VMware Server Host Agent                                           failed
    Starting VMware management services:
       VMware Server Host Agent (background)                               done
       VMware Virtual Infrastructure Web Access

    Solution - Restart vmware-mgmt and enable sslv2 in Firefox


    Firefox - about:config
    Set this to true:


    security.enable_sslv2

    Then restart Firefox and you'll be good to go.


  • Ubuntu/Debian DRBD 8.0 Setup Guide


    I've only used it on Centos, so I thought I'd make a quick Debian guide:

    Install the DRBD Package

    apt-get install drbd8-utils
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      libswfdec-0.8-0
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      debconf-utils dpatch drbd8-source patchutils
    Suggested packages:
      curl heartbeat
    The following NEW packages will be installed:
      debconf-utils dpatch drbd8-source drbd8-utils patchutils
    0 upgraded, 5 newly installed, 0 to remove and 19 not upgraded.
    Need to get 644kB of archives.
    After this operation, 2,277kB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://mirror.its.uidaho.edu/pub/ubuntu/ lucid/main debconf-utils 1.5.28ubuntu4 [40.4kB]
    Get:2 http://mirror.its.uidaho.edu/pub/ubuntu/ lucid/main dpatch 2.0.31 [88.4kB]
    Get:3 http://mirror.its.uidaho.edu/pub/ubuntu/ lucid/main patchutils 0.3.1-2build1 [101kB]
    Get:4 http://mirror.its.uidaho.edu/pub/ubuntu/ lucid-updates/main drbd8-source 2:8.3.7-1ubuntu2.1 [220kB]
    Get:5 http://mirror.its.uidaho.edu/pub/ubuntu/ lucid-updates/main drbd8-utils 2:8.3.7-1ubuntu2.1 [195kB]
    Fetched 644kB in 0s (1,566kB/s)   
    Selecting previously deselected package debconf-utils.
    (Reading database ... 316693 files and directories currently installed.)
    Unpacking debconf-utils (from .../debconf-utils_1.5.28ubuntu4_all.deb) ...
    Selecting previously deselected package dpatch.
    Unpacking dpatch (from .../archives/dpatch_2.0.31_all.deb) ...
    Selecting previously deselected package patchutils.
    Unpacking patchutils (from .../patchutils_0.3.1-2build1_i386.deb) ...
    Selecting previously deselected package drbd8-source.
    Unpacking drbd8-source (from .../drbd8-source_2%3a8.3.7-1ubuntu2.1_all.deb) ...
    Selecting previously deselected package drbd8-utils.
    Unpacking drbd8-utils (from .../drbd8-utils_2%3a8.3.7-1ubuntu2.1_i386.deb) ...
    Processing triggers for man-db ...
    Processing triggers for ureadahead ...
    Setting up debconf-utils (1.5.28ubuntu4) ...

    Setting up dpatch (2.0.31) ...
    Setting up patchutils (0.3.1-2build1) ...
    Setting up drbd8-source (2:8.3.7-1ubuntu2.1) ...
    Loading new drbd8-8.3.7 DKMS files...
    First Installation: checking all kernels...
    Building only for 2.6.32-26-generic-pae
    Building for architecture i686
    Building initial module for 2.6.32-26-generic-pae
    Done.

    drbd.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/2.6.32-26-generic-pae/updates/dkms/

    grep: /etc/modprobe.d/drbd.conf: No such file or directory
    /etc/modprobe.d/drbd.conf: added 'options drbd cn_idx=7'
    depmod.....

    DKMS: install Completed.

    Setting up drbd8-utils (2:8.3.7-1ubuntu2.1) ...

    Configure DRBD / Edit /etc/drbd.conf

    vi /etc/drbd.conf

    # You can find an example in  /usr/share/doc/drbd.../drbd.conf.example

    #include "drbd.d/global_common.conf";
    #include "drbd.d/*.res";

    resource r0 {
      protocol A;

      handlers {
    #    pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
    #    pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
        local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
      }

       net {

       after-sb-0pri discard-older-primary;
       after-sb-1pri call-pri-lost-after-sb;
       after-sb-2pri call-pri-lost-after-sb;

       }

      startup {
        degr-wfc-timeout 120;
      }

      disk {
        on-io-error   call-local-io-error;
      }

      syncer {
        rate 80M;
        al-extents 257;
      }

      on QuadCoreAM2 {
        device    /dev/drbd0;
        disk      /dev/sdc3;
        address   192.168.1.125:7788;
        meta-disk internal;
      }

      on one-desktop {
        device    /dev/drbd0;
        disk      /dev/sdc3;
        address   192.168.1.115:7788;
        meta-disk internal;
      }
    }


    Copy drbd.conf to /etc on the other node (both configs must be the same)

    Start DRBD on the main node and then after the second node:

     

    service drbd start

            --== This is a new installation of DRBD ==--
    Please take part in the global DRBD usage count at http://usage.drbd.org.

    The counter works anonymously. It creates a random number to identify
    your machine and sends that random number, along with
    DRBD's version number, to usage.drbd.org.

    The benefits for you are:
     * In response to your submission, the server (usage.drbd.org) will tell you
       how many users before you have installed this version (8.3.7).
     * With a high counter LINBIT has a strong motivation to
       continue funding DRBD's development.

    http://usage.drbd.org/cgi-bin/insert_usage.pl?nu=15996461431638930486&git=ea9e28dbff98e331a62bcbcc63a6135808fe2917

    In case you want to participate but know that this machine is firewalled,
    simply issue the query string with your favorite web browser or wget.
    You can control all of this by setting 'usage-count' in your drbd.conf.

    * You may enter a free form comment about your machine, that gets
      used on usage.drbd.org instead of the big random number.
    * If you wish to opt out entirely, simply enter 'no'.
    * To count this node without comment, just press [RETURN]

     

    On the main node you will get this:

    * Starting DRBD resources                                                                                                                                   [ d(r0) 0: Failure: (119) No valid meta-data signature found.

        ==> Use 'drbdadm create-md res' to initialize meta-data area. <==


    [r0] cmd /sbin/drbdsetup 0 disk /dev/sdc3 /dev/sdc3 internal --set-defaults --create-device --on-io-error=call-local-io-error  failed - continuing!
     
    n(r0) ]..........
    ***************************************************************
     DRBD's startup script waits for the peer node(s) to appear.
     - In case this node was already a degraded cluster before the
       reboot the timeout is 120 seconds. [degr-wfc-timeout]
     - If the peer was available before the reboot the timeout will
       expire after 0 seconds. [wfc-timeout]
       (These values are for resource 'r0'; 0 sec -> wait forever)
     To abort waiting enter 'yes' [  27]:

     

    drbdsetup /dev/drbd0 primary
    /dev/drbd0: State change failed: (-2) Refusing to be Primary without at least one UpToDate disk
     

    drbdadm create-md r0

    I forgot that my sdc3 is an empty/unused ext3 so I got this error:

    md_offset 12839657472
    al_offset 12839624704
    bm_offset 12839231488

    Found ext3 filesystem
        12538732 kB data area apparently used
        12538312 kB left usable by current configuration

    Device size would be truncated, which
    would corrupt data and result in
    'access beyond end of device' errors.
    You need to either
       * use external meta data (recommended)
       * shrink that filesystem first
       * zero out the device (destroy the filesystem)
    Operation refused.

    Command 'drbdmeta 0 v08 /dev/sdc3 internal create-md' terminated with exit code 40
    drbdadm create-md r0: exited with code 40

    I did a dd if=/dev/zero of=/dev/sdc3 and it fixed it then I ran it again.

    drbdadm create-md r0

    Writing meta data...
    initializing activity log
    NOT initialized bitmap
    New drbd meta data block successfully created.

    I still can't run drbdsetup:

    drbdsetup /dev/drbd0 primary -o
    /dev/drbd0: State change failed: (-2) Refusing to be Primary without at least one UpToDate disk

    Both nodes with cat /proc/drbd are unconfigured

    GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@QuadCoreAM2, 2010-12-24 16:34:58
     0: cs:Unconfigured

    How to fix it:

    I restarted DRBD on the primary node and told it not to wait.

    service drbd start
     * Starting DRBD resources                                                                                                                                   [ d(r0) n(r0) ]..........
    ***************************************************************
     DRBD's startup script waits for the peer node(s) to appear.
     - In case this node was already a degraded cluster before the
       reboot the timeout is 120 seconds. [degr-wfc-timeout]
     - If the peer was available before the reboot the timeout will
       expire after 0 seconds. [wfc-timeout]
       (These values are for resource 'r0'; 0 sec -> wait forever)
     To abort waiting enter 'yes' [  17]:yes

                                                                                                                                                          [ OK ]

    Now DRBD is in WFConnection and Secondary mode, this is good:
    version: 8.3.7 (api:88/proto:86-91)
    GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@QuadCoreAM2, 2010-12-24 16:34:58
    m:res  cs            ro                 ds                     p  mounted  fstype
    0:r0   WFConnection  Secondary/Unknown  Inconsistent/DUnknown  A

         

    Make DRBD primary
    drbdsetup /dev/drbd0 primary -o

    Start DRBD on the second node and it will begin syncing:

    GIT-hash: 9ba8b93e24d842f0dd3fb1f9b90e8348ddb95829 build by ivoks@ubuntu, 2009-01-17 07:49:56
     0: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate A r---
        ns:0 nr:463808 dw:463552 dr:0 al:0 bm:27 lo:10 pe:367 ua:8 ap:0 ep:1 wo:b oos:12074760
        [>....................] sync'ed:  3.8% (11791/12244)M
        finish: 0:03:28 speed: 57,944 (57,944) K/sec

     


     


  • rsync preserve attributes, permissions/ownership and times without being root non-root user


    One of the purposes of rsync is to backup whole filesystems and archive them but how can you do that properly and restore things to normal if all permissions and ownerships are not preserved from your root filesystem?

    It's not desirable to have everything running as root, especially not just for an rsync.

    The Easy rsync preserve permission solution for non-root users

    sudo is the answer and all you have to do is edit /etc/sudoers

    At the end of the file add a line like below (on both source and all target rsync systems).

    *Replace "username" with your actual username of course

    username  ALL = NOPASSWD: /usr/bin/rsync

    The "NOPASSWD" part does as you'd expect, it allows you to sudo to the rsync command without requiring any password, otherwise it would be impossible to script this process and would make rsync useless for automated backups.

    Make sure you add the following when running your rsync backup:

    --rsync-path="sudo rsync"

    That flag ensures that the ownership and permissions can be preserved even as root on the target system for your non-root user.

    Also remember on the source systems to always run rsync with sudo

    Eg.

    sudo rsync -Pha --rsync-path="sudo rsync" --ignore-errors --exclude=/media  --exclude=/proc/* --exclude=/sys/* / user@destination:/location/
     


  • mdadm: metadata format 00.90 unknown, ignored.


    mdadm: metadata format 00.90 unknown, ignored.

    This happens with various versions of older mdadm such as mdadm - v2.6.7.1 - 15th October 2008

    It is all because an extra 0 in 00.90 in /etc/mdadm/mdadm.conf that it doesn't like (it doesn't seem to cause any problem except that message though):

    Solution - Edit your /etc/mdadm/mdadm.conf and change 00.90 to 0.90 in your arrays:

    ARRAY /dev/md3 level=raid1 num-devices=2 metadata=0.90 UUID=f41a4644:6b2a05f6:24055e35:10f66136
     


  • Ubuntu 10.04/GNOME Volume Control Missing From Panel/Indicator Applet


    What this really refers to is gnome-volume-control-applet which is what controls the volume in the panel/indicator applet.

    In Ubuntu 10.04 it is just the applet mentioned above, run that from the command line and it will start.

    I lost mine when I removed pulseaudio trying to fix audio issues with Flash and Opera.  It also removes the gnome-volume-control-applet from starting.  *I also note that reintsalling pulseaudio did not bring it back, it seems only an OS reinstall or manual intervention would bring it back.

    You need to add it to your startup applications to make sure it comes back after a reboot.


  • vmare server - Cannot open the disk '/mnt/sda4/vmware/Debian/hdd.vmdk' or one of the snapshot disks it depends on. Reason: Failed to lock the file.


    Go into the directory for your Virtual Machine and delete all ".lck" directories.

    rm -rf *.lck

    After that your server should boot.


  • rhythmbox & ecryptfs segfault crash


    It seems nearly anything can make rhythmbox crash, I've always found it buggy.

    This crash seems to be something related to ecryptfs but it's hard to say.  After re-opening rhythmbox so it sits in the Gnome panel/tray, and letting it load/find all of my songs let's it work again.  If I show it too soon (I wait 10-15 minutes for everything to scan first) then it will crash over and over.


    [171938.995645] ecryptfs_read_and_validate_header_region: Error reading header region; rc = [-4]
    [172093.798666] ecryptfs_read_and_validate_header_region: Error reading header region; rc = [-4]
    [172115.621410] rhythmbox[22266]: segfault at 3a6e7773 ip b4c036c7 sp b0207e90 error 4 in libgvfscommon.so.0.0.0[b4bf9000+14000]
    [172115.621466] ecryptfs_read_and_validate_header_region: Error reading header region; rc = [-4]
    [172136.867625] rhythmbox[22321]: segfault at 3 ip b6824a04 sp aed7ec18 error 4 in libc-2.11.1.so[b67b7000+153000]


  • How to see what's inside your gziped CPIO'd initrd image


    Copy the initrd to somewhere else, say /tmp:


    mv initrd.img to initrd.gz
    *the mv to .gz is needed otherwise gunzip won't work/it will refuse to operate without the correct .gz extension


    gunzip initrd.gz
    cat initrd | cpio -idmv


    The last command extracts the contents of initrd to your present working directory.


  • WD EARS Advanced Format Can't be fixed?


    There's no partial WD EARS alignment fix:

    I had data on /dev/sda3 and /dev/sdb3 (RAID1) so I couldn't edit that one.
    I thought I'd be smart and try fixing the first two partitions so I set the first one starting at sector 2048 and then +8 for the second partition.
    This has really slowed the performance down worse than it ever was!

    Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1            2048    29362176    14680064+  83  Linux
    /dev/sda2        29362184   146528864    58583340+  83  Linux
    /dev/sda3       146528865  3907024064  1880247600   83  Linux
     

    I wonder if by having two aligned partitions and my third being unaligned has thrown off performance on all partitions?  It doesn't make sense if that's the case.


  • Dying Seagate 7200.11 SD15


    [137392.910057] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x80000 action 0x6 frozen
    [137392.910077] ata4: SError: { 10B8B }
    [137392.910095] ata4.00: cmd 60/20:00:00:00:00/00:00:00:00:00/40 tag 0 ncq 16384 in
    [137392.910099]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
    [137392.910122] ata4.00: status: { DRDY }
    [137392.910135] ata4: hard resetting link
    [137393.440060] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    [137393.443642] ata4.00: configured for UDMA/133
    [137393.443661] ata4: EH complete
    [137393.443769] sd 3:0:0:0: [sdd] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [137393.443800] sd 3:0:0:0: [sdd] Write Protect is off
    [137393.443806] sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00
    [137393.443848] sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
     

    This drive/firmware is dying slowly.


  • md: data-check of RAID array md3


    This really made me nervous but notice the mdstat says "check".  This is because in Ubuntu there is a scheduled mdadm cronscript that runs everyday on Sunday at 00:57 that checks your entire array.  This is a good way because it prevents gradual but unnoticed data corruption which I never thought of.

    As long as the check completes properly you have peace of mind knowing that your data integretiy is assured and that your hard drives are functioning properly (I'd say it's smarter than relying on SMART).

     

    [462600.807836] md: data-check of RAID array md3
    [462600.807842] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
    [462600.807847] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check.
    [462600.807856] md: using 128k window, over a total of 943730240 blocks.


    Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
    md3 : active raid1 sda1[1] sdb1[0]
          943730240 blocks [2/2] [UU]
          [========>............]  check = 40.7% (384365440/943730240) finish=113.5min speed=82086K/sec
         
    unused devices: <none>



    ls /etc/cron.d
    anacron  mdadm  php5  sysstat


    cat mdadm
    #
    # cron.d/mdadm -- schedules periodic redundancy checks of MD devices
    #
    # Copyright © martin f. krafft <madduck@madduck.net>
    # distributed under the terms of the Artistic Licence 2.0
    #

    # By default, run at 00:57 on every Sunday, but do nothing unless the day of
    # the month is less than or equal to 7. Thus, only run on the first Sunday of
    # each month. crontab(5) sucks, unfortunately, in this regard; therefore this
    # hack (see #380425).
    57 0 * * 0 root [ -x /usr/share/mdadm/checkarray ] && [ $(date +%d) -le 7 ] && /usr/share/mdadm/checkarray --cron --all --quiet
     


  • Cygwin and crontab backups via ssh/scp/rsync


    Install the "Editors" and "Net" groups that will give you rsync, ssh, ssh-keygen and cron.

    The trickiest thing that I keep forgetting about each time is you have to run "cron-config" which adds the cron service to Windows, and without doing that obviously no cron jobs will be run thus making automatic backups impossible.

    Warning about rsync/cygwin and using the -a archive switch.

    It's a good thing I caught this because it doesn't work right when trying to use -a.  I noticed many directories would be created on the Linux side with permissions of 000, almost at random.  In plain English if you use the -a switch or try to preserve permissions then you are pretty much guaranteed that not all of the expected files and directories will be backed up by your rsync script.  Supposedly this is not a bug but the fact that Windows filesystem permissions do not always translate to expected/sensible results on the Linux end.  I personally believe cygwin or rsync should handle this and ensure that any directories are created with a least permissions of 700 to make sure the issue I found doesn't occur.  I can only imagine how many sorry people are out there who can't understand why their rsync backups seemed to fail or only backup some files they expected.

    I got a lot of Error 13's/permission denied to write from rsync on the receiving end which was a Linux host.   I fixed it by doing a "chmod -R 755 *" on the entire directory path.  But the true fix is to not use the "-a" switch or to preserve permissions at all.

    Here are the settings I use to rsync Windows files to Linux:

    rsync -Phrt --ignore-errors /directory user@host:~/path

    P displays the progress

    h gives human readable info

    r is recursive so you don't miss any subdirectories/files

    t preserves the timestamp which does not cause any issues and works fine.


  • mdadm/md-check how to check array integrity without rebuilding


    This doesn't seem to be widely known (maybe it's in some documentation that none of us read though) but there's an easy way to check the integrity of any mdadm array:

    sudo echo check > /sys/block/md0/md/sync_action
    -bash: /sys/block/md0/md/sync_action: Permission denied

    sudo will never work, this only works as root since echo is not actually a binary/command.  It is built-into bash.


    /sys/devices/virtual/block/md0/md# echo check >sync_action
     cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md_d1 : inactive sdc2[1](S)
          20490816 blocks
          
    md0 : active raid1 sda1[0] sdc1[1]
          943730240 blocks [2/2] [UU]
          [>....................]  check =  0.0% (424768/943730240) finish=111.0min speed=141589K/sec
         
    unused devices: <none>

     

    In dmesg you'll see the following:

    [ 1761.813250] md: data-check of RAID array md0
    [ 1761.813257] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
    [ 1761.813263] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check.
    [ 1761.813273] md: using 128k window, over a total of 943730240 blocks.
    [11451.021752] md: md0: data-check done.
    [32917.662549] md: data-check of RAID array md0
    [32917.662556] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
    [32917.662562] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check.
    [32917.662571] md: using 128k window, over a total of 943730240 blocks.
     

    When it's done you'll see this:

    [11451.021752] md: md0: data-check done.

     

    When there's corruption I have no idea what you'd see, maybe in mdstat you'll see a bad disk is off-line and marked as failed and an entry in dmesg/messages that the check is failed or completed with errors.  Just a guess, I've never seen any example of reference on the net about what happens or what is said if there is an inconsistency found.  Distributions like Ubuntu have a cronjob/script that check the array once a week though.


  • Walmart.ca & Ubuntu Caused Xorg 100% CPU usage


    I can't tell if it's Flash or Javascript that they were using, but it basically caused my sysetm to lockup until I closed that one page.  Is this proof enough that Wal-mart is evil? :)

    I've never seen that before, it's weird how certain things mask themselves as high CPU usage with Xorg, unless it is some kind of weird Xorg problem but I believe it's more of a Flash/Javascript issue from Firefox in Wal-mart's evil scripting.


  • Linux Realtek Gigabit NIC huge/high latency problem after sleep?


    That is pinging to the gateway IP on the same switch, the same IP is pingable externally without any problems which makes me think the switch is fine.

    64 bytes from 55.55.55.55: icmp_seq=4 ttl=255 time=1.07 ms
    64 bytes from 55.55.55.55: icmp_seq=1 ttl=255 time=3536 ms
    64 bytes from 55.55.55.55: icmp_seq=2 ttl=255 time=2536 ms
    64 bytes from 55.55.55.55: icmp_seq=3 ttl=255 time=1536 ms
    64 bytes from 55.55.55.55: icmp_seq=8 ttl=255 time=1.20 ms
    64 bytes from 55.55.55.55: icmp_seq=5 ttl=255 time=3636 ms
    64 bytes from 55.55.55.55: icmp_seq=6 ttl=255 time=2636 ms
    64 bytes from 55.55.55.55: icmp_seq=7 ttl=255 time=1636 ms
    64 bytes from 55.55.55.55: icmp_seq=12 ttl=255 time=0.597 ms
    64 bytes from 55.55.55.55: icmp_seq=9 ttl=255 time=3734 ms
    64 bytes from 55.55.55.55: icmp_seq=10 ttl=255 time=2735 ms
    64 bytes from 55.55.55.55: icmp_seq=11 ttl=255 time=1735 ms

    This server hadnt' been accessed in days and at first responded normally and then started doing the above.  I did a network restart on the server and then it's been fine ever since.

    Is it possible the NIC was put to sleep and then didn't come back properly, kind of like laptop WiFi after sleep?


  • ntpdate[30630]: no servers can be used, exiting


    You're not supposed to call ntpdate like that, it's part of the server and needs a bunch of different arguments.

    The chances are if your time is out of sync and you installed ntpd, you need to start the ntpd service.


  • SSH delay problem UseDNS and disabling GSSAPI does not help


    The normal solution doesn't help or apply here:

     

    ssh -v user@192.168.5.41
    OpenSSH_4.3p2 Debian-9etch3, OpenSSL 0.9.8c 05 Sep 2006
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug1: Connecting to 192.168.5.41 [192.168.5.41] port 22.
    debug1: Connection established.
    debug1: permanently_set_uid: 0/0
    debug1: identity file /root/.ssh/identity type -1
    debug1: identity file /root/.ssh/id_rsa type 1
    debug1: identity file /root/.ssh/id_dsa type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
    debug1: match: OpenSSH_4.3 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.3p2 Debian-9etch3
    debug1: An invalid name was supplied
    Cannot determine realm for numeric host address

    debug1: An invalid name was supplied
    A parameter was malformed
    Validation error

    debug1: An invalid name was supplied
    Cannot determine realm for numeric host address

    debug1: An invalid name was supplied
    A parameter was malformed
    Validation error

    This almost seems like a conflict between the SSH client in Ubuntu and server in Centos.  However, this connection (client) is behind a VMWare NAT server so I'm not sure if that plays a role.


  • mdadm Centos 5 automatic resync


    This made me nervous but it's clearly a cronjob based on the messages log that happens every Sunday at about 4:22.

    I actually can't find any evidence of it in cron.d cron.daily but it is there somewhere obviously.

    What I don't get is why doesn't this cronjob do a datacheck like Ubuntu's cronscript does?  When you unnecessarily rebuild the array you lose your redundancy during that point which makes your data extremely vulnerable.

    *Update I did a grep of "mdadm" in etc but this wouldnt' have come up.

    I found the following script is responsible for this "/etc/cron.weekly/99-raid-check".  It gets its config from /etc/sysconfig/raidcheck

     

    Jan  9 04:22:01 server05 kernel: md: syncing RAID array md1
    Jan  9 04:22:01 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Jan  9 04:22:01 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Jan  9 04:22:01 server05 kernel: md: using 128k window, over a total of 29302464 blocks.
    Jan  9 04:22:01 server05 kernel: md: delaying resync of md2 until md1 has finished resync (they share one or more physical units)
    Jan  9 04:27:00 server05 kernel: md: md1: sync done.
    Jan  9 04:27:00 server05 kernel: md: syncing RAID array md2
    Jan  9 04:27:00 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Jan  9 04:27:00 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Jan  9 04:27:00 server05 kernel: md: using 128k window, over a total of 488287552 blocks.
    Jan  9 06:30:18 server05 kernel: md: md2: sync done.
    Jan  2 04:22:01 server05 kernel: md: syncing RAID array md1
    Jan  2 04:22:01 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Jan  2 04:22:01 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Jan  2 04:22:01 server05 kernel: md: using 128k window, over a total of 29302464 blocks.
    Jan  2 04:26:57 server05 kernel: md: md1: sync done.
    Dec 26 04:22:01 server05 kernel: md: syncing RAID array md1
    Dec 26 04:22:01 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Dec 26 04:22:01 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Dec 26 04:22:01 server05 kernel: md: using 128k window, over a total of 29302464 blocks.
    Dec 26 04:26:44 server05 kernel: md: md1: sync done.
    Dec 19 04:22:01 server05 kernel: md: syncing RAID array md1
    Dec 19 04:22:01 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Dec 19 04:22:01 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Dec 19 04:22:01 server05 kernel: md: using 128k window, over a total of 29302464 blocks.
    Dec 19 04:22:01 server05 kernel: md: delaying resync of md2 until md1 has finished resync (they share one or more physical units)
    Dec 19 04:27:05 server05 kernel: md: md1: sync done.
    Dec 19 04:27:05 server05 kernel: md: syncing RAID array md2
    Dec 19 04:27:05 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Dec 19 04:27:05 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Dec 19 04:27:05 server05 kernel: md: using 128k window, over a total of 488287552 blocks.
    Dec 19 06:28:14 server05 kernel: md: md2: sync done.
    Dec 12 04:22:01 server05 kernel: md: syncing RAID array md1
    Dec 12 04:22:01 server05 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Dec 12 04:22:01 server05 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Dec 12 04:22:01 server05 kernel: md: using 128k window, over a total of 29302464 blocks.
    Dec 12 04:26:44 server05 kernel: md: md1: sync done.


  • crontab/cronjob running multiple times at the wrong time


    crontab not working
    It is running as user Apache

    I've tried 0 0 * * * (which means midnight 00:00) and it does run at midnight but also 13:25 for some reason?
    25 0 * * * with this it runs at 00:25 but again also at 13:25

    Solution - Restart the Cron Service (especially if you changed your time/timezone)

    *Update I had a suspicion that changing the timezone a few weeks ago caused this.  I restarted lhe cron service and the problem hasn't come back


  • Virtualmin/Webmin Postfix Error: The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active ..


    Virtualmin Postfix Error:

    The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active ..

          A problem was found with your Postfix virtual maps : No map sources were found in the Postfix configuration

    .. your system is not ready for use by Virtualmin.

    <-

    Solution

     

    1.) Make sure postfix is started:
    service postfix start
    *It takes awhile to start.
    2.)In Webmin Click Servers->Postfix Mail Server (this takes a few minutes to load).
    3.)Go to Virtual Domains (near top left).
    Set "Map specifications" to hash:/etc/postfix/virtual

    Click -> Save And Apply



    The Read User Mail module is not setup to use the Postfix mail server. Either adjust its module configuration to match, or change the Virtualmin configuration.


    Servers -> Read User Mail -> Module Config:
    *System configuration
    Mail server installed : Set to Autodetect


    Quotas are not enabled on the filesystem / which contains home directories under /home and email files under /var/spool/mail. Quota editing has been disabled.

     


  • Installing Webmin & Enabling SSL


    Webmin Setup Centos 5:

    wget http://downloads.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530-1.noarch.rpm?r=http%3A%2F%2Fwww.webmin.com%2Fstandard.html&ts=1294339690&use_mirror=surfnet
    [1] 24229
    [2] 24230
    [root@host ~]# --2011-01-06 21:48:20--  http://downloads.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530-1.noarch.rpm?r=http%3A%2F%2Fwww.webmin.com%2Fstandard.html
    Resolving downloads.sourceforge.net... 216.34.181.59
    Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://superb-sea2.dl.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530-1.noarch.rpm [following]
    --2011-01-06 21:48:20--  http://superb-sea2.dl.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530-1.noarch.rpm
    Resolving superb-sea2.dl.sourceforge.net... 209.160.57.180
    Connecting to superb-sea2.dl.sourceforge.net|209.160.57.180|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 16133333 (15M) [application/octet-stream]
    Saving to: `webmin-1.530-1.noarch.rpm'

    100%[===========================================================>] 16,133,333  4.89M/s   in 3.7s   

    2011-01-06 21:48:24 (4.21 MB/s) - `webmin-1.530-1.noarch.rpm' saved [16133333/16133333]

    rpm -ivh webmin-1.530-1.noarch.rpm
    warning: webmin-1.530-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 11f63c51
    Preparing...                ########################################### [100%]
    Operating system is CentOS Linux
       1:webmin                 ########################################### [100%]
    Webmin install complete. You can now login to http://yourip.com:10000/
    as root with your root password.
    [1]-  Done                    wget http://downloads.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530-1.noarch.rpm?r=http%3A%2F%2Fwww.webmin.com%2Fstandard.html
    [2]+  Done                    ts=1294339690

    ========
    This isn't smart webmin is not configured with mandatory and default SSL so it is extremely insecure.  Imagine if the password is sniffed, then the person has root on your server!


    yum install openssl-devel

    Download Perl SSL module SSLeay:

    wget http://download.webmin.com/download/Net_SSLeay.pm-1.23.tar.gz

    tar zxvf Net_SSLeay.pm-1.23.tar.gz
    Net_SSLeay.pm-1.23/
    Net_SSLeay.pm-1.23/ptrcasttst.c
    Net_SSLeay.pm-1.23/MANIFEST
    Net_SSLeay.pm-1.23/RECIPE.Win32
    Net_SSLeay.pm-1.23/Changes
    Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50/
    Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50/Makefile.PL
    Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50/MANIFEST
    Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50/test.pl
    Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50/Handle.pm
    Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50/Changes
    Net_SSLeay.pm-1.23/examples/
    Net_SSLeay.pm-1.23/examples/get_page.pl
    Net_SSLeay.pm-1.23/examples/bio.pl
    Net_SSLeay.pm-1.23/examples/makecert.pl
    Net_SSLeay.pm-1.23/examples/cb-testi.pl
    Net_SSLeay.pm-1.23/examples/ephemeral.pl
    Net_SSLeay.pm-1.23/examples/cli-cert.pl
    Net_SSLeay.pm-1.23/examples/bulk.pl
    Net_SSLeay.pm-1.23/examples/get_page_cert.pl
    Net_SSLeay.pm-1.23/examples/req.conf
    Net_SSLeay.pm-1.23/examples/sslecho.pl
    Net_SSLeay.pm-1.23/examples/https-proxy-snif.pl
    Net_SSLeay.pm-1.23/examples/ssl_diff.pl
    Net_SSLeay.pm-1.23/examples/sslcat.pl
    Net_SSLeay.pm-1.23/examples/get_authenticated_page.pl
    Net_SSLeay.pm-1.23/examples/passwd-cb.pl
    Net_SSLeay.pm-1.23/examples/ssl-inetd-serv.pl
    Net_SSLeay.pm-1.23/examples/minicli.pl
    Net_SSLeay.pm-1.23/examples/stdio_bulk.pl
    Net_SSLeay.pm-1.23/examples/callback.pl
    Net_SSLeay.pm-1.23/examples/server_key.pem
    Net_SSLeay.pm-1.23/SSLeay.pm
    Net_SSLeay.pm-1.23/.rnd
    Net_SSLeay.pm-1.23/README
    Net_SSLeay.pm-1.23/SSLeay.xs
    Net_SSLeay.pm-1.23/test.pl
    Net_SSLeay.pm-1.23/Makefile.PL
    Net_SSLeay.pm-1.23/QuickRef
    Net_SSLeay.pm-1.23/README.Win32
    Net_SSLeay.pm-1.23/ptrtstrun.pl
    Net_SSLeay.pm-1.23/Credits
    Net_SSLeay.pm-1.23/typemap



    #cd Net_SSLeay.pm-1.23
    #perl Makefile.PL
    Checking for OpenSSL-0.9.6j or 0.9.7b or newer...
    You have OpenSSL-0.9.8e installed in /usr
    That's is newer than what this module was tested with (0.9.6j
    or 0.9.7b). You should
    consider checking if there is a newer release of this module
    available. Everything will probably work OK, though.
    *** Could not figure out which C compiler was used to compile /usr/bin/openssl. It is essentiall that OpenSSL, perl, and Net::SSLeay are compiled with the same compiler and flags. Mixing and matching compilers is not supported. at Makefile.PL line 140.
    Checking if your kit is complete...
    Looks good
    Checking if your kit is complete...
    Looks good
    Writing Makefile for Net::SSLeay::Handle
    Writing Makefile for Net::SSLeay
    [root@host Net_SSLeay.pm-1.23]# make install
    cp ptrtstrun.pl blib/lib/Net/ptrtstrun.pl
    cp SSLeay.pm blib/lib/Net/SSLeay.pm
    AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay)
    blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters:
     directory blib/lib/auto/Net/SSLeay:
      do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https
      get_https.al, get_https3.al, get_https4.al truncate to get_http
      head_https.al, head_https3.al, head_https4.al truncate to head_htt
      post_https.al, post_https3.al, post_https4.al truncate to post_htt
      put_https.al, put_https3.al, put_https4.al truncate to put_http
      ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
      ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
    make[1]: Entering directory `/root/Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50'
    cp Handle.pm ../blib/lib/Net/SSLeay/Handle.pm
    Manifying ../blib/man3/Net::SSLeay::Handle.3pm
    make[1]: Leaving directory `/root/Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50'
    /usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap  SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSLeay.c
    gcc -c  -I/usr/include -I/usr/inc32 -I/usr/kerberos/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O   -DVERSION="1.23" -DXS_VERSION="1.23" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"  -DPERL5 -DOPENSSL_NO_KRB5 SSLeay.c
    /bin/sh: gcc: command not found
    make: *** [SSLeay.o] Error 127

    yum install gcc-*

    make install

    make[1]: Entering directory `/root/Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50'
    Manifying ../blib/man3/Net::SSLeay::Handle.3pm
    make[1]: Leaving directory `/root/Net_SSLeay.pm-1.23/Net-SSLeay-Handle-0.50'
    gcc -c  -I/usr/include -I/usr/inc32 -I/usr/kerberos/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O   -DVERSION="1.23" -DXS_VERSION="1.23" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"  -DPERL5 -DOPENSSL_NO_KRB5 SSLeay.c
    SSLeay.c: In function ‘XS_Net__SSLeay_state_string’:
    SSLeay.c:2639: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_rstate_string’:
    SSLeay.c:2657: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_state_string_long’:
    SSLeay.c:2675: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_rstate_string_long’:
    SSLeay.c:2693: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_d2i_SSL_SESSION’:
    SSLeay.c:3142: warning: passing argument 2 of ‘d2i_SSL_SESSION’ from incompatible pointer type
    SSLeay.c: In function ‘XS_Net__SSLeay_alert_desc_string’:
    SSLeay.c:4891: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_alert_desc_string_long’:
    SSLeay.c:4909: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_alert_type_string’:
    SSLeay.c:4927: warning: assignment discards qualifiers from pointer target type
    SSLeay.c: In function ‘XS_Net__SSLeay_alert_type_string_long’:
    SSLeay.c:4945: warning: assignment discards qualifiers from pointer target type
    Running Mkbootstrap for Net::SSLeay ()
    chmod 644 SSLeay.bs
    rm -f blib/arch/auto/Net/SSLeay/SSLeay.so
    gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib SSLeay.o  -o blib/arch/auto/Net/SSLeay/SSLeay.so    
           -L/usr -L/usr/lib -lssl -lcrypto     
         
    chmod 755 blib/arch/auto/Net/SSLeay/SSLeay.so
    cp SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs
    chmod 644 blib/arch/auto/Net/SSLeay/SSLeay.bs
    Manifying blib/man3/Net::SSLeay.3pm
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/SSLeay.so
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/SSLeay.bs
    Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Net/SSLeay.pm
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Net/ptrtstrun.pl
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Net/SSLeay/Handle.pm
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/post_https3.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/make_headers.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/sslcat.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/randomize.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/open_tcp_connection.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/do_https4.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/head_https.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/dump_peer_certificate.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/do_https2.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/do_https.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/get_https3.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/set_proxy.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/open_proxy_tcp_connection.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/set_server_cert_and_key.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/debug_read.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/do_https3.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/put_https.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/put_https3.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/new_x_ctx.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/ssl_read_CRLF.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/set_cert_and_key.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/want_nothing.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/https_cat.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/post_https4.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/ssl_read_all.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/get_https.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/want_read.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/ssl_write_all.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/head_https3.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/put_https4.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/autosplit.ix
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/want_write.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/get_https4.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/make_form.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/head_https4.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/want_X509_lookup.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/ssl_read_until.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/ssl_write_CRLF.al
    Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/post_https.al
    Installing /usr/share/man/man3/Net::SSLeay::Handle.3pm
    Installing /usr/share/man/man3/Net::SSLeay.3pm
    Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/SSLeay/.packlist
    Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod

    Test the PERL SSL module:

    perl -e 'use Net::SSLeay'

    *If no output is shown this is good and means it is ready and the install was successful

    Webmin
    Backup Configuration Files
    Change Language and Theme
    Webmin Actions Log
    *Webmin Configuration
    Webmin Servers Index
    Webmin Users

    Click the "SSL Encryption" icon on the bottom right of the screen for "Webmin Configuration".
    Choose the following:

    Enable SSL if available?     *Yes No
    Private key file    
    Certificate file     *Same file as private key
    Separate file
    Redirect non-SSL requests to SSL mode?     *Yes No
    SSL protocol version     Detect automatically
    Allowed SSL ciphers     Detect automatically
    Only strong PCI-compliant ciphers
    Listed ciphers
    Additional certificate files
    (for chained certificates)


  • mysql backup/dump all databases with mysqldump command


    mysqldump --all-databases > allDB.sql

    The above dumps ALL the mysql databases to "allDB.sql".

    If you want to compress with gzip you could do this instead:

    mysqldump --all-databases > gzip > ALLDB.sql.gz


  • VMWare bridged adapter not working: The network bridge on device vmnet0 is not running. The virtual machine will not be able to communicate with the host or with other machines on your network. Failed to connect virtual device Ethernet1.


    VMWare bridged adapter not working:

    Message from system: The network bridge on device vmnet0 is not running. The virtual machine will not be able to communicate with the host or with other machines on your network. Failed to connect virtual device Ethernet1.

    I'm not sure how to fix this but one of the issues is that my eth0 became eth1 after moving my hard drives to a new motherboard.  I have run the vmware-config.pl but this did not resolve the issue.

    Solution

    I already suspected the issue was that my eth0 no longer exists ever since I moved my HDD to a new server, it became eth1.  Even running vmware-config it doesn't update it I did a grep "eth0" in /etc/vmware and found the "locations" file had numerous references to eth0.

    I decided to use sed to replace all eth0 with eth1 like so:

    sed -i 's/eth0/eth1/g' /etc/vmware/locations

    Now restart vmware and finally your bridged network will work again.

    It's beyond me why the vmware-config util can't figure this issue out or why there's nothing in the vmware management to change/edit/fix this issue.


  • ERROR! MySQL manager or server PID file could not be found! ERROR! Manager of pid-file quit without updating file.


    I found the cause of this issue was from all the diskspace being used but clearing it was not enough.  I guess the tables became inconsistent when space ran out and myisamchk is what fixed the rest.

     

    service mysqld restart
    ERROR! MySQL manager or server PID file could not be found!

    ....................................................................................... ERROR! Manager of pid-file quit without updating file.

    service mysqld status
    /etc/init.d/mysqld: line 409: test: too many arguments
     ERROR! MySQL is running but PID file could not be found

     in 60 secs
    110118 23:43:20 [ERROR] /usr/sbin/mysqld: Disk is full writing './blog/wp_comments.MYD' (Errcode: 122). Waiting for someone to free space... Retry in 60 secs
    110118 23:53:20 [ERROR] /usr/sbin/mysqld: Disk is full writing './blog/wp_comments.MYD' (Errcode: 122). Waiting for someone to free space... Retry in 60 secs


    Even with free space it won't start:

     ERROR! MySQL manager or server PID file could not be found!
    Starting MySQL.................................................................................................... ERROR! Manager of pid-file quit without updating file.
    [root@server mysql]# service mysqld status
    /etc/init.d/mysqld: line 409: test: too many arguments
     ERROR! MySQL is running but PID file could not be found

    Solution repair tables with myisamchk


    cd /var/lib/mysql

    myisamchk *


  • Importing Plesk 8.6 Backup to Virtualmin: Validating migration file .. .. validation failed : XML::Simple Perl module is not installed


    Importing Plesk 8.6 Backup to Virtualmin:

    Validating migration file ..
    .. validation failed : XML::Simple Perl module is not installed


    Solution is to install the correct module:

    perl -MCPAN -e 'install XML::Simple'

    Migrating a single domain works just fine, but it doesn't work with a full client backup containing multiple domains.


    Validating migration file ..
    .. validation failed : Could not work out domain name from backup


  • Plesk: Backup Domains from the CLI - it's quicker


    Plesk 8.6 CLI backup:

    /usr/local/psa/bin/pleskbackup domains domain.com

    This is a much better way of doing it and of course it can be scripted, it's a real pain to point, click and wait for Plesk to backup domains (and yes I know you could do all of them in a single client file but this is not desirable for my situation).


  • Webmin/Virtualmin when enabling bind: Failed to save enabled features : Virtualmin is configured to setup DNS zones, but this system is not setup to use itself as a DNS server. Either add 127.0.0.1 to the list of DNS servers, or turn off the BIND fe


    Webmin/Virtualmin when enabling bind:

    Failed to save enabled features : Virtualmin is configured to setup DNS zones, but this system is not setup to use itself as a DNS server. Either add 127.0.0.1 to the list of DNS servers, or turn off the BIND feature on the module config page.

    It means what it says, add "127.0.0.1" to /etc/resolv.conf


  • Failed to save enabled features : The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin base directory is /home. CGI and PHP scripts run as domain owners will not be executed.


    Apache/httpd
    Failed to save enabled features : The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin base directory is /home. CGI and PHP scripts run as domain owners will not be executed.

    This is because I never edited the Apache Config and Virtualmin config to reflect my new/current updated structure.


  • php won't work with absolute links


    php won't work with absolute links

    Warning: imagecreatefromgif(/images/header.gif): failed to open stream: No such file or directory in /vhostsdir/httpdocs/images.php on line 15


    That is how my path is structured and ONLY likes the true full path as /vhostsdir/httpdocs/images/header.gif
    Why can't it work relative to the vhost directory with absolute links just like say an html link would.


  • Ubuntu 9.04 Crash


    CPU/Kernel/MB/RAID problem?

    Jan  5 12:45:05 testbox kernel: [653298.890004] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:45:05 testbox kernel: [653298.890005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:45:05 testbox kernel: [653298.891687]
    Jan  5 12:45:05 testbox kernel: [653298.891687] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:45:05 testbox kernel: [653298.891687] EIP: 0060:[<c0129085>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:45:05 testbox kernel: [653298.891687] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:45:05 testbox kernel: [653298.891687] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:45:05 testbox kernel: [653298.891687] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:45:05 testbox kernel: [653298.891687]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:45:05 testbox kernel: [653298.891687] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:45:05 testbox kernel: [653298.891687] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:45:05 testbox kernel: [653298.891687] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:45:05 testbox kernel: [653298.891687] Call Trace:
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:45:05 testbox kernel: [653298.891687]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:45:37 testbox kernel: [653330.032503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:45:37 testbox kernel: [653330.032503] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:45:37 testbox kernel: [653330.032503]
    Jan  5 12:45:37 testbox kernel: [653330.032503] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:45:37 testbox kernel: [653330.032503] EIP: 0060:[<c0129083>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:45:37 testbox kernel: [653330.032503] EIP is at __ticket_spin_lock+0x13/0x20
    Jan  5 12:45:37 testbox kernel: [653330.032503] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:45:37 testbox kernel: [653330.032503] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:45:37 testbox kernel: [653330.032503]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:45:37 testbox kernel: [653330.032503] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:45:37 testbox kernel: [653330.032503] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:45:37 testbox kernel: [653330.032503] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:45:37 testbox kernel: [653330.032503] Call Trace:
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:45:37 testbox kernel: [653330.032503]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:45:37 testbox kernel: [653330.035919] hpet1: lost 3 rtc interrupts
    Jan  5 12:46:11 testbox kernel: [653364.390003] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:46:11 testbox kernel: [653364.390005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:46:11 testbox kernel: [653364.391694]
    Jan  5 12:46:11 testbox kernel: [653364.391694] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:46:11 testbox kernel: [653364.391694] EIP: 0060:[<c0129083>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:46:11 testbox kernel: [653364.391694] EIP is at __ticket_spin_lock+0x13/0x20
    Jan  5 12:46:11 testbox kernel: [653364.391694] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:46:11 testbox kernel: [653364.391694] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:46:11 testbox kernel: [653364.391694]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:46:11 testbox kernel: [653364.391694] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:46:11 testbox kernel: [653364.391694] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:46:11 testbox kernel: [653364.391694] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:46:11 testbox kernel: [653364.391694] Call Trace:
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:46:11 testbox kernel: [653364.391694]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:46:42 testbox kernel: [653395.522503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:46:42 testbox kernel: [653395.522503] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:46:42 testbox kernel: [653395.522503]
    Jan  5 12:46:42 testbox kernel: [653395.522503] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:46:42 testbox kernel: [653395.522503] EIP: 0060:[<c0129085>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:46:42 testbox kernel: [653395.522503] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:46:42 testbox kernel: [653395.522503] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:46:42 testbox kernel: [653395.522503] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:46:42 testbox kernel: [653395.522503]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:46:42 testbox kernel: [653395.522503] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:46:42 testbox kernel: [653395.522503] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:46:42 testbox kernel: [653395.522503] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:46:42 testbox kernel: [653395.522503] Call Trace:
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:46:42 testbox kernel: [653395.522503]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:46:42 testbox kernel: [653395.526521] hpet1: lost 3 rtc interrupts
    Jan  5 12:47:16 testbox kernel: [653429.890004] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:47:16 testbox kernel: [653429.890005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:47:16 testbox kernel: [653429.891694]
    Jan  5 12:47:16 testbox kernel: [653429.891694] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:47:16 testbox kernel: [653429.891694] EIP: 0060:[<c012907f>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:47:16 testbox kernel: [653429.891694] EIP is at __ticket_spin_lock+0xf/0x20
    Jan  5 12:47:16 testbox kernel: [653429.891694] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:47:16 testbox kernel: [653429.891694] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:47:16 testbox kernel: [653429.891694]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:47:16 testbox kernel: [653429.891694] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:47:16 testbox kernel: [653429.891694] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:47:16 testbox kernel: [653429.891694] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:47:16 testbox kernel: [653429.891694] Call Trace:
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:47:16 testbox kernel: [653429.891694]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:47:48 testbox kernel: [653461.022504] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:47:48 testbox kernel: [653461.022504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:47:48 testbox kernel: [653461.022504]
    Jan  5 12:47:48 testbox kernel: [653461.022504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:47:48 testbox kernel: [653461.022504] EIP: 0060:[<c0129085>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:47:48 testbox kernel: [653461.022504] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:47:48 testbox kernel: [653461.022504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:47:48 testbox kernel: [653461.022504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:47:48 testbox kernel: [653461.022504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:47:48 testbox kernel: [653461.022504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:47:48 testbox kernel: [653461.022504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:47:48 testbox kernel: [653461.022504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:47:48 testbox kernel: [653461.022504] Call Trace:
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:47:48 testbox kernel: [653461.022504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:47:48 testbox kernel: [653461.025921] hpet1: lost 2 rtc interrupts
    Jan  5 12:48:22 testbox kernel: [653495.390004] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:48:22 testbox kernel: [653495.390005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:48:22 testbox kernel: [653495.391695]
    Jan  5 12:48:22 testbox kernel: [653495.391695] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:48:22 testbox kernel: [653495.391695] EIP: 0060:[<c0129083>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:48:22 testbox kernel: [653495.391695] EIP is at __ticket_spin_lock+0x13/0x20
    Jan  5 12:48:22 testbox kernel: [653495.391695] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:48:22 testbox kernel: [653495.391695] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:48:22 testbox kernel: [653495.391695]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:48:22 testbox kernel: [653495.391695] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:48:22 testbox kernel: [653495.391695] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:48:22 testbox kernel: [653495.391695] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:48:22 testbox kernel: [653495.391695] Call Trace:
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:48:22 testbox kernel: [653495.391695]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:48:53 testbox kernel: [653526.522503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:48:53 testbox kernel: [653526.522504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:48:53 testbox kernel: [653526.522504]
    Jan  5 12:48:53 testbox kernel: [653526.522504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:48:53 testbox kernel: [653526.522504] EIP: 0060:[<c0129085>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:48:53 testbox kernel: [653526.522504] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:48:53 testbox kernel: [653526.522504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:48:53 testbox kernel: [653526.522504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:48:53 testbox kernel: [653526.522504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:48:53 testbox kernel: [653526.522504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:48:53 testbox kernel: [653526.522504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:48:53 testbox kernel: [653526.522504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:48:53 testbox kernel: [653526.522504] Call Trace:
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:48:53 testbox kernel: [653526.522504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:48:53 testbox kernel: [653526.526518] hpet1: lost 3 rtc interrupts
    Jan  5 12:49:27 testbox kernel: [653560.880003] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:49:27 testbox kernel: [653560.880005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:49:27 testbox kernel: [653560.881694]
    Jan  5 12:49:27 testbox kernel: [653560.881694] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:49:27 testbox kernel: [653560.881694] EIP: 0060:[<c012907f>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:49:27 testbox kernel: [653560.881694] EIP is at __ticket_spin_lock+0xf/0x20
    Jan  5 12:49:27 testbox kernel: [653560.881694] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:49:27 testbox kernel: [653560.881694] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:49:27 testbox kernel: [653560.881694]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:49:27 testbox kernel: [653560.881694] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:49:27 testbox kernel: [653560.881694] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:49:27 testbox kernel: [653560.881694] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:49:27 testbox kernel: [653560.881694] Call Trace:
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:49:27 testbox kernel: [653560.881694]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:49:59 testbox kernel: [653592.022503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:49:59 testbox kernel: [653592.022504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:49:59 testbox kernel: [653592.022504]
    Jan  5 12:49:59 testbox kernel: [653592.022504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:49:59 testbox kernel: [653592.022504] EIP: 0060:[<c0129085>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:49:59 testbox kernel: [653592.022504] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:49:59 testbox kernel: [653592.022504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:49:59 testbox kernel: [653592.022504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:49:59 testbox kernel: [653592.022504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:49:59 testbox kernel: [653592.022504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:49:59 testbox kernel: [653592.022504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:49:59 testbox kernel: [653592.022504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:49:59 testbox kernel: [653592.022504] Call Trace:
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:49:59 testbox kernel: [653592.022504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:49:59 testbox kernel: [653592.025918] hpet1: lost 2 rtc interrupts
    Jan  5 12:50:33 testbox kernel: [653626.380003] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:50:33 testbox kernel: [653626.380005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:50:33 testbox kernel: [653626.381684]
    Jan  5 12:50:33 testbox kernel: [653626.381684] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:50:33 testbox kernel: [653626.381684] EIP: 0060:[<c0129081>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:50:33 testbox kernel: [653626.381684] EIP is at __ticket_spin_lock+0x11/0x20
    Jan  5 12:50:33 testbox kernel: [653626.381684] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:50:33 testbox kernel: [653626.381684] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:50:33 testbox kernel: [653626.381684]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:50:33 testbox kernel: [653626.381684] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:50:33 testbox kernel: [653626.381684] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:50:33 testbox kernel: [653626.381684] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:50:33 testbox kernel: [653626.381684] Call Trace:
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:50:33 testbox kernel: [653626.381684]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:51:04 testbox kernel: [653657.522503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:51:04 testbox kernel: [653657.522504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:51:04 testbox kernel: [653657.522504]
    Jan  5 12:51:04 testbox kernel: [653657.522504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:51:04 testbox kernel: [653657.522504] EIP: 0060:[<c0129083>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:51:04 testbox kernel: [653657.522504] EIP is at __ticket_spin_lock+0x13/0x20
    Jan  5 12:51:04 testbox kernel: [653657.522504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:51:04 testbox kernel: [653657.522504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:51:04 testbox kernel: [653657.522504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:51:04 testbox kernel: [653657.522504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:51:04 testbox kernel: [653657.522504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:51:04 testbox kernel: [653657.522504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:51:04 testbox kernel: [653657.522504] Call Trace:
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:51:04 testbox kernel: [653657.522504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:51:04 testbox kernel: [653657.526512] hpet1: lost 3 rtc interrupts
    Jan  5 12:51:38 testbox kernel: [653691.880004] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:51:38 testbox kernel: [653691.880005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:51:38 testbox kernel: [653691.880859]
    Jan  5 12:51:38 testbox kernel: [653691.880859] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:51:38 testbox kernel: [653691.880859] EIP: 0060:[<c0129085>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:51:38 testbox kernel: [653691.880859] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:51:38 testbox kernel: [653691.880859] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:51:38 testbox kernel: [653691.880859] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:51:38 testbox kernel: [653691.880859]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:51:38 testbox kernel: [653691.880859] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:51:38 testbox kernel: [653691.880859] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:51:38 testbox kernel: [653691.880859] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:51:38 testbox kernel: [653691.880859] Call Trace:
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:51:38 testbox kernel: [653691.880859]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:52:10 testbox kernel: [653723.022504] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:52:10 testbox kernel: [653723.022504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:52:10 testbox kernel: [653723.022504]
    Jan  5 12:52:10 testbox kernel: [653723.022504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:52:10 testbox kernel: [653723.022504] EIP: 0060:[<c0129083>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:52:10 testbox kernel: [653723.022504] EIP is at __ticket_spin_lock+0x13/0x20
    Jan  5 12:52:10 testbox kernel: [653723.022504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:52:10 testbox kernel: [653723.022504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:52:10 testbox kernel: [653723.022504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:52:10 testbox kernel: [653723.022504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:52:10 testbox kernel: [653723.022504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:52:10 testbox kernel: [653723.022504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:52:10 testbox kernel: [653723.022504] Call Trace:
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:52:10 testbox kernel: [653723.022504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:52:10 testbox kernel: [653723.025920] hpet1: lost 3 rtc interrupts
    Jan  5 12:52:44 testbox kernel: [653757.380003] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:52:44 testbox kernel: [653757.380005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:52:44 testbox kernel: [653757.381694]
    Jan  5 12:52:44 testbox kernel: [653757.381694] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:52:44 testbox kernel: [653757.381694] EIP: 0060:[<c012907f>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:52:44 testbox kernel: [653757.381694] EIP is at __ticket_spin_lock+0xf/0x20
    Jan  5 12:52:44 testbox kernel: [653757.381694] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:52:44 testbox kernel: [653757.381694] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:52:44 testbox kernel: [653757.381694]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:52:44 testbox kernel: [653757.381694] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:52:44 testbox kernel: [653757.381694] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:52:44 testbox kernel: [653757.381694] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:52:44 testbox kernel: [653757.381694] Call Trace:
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:52:44 testbox kernel: [653757.381694]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:53:15 testbox kernel: [653788.512503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:53:15 testbox kernel: [653788.512504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:53:15 testbox kernel: [653788.512504]
    Jan  5 12:53:15 testbox kernel: [653788.512504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:53:15 testbox kernel: [653788.512504] EIP: 0060:[<c0129081>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:53:15 testbox kernel: [653788.512504] EIP is at __ticket_spin_lock+0x11/0x20
    Jan  5 12:53:15 testbox kernel: [653788.512504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:53:15 testbox kernel: [653788.512504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:53:15 testbox kernel: [653788.512504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:53:15 testbox kernel: [653788.512504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:53:15 testbox kernel: [653788.512504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:53:15 testbox kernel: [653788.512504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:53:15 testbox kernel: [653788.512504] Call Trace:
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:53:15 testbox kernel: [653788.512504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:53:15 testbox kernel: [653788.516515] hpet1: lost 3 rtc interrupts
    Jan  5 12:53:49 testbox kernel: [653822.880003] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:53:49 testbox kernel: [653822.880005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:53:49 testbox kernel: [653822.881681]
    Jan  5 12:53:49 testbox kernel: [653822.881681] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:53:49 testbox kernel: [653822.881681] EIP: 0060:[<c012907f>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:53:49 testbox kernel: [653822.881681] EIP is at __ticket_spin_lock+0xf/0x20
    Jan  5 12:53:49 testbox kernel: [653822.881681] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:53:49 testbox kernel: [653822.881681] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:53:49 testbox kernel: [653822.881681]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:53:49 testbox kernel: [653822.881681] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:53:49 testbox kernel: [653822.881681] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:53:49 testbox kernel: [653822.881681] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:53:49 testbox kernel: [653822.881681] Call Trace:
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:53:49 testbox kernel: [653822.881681]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:53:50 testbox kernel: [653822.881681]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:54:21 testbox kernel: [653854.012503] BUG: soft lockup - CPU#3 stuck for 61s! [rsync:30532]
    Jan  5 12:54:21 testbox kernel: [653854.012504] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:54:21 testbox kernel: [653854.012504]
    Jan  5 12:54:21 testbox kernel: [653854.012504] Pid: 30532, comm: rsync Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:54:21 testbox kernel: [653854.012504] EIP: 0060:[<c0129085>] EFLAGS: 00000297 CPU: 3
    Jan  5 12:54:21 testbox kernel: [653854.012504] EIP is at __ticket_spin_lock+0x15/0x20
    Jan  5 12:54:21 testbox kernel: [653854.012504] EAX: f5d962b8 EBX: e0c8de00 ECX: 00000000 EDX: 00004e4d
    Jan  5 12:54:21 testbox kernel: [653854.012504] ESI: f5d96200 EDI: f6d00450 EBP: db0f1cc8 ESP: db0f1cc8
    Jan  5 12:54:21 testbox kernel: [653854.012504]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:54:21 testbox kernel: [653854.012504] CR0: 8005003b CR2: 00000000 CR3: 1b0d9000 CR4: 000006b0
    Jan  5 12:54:21 testbox kernel: [653854.012504] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:54:21 testbox kernel: [653854.012504] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:54:21 testbox kernel: [653854.012504] Call Trace:
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c025393e>] journal_dirty_data+0x5e/0x1f0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c021b048>] ext3_journal_dirty_data+0x18/0x50
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c021b7ef>] walk_page_buffers+0x2f/0x80
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c021bbf3>] ext3_ordered_write_end+0x63/0x1b0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c021b030>] ? ext3_journal_dirty_data+0x0/0x50
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c0195e6d>] ? iov_iter_copy_from_user_atomic+0x5d/0xc0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c0195fdf>] generic_perform_write+0x10f/0x190
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01970ad>] generic_file_buffered_write+0x5d/0x120
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01986ab>] __generic_file_aio_write_nolock+0x19b/0x520
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c013949e>] ? resched_task+0x1e/0x70
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c0198b3e>] generic_file_aio_write+0x5e/0xd0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c02194fd>] ext3_file_write+0x2d/0xc0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01c6831>] do_sync_write+0xd1/0x110
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c03f1082>] ? rtc_update_irq+0x92/0xa0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c0156a70>] ? autoremove_wake_function+0x0/0x50
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c02b22f0>] ? apparmor_file_permission+0x20/0x30
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c029049f>] ? security_file_permission+0xf/0x20
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01c69d4>] ? rw_verify_area+0x54/0xd0
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01c6ec8>] vfs_write+0x98/0x110
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01c6760>] ? do_sync_write+0x0/0x110
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c01c6ffd>] sys_write+0x3d/0x70
    Jan  5 12:54:21 testbox kernel: [653854.012504]  [<c0109eef>] sysenter_do_call+0x12/0x2f
    Jan  5 12:54:21 testbox kernel: [653854.015940] hpet1: lost 2 rtc interrupts
    Jan  5 12:54:55 testbox kernel: [653888.370004] BUG: soft lockup - CPU#0 stuck for 61s! [hal-acl-tool:4168]
    Jan  5 12:54:55 testbox kernel: [653888.370005] Modules linked in: vmnet vmci vmmon binfmt_misc drbd video output input_polldev ocfs2_stackglue ocfs2_dlmfs ocfs2_dlm ocfs2_nodemanager configfs k8temp hwmon_vid lp snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device psmouse ppdev snd soundcore serio_raw pcspkr i2c_piix4 parport_pc parport shpchp snd_page_alloc usb_storage r8169 mii raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear fbcon tileblit font bitblit softcursor
    Jan  5 12:54:55 testbox kernel: [653888.371683]
    Jan  5 12:54:55 testbox kernel: [653888.371683] Pid: 4168, comm: hal-acl-tool Tainted: G      D W  (2.6.28-19-server #66-Ubuntu) System Product Name
    Jan  5 12:54:55 testbox kernel: [653888.371683] EIP: 0060:[<c012907f>] EFLAGS: 00000293 CPU: 0
    Jan  5 12:54:55 testbox kernel: [653888.371683] EIP is at __ticket_spin_lock+0xf/0x20
    Jan  5 12:54:55 testbox kernel: [653888.371683] EAX: f5d962b8 EBX: d6ba3b00 ECX: f5d96200 EDX: 00004f4d
    Jan  5 12:54:55 testbox kernel: [653888.371683] ESI: d20d3000 EDI: f5d962b8 EBP: e0491c60 ESP: e0491c60
    Jan  5 12:54:55 testbox kernel: [653888.371683]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Jan  5 12:54:55 testbox kernel: [653888.371683] CR0: 8005003b CR2: 09202568 CR3: 2a445000 CR4: 000006b0
    Jan  5 12:54:55 testbox kernel: [653888.371683] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    Jan  5 12:54:55 testbox kernel: [653888.371683] DR6: ffff0ff0 DR7: 00000400
    Jan  5 12:54:55 testbox kernel: [653888.371683] Call Trace:
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c050da98>] _spin_lock+0x8/0x10
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c025345d>] __journal_try_to_free_buffer+0x4d/0xc0
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c0253532>] journal_try_to_free_buffers+0x62/0x100
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c021bda5>] ext3_releasepage+0x45/0x70
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c0196c8e>] try_to_release_page+0x2e/0x50
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01a0346>] __invalidate_mapping_pages+0x136/0x150
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01a0372>] invalidate_mapping_pages+0x12/0x20
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01d98ba>] prune_icache+0x21a/0x260
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01d993e>] shrink_icache_memory+0x3e/0x50
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01a086f>] shrink_slab+0x11f/0x180
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01a2995>] do_try_to_free_pages+0x155/0x2c0
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c0156a8b>] ? autoremove_wake_function+0x1b/0x50
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01a2bec>] try_to_free_pages+0x6c/0x80
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01a13a0>] ? isolate_pages_global+0x0/0x70
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c019bdbb>] __alloc_pages_internal+0x1cb/0x450
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01c004b>] new_slab+0x7b/0x1e0
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01c1165>] ? unfreeze_slab+0x75/0xb0
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01c141b>] __slab_alloc+0x20b/0x260
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01c1516>] kmem_cache_alloc+0xa6/0xb0
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c013ef4c>] ? dup_task_struct+0x1c/0x110
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c013ef4c>] dup_task_struct+0x1c/0x110
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c013fd7e>] copy_process+0x6e/0xcf0
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01db240>] ? alloc_fd+0xe0/0x100
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01c7bbc>] ? get_empty_filp+0x6c/0x170
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c050da98>] ? _spin_lock+0x8/0x10
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c0140a62>] do_fork+0x62/0x300
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01cd6ef>] ? sys_pipe2+0x3f/0x60
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c01083df>] sys_clone+0x2f/0x40
    Jan  5 12:54:55 testbox kernel: [653888.371683]  [<c0109eef>] sysenter_do_call+0x12/0x2f
     


  • updatedb/mdadm caused a kernel panic?


    Jan 16 04:02:03 centosbox syslogd 1.4.1: restart.
    Jan 16 04:07:34 centosbox kernel: INFO: task updatedb:20771 blocked for more than 300 seconds.
    Jan 16 04:07:34 centosbox kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    Jan 16 04:07:34 centosbox kernel: updatedb      D F78BE050  6476 20771  20766                     (NOTLB)
    Jan 16 04:07:34 centosbox kernel:        ecc25dd4 00000086 7741afc0 000eb176 f78fc2ac 00000001 f78be050 7750f200
    Jan 16 04:07:34 centosbox kernel:        000eb176 000f4240 2081e57f 00266012 f78be174 f7d25000 2081fdc3 00266012
    Jan 16 04:07:34 centosbox kernel:        00000002 00000000 00000001 00000000 c0419058 f7d25000 c06e9d80 f6e62dec
    Jan 16 04:07:34 centosbox kernel:  Call Trace:
    Jan 16 04:07:34 centosbox kernel:  [<c0419058>] __wake_up+0x2a/0x3d
    Jan 16 04:07:34 centosbox kernel:  [<c0623e66>] io_schedule+0x3b/0x64
    Jan 16 04:07:34 centosbox kernel:  [<c04604e5>] sync_page+0x0/0x3b
    Jan 16 04:07:34 centosbox kernel:  [<c046051d>] sync_page+0x38/0x3b
    Jan 16 04:07:34 centosbox kernel:  [<c0623f7e>] __wait_on_bit_lock+0x2a/0x52
    Jan 16 04:07:34 centosbox kernel:  [<c0460460>] __lock_page+0x52/0x59
    Jan 16 04:07:34 centosbox kernel:  [<c0435f50>] wake_bit_function+0x0/0x3c
    Jan 16 04:07:34 centosbox kernel:  [<c0467b3a>] truncate_inode_pages_range+0x20b/0x260
    Jan 16 04:07:34 centosbox kernel:  [<f8c698d3>] journal_stop+0x208/0x213 [jbd]
    Jan 16 04:07:34 centosbox kernel:  [<c0467b98>] truncate_inode_pages+0x9/0xd
    Jan 16 04:07:34 centosbox kernel:  [<f8ca5a1e>] ext3_delete_inode+0x13/0xba [ext3]
    Jan 16 04:07:34 centosbox kernel:  [<f8ca5a0b>] ext3_delete_inode+0x0/0xba [ext3]
    Jan 16 04:07:34 centosbox kernel:  [<c0498dda>] generic_delete_inode+0x91/0xfe
    Jan 16 04:07:34 centosbox kernel:  [<c04988cc>] iput+0x67/0x69
    Jan 16 04:07:34 centosbox kernel:  [<c0496351>] d_kill+0x19/0x32
    Jan 16 04:07:34 centosbox kernel:  [<c049743a>] dput+0x148/0x155
    Jan 16 04:07:34 centosbox kernel:  [<c048fc5c>] sys_renameat+0x15f/0x1af
    Jan 16 04:07:34 centosbox kernel:  [<c04ea832>] _atomic_dec_and_lock+0x2a/0x44
    Jan 16 04:07:34 centosbox kernel:  [<c0453864>] audit_syscall_entry+0x160/0x192
    Jan 16 04:07:34 centosbox kernel:  [<c048fcbd>] sys_rename+0x11/0x15
    Jan 16 04:07:34 centosbox kernel:  [<c06271d7>] syscall_call+0x7/0xb
    Jan 16 04:07:34 centosbox kernel:  =======================
    Jan 16 04:10:45 centosbox openvpn[6864]: MANAGEMENT: Client connected from 127.0.0.1:50005
    Jan 16 04:10:45 centosbox openvpn[6864]: MANAGEMENT: Client disconnected
    Jan 16 04:12:34 centosbox kernel: INFO: task updatedb:20771 blocked for more than 300 seconds.
    Jan 16 04:12:34 centosbox kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    Jan 16 04:12:34 centosbox kernel: updatedb      D F78BE050  6476 20771  20766                     (NOTLB)
    Jan 16 04:12:34 centosbox kernel:        ecc25dd4 00000086 7741afc0 000eb176 f78fc2ac 00000001 f78be050 7750f200
    Jan 16 04:12:34 centosbox kernel:        000eb176 000f4240 2081e57f 00266012 f78be174 f7d25000 2081fdc3 00266012
    Jan 16 04:12:34 centosbox kernel:        00000002 00000000 00000001 00000000 c0419058 f7d25000 c06e9d80 f6e62dec
    Jan 16 04:12:34 centosbox kernel:  Call Trace:
    Jan 16 04:12:34 centosbox kernel:  [<c0419058>] __wake_up+0x2a/0x3d
    Jan 16 04:12:34 centosbox kernel:  [<c0623e66>] io_schedule+0x3b/0x64
    Jan 16 04:12:34 centosbox kernel:  [<c04604e5>] sync_page+0x0/0x3b
    Jan 16 04:12:34 centosbox kernel:  [<c046051d>] sync_page+0x38/0x3b
    Jan 16 04:12:34 centosbox kernel:  [<c0623f7e>] __wait_on_bit_lock+0x2a/0x52
    Jan 16 04:12:34 centosbox kernel:  [<c0460460>] __lock_page+0x52/0x59
    Jan 16 04:12:34 centosbox kernel:  [<c0435f50>] wake_bit_function+0x0/0x3c
    Jan 16 04:12:34 centosbox kernel:  [<c0467b3a>] truncate_inode_pages_range+0x20b/0x260
    Jan 16 04:12:34 centosbox kernel:  [<f8c698d3>] journal_stop+0x208/0x213 [jbd]
    Jan 16 04:12:34 centosbox kernel:  [<c0467b98>] truncate_inode_pages+0x9/0xd
    Jan 16 04:12:34 centosbox kernel:  [<f8ca5a0b>] ext3_delete_inode+0x0/0xba [ext3]
    Jan 16 04:12:34 centosbox kernel:  [<c0498dda>] generic_delete_inode+0x91/0xfe
    Jan 16 04:12:34 centosbox kernel:  [<c04988cc>] iput+0x67/0x69
    Jan 16 04:12:34 centosbox kernel:  [<c0496351>] d_kill+0x19/0x32
    Jan 16 04:12:34 centosbox kernel:  [<c049743a>] dput+0x148/0x155
    Jan 16 04:12:34 centosbox kernel:  [<c048fc5c>] sys_renameat+0x15f/0x1af
    Jan 16 04:12:34 centosbox kernel:  [<c04ea832>] _atomic_dec_and_lock+0x2a/0x44
    Jan 16 04:12:34 centosbox kernel:  [<c0453864>] audit_syscall_entry+0x160/0x192
    Jan 16 04:12:34 centosbox kernel:  [<c048fcbd>] sys_rename+0x11/0x15
    Jan 16 04:12:34 centosbox kernel:  [<c06271d7>] syscall_call+0x7/0xb
    Jan 16 04:12:34 centosbox kernel:  =======================
    Jan 16 04:17:34 centosbox kernel: INFO: task updatedb:20771 blocked for more than 300 seconds.
    Jan 16 04:17:34 centosbox kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    Jan 16 04:17:34 centosbox kernel: updatedb      D F78BE050  6476 20771  20766                     (NOTLB)
    Jan 16 04:17:34 centosbox kernel:        ecc25dd4 00000086 7741afc0 000eb176 f78fc2ac 00000001 f78be050 7750f200
    Jan 16 04:17:34 centosbox kernel:        000eb176 000f4240 2081e57f 00266012 f78be174 f7d25000 2081fdc3 00266012
    Jan 16 04:17:34 centosbox kernel:        00000002 00000000 00000001 00000000 c0419058 f7d25000 c06e9d80 f6e62dec
    Jan 16 04:17:34 centosbox kernel:  Call Trace:
    Jan 16 04:17:34 centosbox kernel:  [<c0419058>] __wake_up+0x2a/0x3d
    Jan 16 04:17:34 centosbox kernel:  [<c0623e66>] io_schedule+0x3b/0x64
    Jan 16 04:17:34 centosbox kernel:  [<c04604e5>] sync_page+0x0/0x3b
    Jan 16 04:17:34 centosbox kernel:  [<c046051d>] sync_page+0x38/0x3b
    Jan 16 04:17:34 centosbox kernel:  [<c0623f7e>] __wait_on_bit_lock+0x2a/0x52
    Jan 16 04:17:34 centosbox kernel:  [<c0460460>] __lock_page+0x52/0x59
    Jan 16 04:17:34 centosbox kernel:  [<c0435f50>] wake_bit_function+0x0/0x3c
    Jan 16 04:17:34 centosbox kernel:  [<c0467b3a>] truncate_inode_pages_range+0x20b/0x260
    Jan 16 04:17:34 centosbox kernel:  [<f8c698d3>] journal_stop+0x208/0x213 [jbd]
    Jan 16 04:17:34 centosbox kernel:  [<c0467b98>] truncate_inode_pages+0x9/0xd
    Jan 16 04:17:34 centosbox kernel:  [<f8ca5a1e>] ext3_delete_inode+0x13/0xba [ext3]
    Jan 16 04:17:34 centosbox kernel:  [<f8ca5a0b>] ext3_delete_inode+0x0/0xba [ext3]
    Jan 16 04:17:34 centosbox kernel:  [<c0498dda>] generic_delete_inode+0x91/0xfe
    Jan 16 04:17:34 centosbox kernel:  [<c04988cc>] iput+0x67/0x69
    Jan 16 04:17:34 centosbox kernel:  [<c0496351>] d_kill+0x19/0x32
    Jan 16 04:17:34 centosbox kernel:  [<c049743a>] dput+0x148/0x155
    Jan 16 04:17:34 centosbox kernel:  [<c048fc5c>] sys_renameat+0x15f/0x1af
    Jan 16 04:17:34 centosbox kernel:  [<c04ea832>] _atomic_dec_and_lock+0x2a/0x44
    Jan 16 04:17:34 centosbox kernel:  [<c0453864>] audit_syscall_entry+0x160/0x192
    Jan 16 04:17:34 centosbox kernel:  [<c048fcbd>] sys_rename+0x11/0x15
    Jan 16 04:17:34 centosbox kernel:  [<c06271d7>] syscall_call+0x7/0xb
    Jan 16 04:17:34 centosbox kernel:  =======================
    Jan 16 04:22:01 centosbox kernel: md: syncing RAID array md1
    Jan 16 04:22:01 centosbox kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Jan 16 04:22:01 centosbox kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Jan 16 04:22:01 centosbox kernel: md: using 128k window, over a total of 30716160 blocks.
    Jan 16 04:22:34 centosbox kernel: INFO: task updatedb:20771 blocked for more than 300 seconds.
    Jan 16 04:22:34 centosbox kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    Jan 16 04:22:34 centosbox kernel: updatedb      D F78BE050  6476 20771  20766                     (NOTLB)
    Jan 16 04:22:34 centosbox kernel:        ecc25dd4 00000086 7741afc0 000eb176 f78fc2ac 00000001 f78be050 7750f200
    Jan 16 04:22:34 centosbox kernel:        000eb176 000f4240 2081e57f 00266012 f78be174 f7d25000 2081fdc3 00266012
    Jan 16 04:22:34 centosbox kernel:  Call Trace:
    Jan 16 04:22:34 centosbox kernel:  [<c0419058>] __wake_up+0x2a/0x3d
    Jan 16 04:22:34 centosbox kernel:  [<c0623e66>] io_schedule+0x3b/0x64
    Jan 16 04:22:34 centosbox kernel:  [<c04604e5>] sync_page+0x0/0x3b
    Jan 16 04:22:34 centosbox kernel:  [<c046051d>] sync_page+0x38/0x3b
    Jan 16 04:22:34 centosbox kernel:  [<c0623f7e>] __wait_on_bit_lock+0x2a/0x52
    Jan 16 04:22:34 centosbox kernel:  [<c0460460>] __lock_page+0x52/0x59
    Jan 16 04:22:34 centosbox kernel:  [<c0435f50>] wake_bit_function+0x0/0x3c
    Jan 16 04:22:34 centosbox kernel:  [<c0467b3a>] truncate_inode_pages_range+0x20b/0x260
    Jan 16 04:22:35 centosbox kernel:  [<f8c698d3>] journal_stop+0x208/0x213 [jbd]
    Jan 16 04:22:35 centosbox kernel:  [<c0467b98>] truncate_inode_pages+0x9/0xd
    Jan 16 04:22:35 centosbox kernel:  [<f8ca5a1e>] ext3_delete_inode+0x13/0xba [ext3]
    Jan 16 04:22:36 centosbox kernel:  [<f8ca5a0b>] ext3_delete_inode+0x0/0xba [ext3]
    Jan 16 04:22:36 centosbox kernel:  [<c0498dda>] generic_delete_inode+0x91/0xfe
    Jan 16 04:22:36 centosbox kernel:  [<c04988cc>] iput+0x67/0x69
    Jan 16 04:22:36 centosbox kernel:  [<c0496351>] d_kill+0x19/0x32
    Jan 16 04:22:37 centosbox kernel:  [<c049743a>] dput+0x148/0x155
    Jan 16 04:22:37 centosbox kernel:  [<c048fc5c>] sys_renameat+0x15f/0x1af
    Jan 16 04:22:38 centosbox kernel:  [<c04ea832>] _atomic_dec_and_lock+0x2a/0x44
    Jan 16 04:22:38 centosbox kernel:  [<c0453864>] audit_syscall_entry+0x160/0x192
    Jan 16 04:22:38 centosbox kernel:  [<c048fcbd>] sys_rename+0x11/0x15
    Jan 16 04:22:38 centosbox kernel:  [<c06271d7>] syscall_call+0x7/0xb
    Jan 16 04:22:39 centosbox kernel:  =======================
    Jan 16 04:27:34 centosbox kernel: INFO: task updatedb:20771 blocked for more than 300 seconds.
    Jan 16 04:27:34 centosbox kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    Jan 16 04:27:34 centosbox kernel: updatedb      D F78BE050  6476 20771  20766                     (NOTLB)
    Jan 16 04:27:34 centosbox kernel:        ecc25dd4 00000086 7741afc0 000eb176 f78fc2ac 00000001 f78be050 7750f200
    Jan 16 04:27:34 centosbox kernel:        000eb176 000f4240 2081e57f 00266012 f78be174 f7d25000 2081fdc3 00266012
    Jan 16 04:27:34 centosbox kernel:        00000002 00000000 00000001 00000000 c0419058 f7d25000 c06e9d80 f6e62dec
    Jan 16 04:27:34 centosbox kernel:  Call Trace:
    Jan 16 04:27:34 centosbox kernel:  [<c0419058>] __wake_up+0x2a/0x3d
    Jan 16 04:27:34 centosbox kernel:  [<c0623e66>] io_schedule+0x3b/0x64
    Jan 16 04:27:34 centosbox kernel:  [<c04604e5>] sync_page+0x0/0x3b
    Jan 16 04:27:34 centosbox kernel:  [<c046051d>] sync_page+0x38/0x3b
    Jan 16 04:27:34 centosbox kernel:  [<c0623f7e>] __wait_on_bit_lock+0x2a/0x52
    Jan 16 04:27:34 centosbox kernel:  [<c0460460>] __lock_page+0x52/0x59
    Jan 16 04:27:34 centosbox kernel:  [<c0435f50>] wake_bit_function+0x0/0x3c
    Jan 16 04:27:34 centosbox kernel:  [<c0467b3a>] truncate_inode_pages_range+0x20b/0x260
    Jan 16 04:27:34 centosbox kernel:  [<f8c698d3>] journal_stop+0x208/0x213 [jbd]
    Jan 16 04:27:34 centosbox kernel:  [<c0467b98>] truncate_inode_pages+0x9/0xd
    Jan 16 04:27:34 centosbox kernel:  [<f8ca5a1e>] ext3_delete_inode+0x13/0xba [ext3]
    Jan 16 04:27:34 centosbox kernel:  [<f8ca5a0b>] ext3_delete_inode+0x0/0xba [ext3]
    Jan 16 04:27:34 centosbox kernel:  [<c0498dda>] generic_delete_inode+0x91/0xfe
    Jan 16 04:27:35 centosbox kernel:  [<c04988cc>] iput+0x67/0x69
    Jan 16 04:27:35 centosbox kernel:  [<c0496351>] d_kill+0x19/0x32
    Jan 16 04:27:35 centosbox kernel:  [<c049743a>] dput+0x148/0x155
    Jan 16 04:27:36 centosbox kernel:  [<c048fc5c>] sys_renameat+0x15f/0x1af
    Jan 16 04:27:36 centosbox kernel:  [<c04ea832>] _atomic_dec_and_lock+0x2a/0x44
    Jan 16 04:27:36 centosbox kernel:  [<c0453864>] audit_syscall_entry+0x160/0x192
    Jan 16 04:27:36 centosbox kernel:  [<c048fcbd>] sys_rename+0x11/0x15
    Jan 16 04:27:36 centosbox kernel:  [<c06271d7>] syscall_call+0x7/0xb
    Jan 16 04:27:36 centosbox kernel:  =======================
    Jan 16 04:28:18 centosbox kernel: md: md1: sync done.
    Jan 16 04:28:18 centosbox kernel: RAID1 conf printout:
    Jan 16 04:28:18 centosbox kernel:  --- wd:2 rd:2
    Jan 16 04:28:18 centosbox kernel:  disk 0, wo:0, o:1, dev:sda2
    Jan 16 04:28:18 centosbox kernel:  disk 1, wo:0, o:1, dev:sdb2
     


  • PHP5 & Apache Blank/White Screen/Page PHP won't work


    PHP5 & Apache Blank Screen/Page
    The PHP package is installed and works from the CLI
    Error reporting is enabled

    The only way I could get it working was:

    rm /etc/php.ini
    yum remove php
    yum install php-* -x php-pear* -x php-pecl*

    Interestingly enough reinstalling php did not bring back the deleted php.ini but everything is working.
     


  • mysqldump does not include CREATE DATABASE statement


    mysqldump does not include CREATE DATABASE statement

    you need the --databases option
     

    "--databases" is misleading, it implies in the documentation that this is a list of databases to be dumped, it should be clear that uses this command in conjuction with dumping a single database also adds CREATE DATABASE and is the only way to get the database to automatically create itself.


  • tar how to include hidden files such as .htaccess when it doesn't automatically


    tar include hidden files such as .htaccess
    just add . to the path eg.

    tar -czvf tarfile.tar.gz /home/directory/.


  • Openvz Disk quota exceeded inode problem with free space


    Openvz problem, it is confusing because it's an inode issue and there is enough free space.

    cp: cannot create regular file `forums/memberlist.php': Disk quota exceeded
    /dev/simfs             60G   20G   41G  33% /
    none                  2.0G  4.0K  2.0G   1% /dev

    cat /proc/vz/vzquota
    qid: path            usage      softlimit      hardlimit       time     expire
    26000: /vz/private/26000
      1k-blocks       20447708       62914560       62914560          0          0
         inodes         200001         200000         220000 1295689296         

    Solution, increase inodes:

    vzctl set 26000 --diskinodes 999999999 --save


  • named/bind cannot find zone file, load zone files without specifying full directory path/loading master file genuine.com.zone: file not found


    genuine.com/IN: loading master file genuine.com.zone: file not found
    _default/genuine.com/IN: file not found

    I always found it silly that no one really talks about this and apparently many like me and even control panels like Plesk were still using hard paths.  I always thought "why can't I just specify the name of the zone file and have bind find it".  Surely the default search path must be /var/named or somewhere else but there is no such thing.

    Solution = In /etc/named.conf just edit your "options" clause:

    options {
            directory "/var/named";
            /*
             * If there is a firewall between you and nameservers you want
             * to talk to, you might need to uncomment the query-source
             * directive below.  Previous versions of BIND always asked
             * questions using port 53, but BIND 8.1 uses an unprivileged
             * port by default.
             */
            //query-source address * port 53;
            allow-transfer { none };
            allow-recursion {
                    localnets;
            };

            auth-nxdomain no;
    };

    *As an aside "auth-nxdomain no;" makes it so your DNS servers will only return results/DNS lookups for domains/zonefiles it serves.  This way it can't be used to DOS others and also makes it so others can't use your DNS servers.

    So the directory "/var/named" is what specifies the default search path for bind zone files.

    This way in your /etc/named.conf file you zone file entires can be like this (notice there is no full path):

    zone "domain.com" {
            type master;
            file "domain.com.zone";
            allow-transfer {
    none;
            };
    };


  • Apache Forbidden You don't have permission to access / on this server.


    Forbidden

    You don't have permission to access / on this server.

    [Sun Jan 23 15:28:12 2011] [crit] [client 96.44.31.12] (13)Permission denied: /www/vhosts/domain.com/httpdocs/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

     

    Solution

    1. I've done a chmod 755 .htaccess and index.php and restarted Apache
    2. That wasn't the only issue, the issue was the httpdocs directory itself had the wrong permissions too.
    3. It needs to be chmod 755 httpdocs for it to work properly

    So basically your htaccess and index.php should be 755 to work, and so should your main httpdocs directory or your equivalent eg. /var/www/html


  • rsync and cp doesn't/won't include .hidden files


    I was shocked that options like preserve and archive made no difference!  This is a big deal and will catch people off guard.

    Rsync include hidden files Solution:

    You need to use something like: rsync -Pha /source/dir/. /dest/dir
    *Notice the "." at the end of the source directory.

    cp -a still ignores them too, the solution is the same:

    cp -a /source/directory/. /destination


  • Understanding /etc/aliases from sendmail when using with postfix or other MTA's


    understanding /etc/aliases
    *remember to apply changes you need to run "newaliases" after editing /etc/aliases

    one thing I don't get is that it doesn't allow you to specify the whole e-mail address on the left-hand side
    eg:

    yourfullemail@domain.com: someotheremail@domain.com

    postalias: warning: /etc/aliases, line 109: name must be local (if you try the above)


    It works more like this:

    yourfullemail: anotheremail, email@anotherhost.com

    How does that work?  How does it know what domain to send it to or is it implicit assuming your SMTP passes the full user and domain at the time and the alias resolves it?
    *It works very poorly!
    an alias like this:

    someuser: anotheruser@domain.com
    you could use someuser@anydomainhostedonyourserver.com and it will still forward it!!!!!
    I don't get how /etc/aliases was designed, it's very silly, isn't there a better flat file alternative or one that just makes sense and works?

    I mean what if we have on the same server the following:
    yourfullemail@onedomain.com
    yourfullemail@secondomain.com

    how does that work, does it suddenly alias/forward e-mail to both which would be incorrect?

    As test examples I have the following user in my dovecot passwd file:
    sometestuser@domain.com

    --
    If I set the following it won't deliver to me anymore:
    --
    sometestuser: someother@domain.com

    It will forward the mail to someother@domain.com and basically it means sometestuser@domain.com can never receive e-mail!

    Jan 24 11:39:43 server.box postfix/pipe[17880]: 332F5337000E: to=<someother@domain.com>, orig_to=<sometestuser@domain.com>, relay=dovecot, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (user unknown)
    Jan 24 11:39:43 server.box postfix/qmgr[17496]: 332F5337000E: removed

    --
    Getting looped!
    --
    Say I edit aliases to be like this:

    sometestuser: someother
    someother: sometestuser

    That creates a loop as you'll see below

    Jan 24 11:41:45 server.box postfix/local[21603]: warning: alias database loop for product-support
    Jan 24 11:41:45 server.box postfix/local[21603]: 29E2B337000E: to=<someother@domain.com>, orig_to=<sometestuser@domain.com>, relay=local, delay=0.03, delays=0.01/0/0/0.02, dsn=5.4.6, status=bounced (alias database loop for product-support)
    Jan 24 11:41:45 server.box postfix/qmgr[17496]: 29E2B337000E: removed



    ---
    Can't get alias to work, it bounces
    ---
    someother: sometestuser
    it translated the destination to the wrong domain, it made it to a default domain instead of the correct domain.
    eg. it should have been sometestuser@domain.com but it defaulted to being sometestuser@maindomain.com

    Jan 24 11:52:01 server.box postfix/qmgr[17496]: 7B19E337000C: from=<sometestuser@domain.com>, size=681, nrcpt=1 (queue active)
    Jan 24 11:52:01 server.box postfix/pipe[28169]: 7B19E337000C: to=<sometestuser@domain.com>, orig_to=<someother@domain.com>, relay=dovecot, delay=0.27, delays=0.25/0.01/0/0.01, dsn=5.1.1, status=bounced (user unknown)
    Jan 24 11:52:01 server.box postfix/cleanup[28163]: AA02B337000E: message-id=<20110124195201.AA02B337000E@mail.server.com.com>
    Jan 24 11:52:01 server.box postfix/qmgr[17496]: AA02B337000E: from=<>, size=2529, nrcpt=1 (queue active)
    Jan 24 11:52:01 server.box postfix/bounce[28171]: 7B19E337000C: sender non-delivery notification: AA02B337000E
    Jan 24 11:52:01 server.box postfix/qmgr[17496]: 7B19E337000C: removed
    Jan 24 11:52:01 server.box deliver(sometestuser@domain.com): msgid=<20110124195201.AA02B337000E@mail.compevo.com>: saved mail to INBOX
    Jan 24 11:52:01 server.box postfix/pipe[28169]: AA02B337000E: to=<sometestuser@domain.com>, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
    Jan 24 11:52:01 server.box postfix/qmgr[17496]: AA02B337000E: removed

    Actually it's weird the domain it was supposed to arrive to never worked the alias assumed some other weird domain, to fix it you have to explicitly specify it:

    someother: sometestuser@specificdomain.com


    *It works very poorly!
    an alias like this:
    someuser: anotheruser@domain.com
    you could use someuser@anydomainhostedonyourserver.com and it will still forward it!!!!!
    I don't get how /etc/aliases was designed, it's very silly, isn't there a better flat file alternative or one that just makes sense and works?


  • CPU #1 not responding - cannot use it.


    I think this will be useful to others because I have a server that kept crashing mysteriously during intense disk usage/RAID checks.  It would only crash during the weekly RAID integrity check.

    Then I noticed during a reboot that not all CPUs were being brought up, as a result this actually creates much higher temperatures with the output I got from sensors, just booting the system produced higher than normal temperatures.

    You can imagine that a full blown RAID check would create a lot more strain, and probably resulted in the crashes I've been seeing.  I've since upgraded the kernel and rebooted and did 3 manual RAID checks and the system has not crashed.

    The real question comes down to this, was this a hardware issue or a kernel issue?  I guess time will tell.

     

    CPU0: AMD Athlon(tm) II X4 620 Processor stepping 02
    Booting processor 1/1 eip 10000
    spurious 8259A interrupt: IRQ7.
    Not responding.
    Inquiring remote APIC #1...
    ... APIC #1 ID: 01000000
    ... APIC #1 VERSION: 80050010
    ... APIC #1 SPIV: 000000ff
    CPU #1 not responding - cannot use it.
    Booting processor 1/2 eip 10000
    Not responding.
    Inquiring remote APIC #2...
    ... APIC #2 ID: 02000000
    ... APIC #2 VERSION: 80050010
    ... APIC #2 SPIV: 000000ff
    CPU #2 not responding - cannot use it.
    Booting processor 1/3 eip 10000
    Not responding.
    Inquiring remote APIC #3...
    ... APIC #3 ID: 03000000
    ... APIC #3 VERSION: 80050010
    ... APIC #3 SPIV: 000000ff
    CPU #3 not responding - cannot use it.
    Total of 1 processors activated (5223.99 BogoMIPS).
    ENABLING IO-APIC IRQs
    ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1
    Using local APIC timer interrupts.
    Brought up 1 CPUs
    zapping low mappings.
    sizeof(vma)=88 bytes
    sizeof(page)=36 bytes
    sizeof(inode)=364 bytes
    sizeof(dentry)=148 bytes
    sizeof(ext3inode)=516 bytes
    sizeof(buffer_head)=52 bytes
    sizeof(skbuff)=192 bytes
    checking if image is initramfs... it is
    Freeing initrd memory: (37d6c000-37fef7fd) 2573k freed

     

    md: delaying resync of md1 until md0 has finished resync (they share one or more physical units)
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    INFO: task md1_resync:9004 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    md1_resync    D F561F910  7396  9004      6                6410 (L-TLB)
           f236dec0 00000046 6eaa8e40 000003e7 00000000 00000005 f561f910 6eaa8e40
           000003e7 00000000 978f1a6c 00000a6d f561fa34 c07ba980 978f2241 00000a6d
           00000000 f7040d80 f7d30e00 c0423845 c0671719 c07ba980 f783958c c04238f5
     Call Trace:
     [<c0423845>] vprintk+0x26/0x3a
     [<c04238f5>] printk+0x18/0x8e
     [<c05ab14e>] md_do_sync+0x1fe/0x966
     [<c041923e>] enqueue_task+0x2f/0x3f
     [<c04195cf>] __activate_task+0x83/0x147
     [<c04191d5>] dequeue_task+0x13/0x26
     [<c0623776>] schedule+0xd1a/0xe03
     [<c0435f23>] autoremove_wake_function+0x0/0x2d
     [<c05abba7>] md_thread+0xe6/0xfc
     [<c0418fd1>] complete+0x2b/0x3d
     [<c05abac1>] md_thread+0x0/0xfc
     [<c0435e61>] kthread+0xc0/0xeb
     [<c0435da1>] kthread+0x0/0xeb
     [<c0627f2f>] kernel_thread_helper+0x7/0x10
     =======================
    md: md0: sync done.
    md: syncing RAID array md1
    md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    md: using 128k window, over a total of 30716160 blocks.
    RAID1 conf printout:
     --- wd:2 rd:2
     disk 0, wo:0, o:1, dev:sda1
     disk 1, wo:0, o:1, dev:sdb1
    md: md1: sync done.
    RAID1 conf printout:
     --- wd:2 rd:2
     disk 0, wo:0, o:1, dev:sda2
     disk 1, wo:0, o:1, dev:sdb2
     


  • Postfix Enable SSL/TLS with your certificate


    Create Cert & Key:


    openssl req -new -x509 -nodes -days 1530 -out server.crt -keyout server.key
    mkdir /etc/mailssl
    chmod 700 /etc/mailssl
    cp server.* /etc/mailssl


    Postfix SSL config

    Edit /etc/postfix/main.cf:

    #SSL stuff
    smtpd_tls_cert_file = /etc/mailssl/server.crt
    smtpd_tls_key_file = /etc/mailssl/server.key


    To make smtps work on port 465 which it should, then you have to edit /etc/postfix/master.cf:

    Uncomment the following near the top (note it is the stanza which starts with smtps and NOT smtp)

    smtps     inet  n       -       n       -       -       smtpd
      -o smtpd_tls_wrappermode=yes
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_client_restrictions=permit_sasl_authenticated,reject

    The above didn't work,I had to comment the two lines about sasl_auth and client_restrictons to make it work.

    smtps     inet  n       -       n       -       -       smtpd
      -o smtpd_enforce_tls=yes
      -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
     


  • Dovecot Enable SSL/TLS with your certificate


    Dovecot enable SSL (by default it uses an old expired cert if you choose pop3s and imaps as protocols)
    ===================

    Create Cert & Key:

    openssl req -new -x509 -nodes -days 1530 -out server.crt -keyout server.key
    mkdir /etc/mailssl
    chmod 700 /etc/mailssl
    cp server.* /etc/mailssl

    Edit /etc/dovecot.conf

    ssl_cert_file = /etc/mailssl/server.crt
    ssl_key_file = /etc/mailssl/server.key


  • MySQL Replication/Dual-Master vs Clustering


    Many people aren't aware but recently Dual-Master Replication setups have become increasingly popular.  That's because you get similar features and benefits of having a full-blown cluster (difficult to setup and maintain and requires I believe 3 servers just as controllers).

    With a dual-master you just have a different off-set for the keys and you should be good, but of course there is the chance that at some point replication will halt because of an unexpected or unforseen error but still, it gives you some load balancing and redunancy.

    At the very least if you're running MySQL at least make a slave server for live backups and data mining etc...  Setting up a MySQL slave is ridiculously easy, I couldn't believe how fast it went once I figured it all out.


  • email server messsages rejected without reverse DNS DNS check failure Client host rejected: cannot find your reverse hostname Cannot resolve PTR record


    Basically you should always be 100% sure that whatever IP your mail server sends out with has reverse DNS/PTR records.  Remember that unless you own your IPs then you won't be able to set your own reverse DNS.  Even if you were to create a reverse PTR record on your DNS servers it will be ignored. Reverse DNS is queried to pre-assigned DNS servers of your ISP, so therefore you'll need to contact your ISP/Colo/Hosting provider to do a reverse DNS entry.

    If you don't have reverse DNS you'll find many of your outgoing e-mails will be rejected and won't reach the recipient. You can usually check /var/log/maillog for lines like this:

    • DNS check failure
    • Client host rejected: cannot find your reverse hostname
    • Cannot resolve PTR record

     

    Jan 31 01:04:21 mailserver postfix/smtp[20217]: 34CA233700CB: host mx.east.cox.net[68.1.17.3] refused to talk to me: 421 eastrmimpi03.cox.net IMP 12.55.42.121 DNS check failure - try again later - Refer to Error Codes section at http://postmaster.cox.net/confluence/display/postmaster/Error+Codes for more information.

     

    Jan 31 01:04:22 mailserver postfix/smtp[20334]: 94FC33370078: to=<ShanellMedsker1023@interbgc.com>, relay=mail.interbgc.com[217.9.224.121]:25, delay=221697, delays=221693/0.28/3.5/0.62, dsn=4.7.1, status=deferred (host mail.interbgc.com[217.9.224.121] said: 450 4.7.1 <ShanellMr1023@interbgc.com>: Recipient address rejected: temporary failure: Please see http://spf.pobox.com/why.html?sender=postmaster%40mail.mailserver.com&ip=12.55.42.121&receiver=p1.interbgc.com (in reply to RCPT TO command))

     

    Jan 31 01:04:26 mailserver postfix/smtp[20337]: 94F303370060: host mailin15.datevnet.de[193.27.50.115] said: 450 4.7.1 Client host rejected: cannot find your reverse hostname, [12.55.42.121] (in reply to RCPT TO command)

     

    Jan 31 01:04:30 mailserver postfix/smtp[20332]: 95B0F33700DB: to=<lamo2825@nuvox.net>, relay=smtp-in2.nuvox.net[70.43.63.21]:25, delay=67120, delays=67108/0.27/12/0.05, dsn=4.7.1, status=deferred (host smtp-in2.nuvox.net[70.43.63.21] said: 450 4.7.1 Access temporarily denied. Cannot resolve PTR record for 12.55.42.121 SRC001 Contact postmaster@nuvox.net (in reply to MAIL FROM command))


  • MySQL Out of Range Solution for DATETIME field


    Affected rows: 0
    Warning: #1264 Out of range value adjusted for column 'deleteon' at row 1
    SQL query:
    UPDATE `custtable`.`custinfo` SET `deleteon` = '2011-02-29 00:00:00' WHERE `custinfo`.`custid` =105 LIMIT 1 ;

    This happened after a migration to a new SQL database due to user error.  The old database server MySQL 3.23 or 4 allowed an impossible date to be entered by a user.  As we know February 29th DOES NOT exist but the database allowed the value.  MySQL 5.0 is smarter and rejected it and ended up setting a blank value for that field.  It was hard to troubleshoot at first until we actually looked at the date :)

    So the solution is to use Feb-28th or March 1st since the 29th does not exist.


  • sshd[9217]: Authentication refused: bad ownership or modes for file /root/.ssh/authorized_keys


    sshd[9217]: Authentication refused: bad ownership or modes for file /root/.ssh/authorized_keys
     I made sure the entire .ssh subdir is owned by the user root (this is root's account);
    chown -R root.root .ssh
    chmod 600 .ssh/authorized_keys

    but it still doesn't work and gives me the same message

    sshd[7339]: Authentication refused: bad ownership or modes for directory /root

    chmod 700 /root


    #For some reason /root was not owned by root!


    chown root.root /root

     


  • Postfix/Any Email Server check for Open Relay


    The first thing you need to remember is not to check from the same host/server itself.  This is a silly mistake I made, the reason is that many mailservers and especially postfix are configured to allow relaying from the localhost/same host.  If you do that you'll get a false positive.

    *Make sure you test from another host/system than the mail server itself!

    telnet yourmailserverhost.com 25


    220 Courier (FreeBSD 6.0)

    helo server.amil.com
    250 mail.cm.com
    mail from:<jkd@jk.com>
    250 2.1.0 Ok
    rcpt to:<joe@hotmail.com>

    You should get an error message like this now:

    554 5.7.1 <dkdkd@hotmail.com>: Relay access denied

    If you get this instead you have an open relay and have to fix your mailserver.  It should only allow mail to other destinations IF the user has logged in successfully.


    250 2.1.5 Ok
     


  • MySQL NEVER delete ib_logfile0 or ibdata1 or you'll lose data


    don't delete /var/lib/mysql/ib_logfile0 or ibdata1 or mysql won't restart
    I didn't realize they were internal and not part of replication like the relay files!


    /usr/libexec/mysqld: ready for connections.
    Version: '4.1.22-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
    110127 16:31:00 [Note] /usr/libexec/mysqld: Normal shutdown

    110127 16:31:00  InnoDB: Starting shutdown...
    110127 16:31:01  InnoDB: Shutdown completed; log sequence number 0 1392990560
    110127 16:31:01 [Note] /usr/libexec/mysqld: Shutdown complete

    InnoDB: The first specified data file ./ibdata1 did not exist:
    InnoDB: a new database to be created!
    110127 16:31:02  InnoDB: Setting file ./ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    110127 16:31:02  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
    InnoDB: Setting log file ./ib_logfile0 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    110127 16:31:02  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
    InnoDB: Setting log file ./ib_logfile1 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    InnoDB: Doublewrite buffer not found: creating new
    InnoDB: Cannot create doublewrite buffer: you must
    InnoDB: increase your buffer pool size.
    InnoDB: Cannot continue operation.
    110127 16:31:59  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    110127 16:31:59  InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 30960.
    InnoDB: Doing recovery: scanned up to log sequence number 0 30960
    110127 16:32:00  InnoDB: Flushing modified pages from the buffer pool...
    InnoDB: Doublewrite buffer not found: creating new
    InnoDB: Cannot create doublewrite buffer: you must
    InnoDB: increase your buffer pool size.
    InnoDB: Cannot continue operation.
    110127 16:32:45  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    110127 16:32:45  InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 30960.
    InnoDB: Doing recovery: scanned up to log sequence number 0 30960
    110127 16:32:45  InnoDB: Flushing modified pages from the buffer pool...
    InnoDB: Doublewrite buffer not found: creating new
    InnoDB: Cannot create doublewrite buffer: you must
    InnoDB: increase your buffer pool size.
    InnoDB: Cannot continue operation.

    /etc/my.cnf
    set-variable = innodb_buffer_pool_size=50M

    service mysqld start

    service mysqld start
    Starting MySQL:                                            [  OK  ]


    110127 17:40:56  InnoDB error:
    Cannot find table psa/misc from the internal data dictionary
    of InnoDB though the .frm file for the table exists. Maybe you
    have deleted and recreated InnoDB data files but have forgotten
    to delete the corresponding .frm files of InnoDB tables, or you
    have moved .frm files to another database?
    Look from section 15.1 of http://www.innodb.com/ibman.html
    how you can resolve the problem.


    service psa restart
    ERROR 1030 (HY000) at line 1: Got error 1 from storage engine


    110127 17:42:46  InnoDB error:
    Cannot find table psa/key_history from the internal data dictionary
    of InnoDB though the .frm file for the table exists. Maybe you
    have deleted and recreated InnoDB data files but have forgotten
    to delete the corresponding .frm files of InnoDB tables, or you
    have moved .frm files to another database?
    Look from section 15.1 of http://www.innodb.com/ibman.html
    how you can resolve the problem.

    The only way I could fix it was to rm -rf /var/lib/mysql/psa and dump a backup of the psa database I had
     


  • Thunderbird/MBOX to IMAP/Maildir migration done easy with mb2md


    Convert MBOX Mail files into Maildir using Linux

    *You need perl an the TimeDate module

    Get the free Perl script mb2md from the project/author's site:
    wget http://batleth.sapienti-sat.org/projects/mb2md/mb2md-3.20.pl.gz
    gunzip mb2md-3.20.pl.gz


    #remember you need timedate or you'll get this error:
    ./mb2md-3.20.pl
    Can't locate Date/Parse.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./mb2md-3.20.pl line 385.
    BEGIN failed--compilation aborted at ./mb2md-3.20.pl line 385.


    echo y|yum install perl-TimeDate

    [root@server.box thunderbird]# ./mb2md-3.20.pl -s sbrewzer.default/Mail/mail.mailserver.com/Inbox.msf
    Fatal: Source is not an mbox file or a directory!
    [root@server.box thunderbird]# ./mb2md-3.20.pl -s sbrewzer.default/Mail/mail.mailserver.com/Inbox
    Fatal: Source is not an mbox file or a directory!


    #*It needs an absolute path for -s (source) to work.  The destination by default is ~/Maildir unless you specify otherwise

    [root@server.box thunderbird]# ./mb2md-3.20.pl -s /full/path/sbrewzer.default/Mail/mail.mailserver.com/Inbox

    It worked perfectly, it turned everything into Maildir format and I literally just copied the appropriate folders directly into the IMAP folders from bash and everything worked (just make sure the correct/normal permissions are set on the copied files)


  • Thunderbird copy filters to other accounts


    cp msgFilterRules.dat /other/mail/folder


    edit msgFilterRules.dat change all instances of your old mailbox:  actionValue="mailbox://joes@mail.server.com/name"
    to:

    actionValue="imap://joes%40server.com@mail.server.com/INBOX"

    sed s/'actionValue="mailbox:joes@mail.server.com'/imap://joes%40server.com@mail.server.com/g msgFilterRules.dat-


  • sshfs cannot unmount error: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))


    umount: /home/diret/mount: device is busy.
            (In some cases useful info about processes that use
             the device is found by lsof(8) or fuser(1))

    I tried everything (fusermount -u) to unmount it but the only thing that worked was actually doing this:

    ps aux|grep sshfs

    Then I identified the sshfs connection and did:

    kill -kill pid

    After that it was obviously unmounted.  I think it happened because the target SSH host crashed at some point.


  • SSH Tunnel Dynamic Proxy Stops Working Right Away even with Root and High Port


    I keep getting messages like this shortly after using the proxy (it works for a few seconds/page loads and then stops):

    channel 12: open failed: administratively prohibited: open failed

    I'm not sure what the issue is unless there's some kind of hardware firewall on the other end.  I've used this exact configuration on multiple servers with no issue and even disabled iptables etc..


  • OpenOffice Calc SUM function not working Solution - Result is always 0/apostrophe appears in front of all numbers.


    I right clicked all applicable cells and chose "number" but that's enough.
    I notice when I click the cell there is an invisible ' in front of the number:
    '33.64

    Calc imported my CSV and decided to add a ' in front of the numeric currency values!!!*Actually the problem occurs when you right click the cells and change the type from text to number, no matter what format you choose.

    If I change it to be currency it still does the same thing!  What a stupid bug in Calc/Openoffice.

    The only solution is search and replace ' to blank but it's ridiculous.  This is typical OpenSource software that keeps introducing bugs into the simplest of operations and tasks.
      You can't even do a standard search and replace since it's a weird bug that ony shows itself when you click an individual cell that is affected.

    I don't have time for this, I've read belligerent comments in the OpenOffice forums from what seems like a dev who refuses to admit this is a bug.  There is supposedly some work around involving changing the default language or something, this bug has been around for years and the devs would rather flame the users than even acknowledge and fix it.

    *Easy solution with regular expression searches within the whole Calc sheet


    Just do a find and replace but don't choose "Current selection only"
    , because the cells in the selection don't show it so it will say "Search key not found".

    Make sure you use "Regular Expressions" (hit More):


    Search for: ^.
    Replae with: &

    After that you'll find your numbers are really numbers and that there's no apostrophe ' in front of them.


  • Amarok won't play songs, keeps skipping to the next


    Amarok won't play songs, keeps skipping to the next
    Some say install install phonon-backend-xine
    but it was already installed automatically, obviously that's not the problem or solution.

    Settings -> Configure Amarok
    Playback: Configure Phonon
    Audio Output: Music

    It should show your different audio interfaces, choose Pulse Audio and move it to the top of the list, do the Apply, OK and manually quit Amarok (remember to close it from the tray if it's there).

    It still doesn't work, now Phonon when started is saying "it claims it cannot play MP3 files".

    Solution:

    After installing "libxine1-ffmpeg" it was finally good.


  • Plesk Get List of E-mail Users & Aliases


    When migrating away from Plesk I couldn't figure out an easy way to get a straight list of all e-mails, but here is where I found the solution:

    http://nakuls77.wordpress.com/2008/08/30/details-of-email-ftp-database-users-from-psa-database/

    mysql> SELECT mail.mail_name, accounts.password, domains.name FROM mail, accounts, domains WHERE domains.id=mail.dom_id AND mail.account_id=accounts.id;

    mysql> SELECT CONCAT(mail.mail_name,’@’,domains.name) AS Email_Address , accounts.password AS Password FROM mail, domains, accounts WHERE domains.id=mail.dom_id AND mail.account_id=accounts.id;

    This way you won't make the mistake of manually going through each domain and checking to see if there is an alias, forward or redirect buried somewhere inside Plesk.


  • Openvz Enable TUN/TAP OpenVPN


    Make sure the module "tun" is loaded on the host.

    vzctl set 2000 --devnodes net/tun:rw --save

    *Note what's below is what OpenVZ says you need (but I've never had to do it)


    vzctl exec 2000 mkdir -p /dev/net
    vzctl exec 2000 mknod /dev/net/tun c 10 200
    vzctl exec 2000 chmod 600 /dev/net/tun

    On the container test the device:

    when Something is wrong:

    cat /dev/net/tun
    cat: /dev/net/tun: Permission denied


    It's right and ready to use:

    cat /dev/net/tun   
    cat: /dev/net/tun: File descriptor in bad state

    *remember again to make sure the "tun" module is loaded or it won't work and to add it to something like /etc/rc.local so it loads at boot time.


  • Convert doc images/jpg/jpeg to PDF


    Use "ImageMagick" which can be installed easily on most UNIX/Linux distros.

    Remember that it will go with the standard file listing to determine the order but I believe you can manually specify multiple jpg's in the arguments.

    Convert image/jpg to PDF

    convert *.jpg yourpdf.pdf

    This is a very handy and free tool.

    Convert DOC/TXT documents to PDF

    If you wanted to convert a .doc file or text of any kind, you could use OpenOffice Writer/Wordprocessor and choose "Export as PDF".


  • Linux use XMessage to popup a message in XWindows


    xmessage "Your message here" -display :0

    This will popup a window with the message, it would be cool if it allowed two way communication though.

    I found the info in this post: http://en.andregondim.eti.br/?p=72


  • ls: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory solution


    ls
    ls: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

    This is not an ldd problem or case of anything missing, this only happened after I upraded Ubuntu.

    declare -x PATH="/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"

    "/home/user/bin" is the problem!  It's weird because I have no idea how it happened.

    Other users don't have this problem and when typing "export" you see their PATH is set differently:

    declare -x PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"

    Solution
    fix it like this: export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"

    *The proper solution

    Check your "~/.profile" file, you'll notice that it has a weird feature to look for a bin directory in your home path.

    # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.

    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    #umask 022

    # if running bash
    if [ -n "$BASH_VERSION" ]; then
        # include .bashrc if it exists
        if [ -f "$HOME/.bashrc" ]; then
            . "$HOME/.bashrc"
        fi
    fi

    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
        PATH="$HOME/bin:$PATH"
    fi
    ~                 

    It turns out I do have a ~/bin path, I just moved bin to bin-disable and logged in again and the problem was solved.

    This is kind of a weird and annoying quirky feature, if it can't find the libraries in the first path why doesn't it check the other paths (which it obviously doesn't since that's why we get thsoe .so mising errors)?


  • Postfix header_checks using regexp and multiple lines


    I'm posting this because it wasn't easy or obvious how this would be accomplished and the man page leaves it to guesswork.

    Multi-line body_checks

    Example 1
    /<img src="cid:part.*"/
    /height="430"/ REJECT

    Example 2
    /<img src="cid:part.*"/
    /height="430" width="430" align="center" border="0">/ REDIRECT junkbox@domain.com


  • Directadmin DA Install Guide


    yum -y install openssl* gcc-c++ gcc flex g++ make;wget http://www.directadmin.com/setup.sh;chmod +x ./setup.sh;./setup.sh
    #enable SSL
    /usr/bin/openssl req -x509 -newkey rsa:1024 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9999 -nodes

    chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
    chmod 400 /usr/local/directadmin/conf/cakey.pem

    sed -i "s/SSL=0/SSL=1/g" /usr/local/directadmin/conf/directadmin.conf

    service directadmin restart


  • Virtualbox Failed to open a session for the virtual machine XP. Failed to launch Remote Desktop Extension server (Unknown Status 0x80004005). Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT).


    Failed to open a session for the virtual machine XP.
    Failed to launch Remote Desktop Extension server (Unknown Status 0x80004005).


    Disabled remote display:

    Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT).

    solution

    chown root.root /usr/lib/


  • Samsung Galaxy Note ICS Corrupting microSDHC partition table?


    This was partitioned as a single 32GB VFAT but when I inserted it into the phone it said that it can't read it and now here is how the partition table looks.  Interestingly enough the data works and reads fine from the computer still.

    Disk /dev/sdb1: 32.1 GB, 32085360640 bytes
    64 heads, 32 sectors/track, 30598 cylinders, total 62666720 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x2052474d

    This doesn't look like a partition table
    Probably you selected the wrong device.

         Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1p1   ?     6579571  1924427647   958924038+  70  DiskSecure Multi-Boot
    /dev/sdb1p2   ?  1953251627  3771827541   909287957+  43  Unknown
    /dev/sdb1p3   ?   225735265   225735274           5   72  Unknown
    /dev/sdb1p4      2642411520  2642463409       25945    0  Empty

     

     


  • SPAMASSASSIN Disable OpenWhois RBL (it is dead/defunct/no longer active):


    SPAMASSASSIN

    Disable OpenWhois RBL (it is dead/defunct/no longer active):

    You might see this in your headers
    2.4 DNS_FROM_OPENWHOIS RBL: Envelope sender listed in bl.open-whois.org

    comment out this inside /usr/share/spamassassin/72_active.cf
    ##{ DNS_FROM_OPENWHOIS

    ifplugin Mail::SpamAssassin::Plugin::DNSEval
    header          DNS_FROM_OPENWHOIS  eval:check_rbl_envfrom('openwhois', 'bl.open-whois.org.')
    describe        DNS_FROM_OPENWHOIS  Envelope sender listed in bl.open-whois.org.
    tflags          DNS_FROM_OPENWHOIS  net publish
    endif
    ##} DNS_FROM_OPENWHOIS
     


  • VOIP/Asterisk/FAX Error Problems Solution NOTICE[11389]: rtp.c:1808 ast_rtp_read: Unknown RTP codec 100 received from


    NOTICE[11389]: rtp.c:1808 ast_rtp_read: Unknown RTP codec 100 received from

    I've found that trying several times may work, but I also read changing your Sipura VOIP adapter settings as follows helps (but it still fails for me sometimes):

    In adapter change the following under SIP/Advanced


    Codec to G711a from G711u
    Passthru Method from: NSE to ReINVITE

    FAX CED Detect Enable: Yes
    FAX CNG Detect Enable: Yes
    FAX Passthru Codec: G711a
    FAX Codec Symmetric: Yes
    FAX Passthru Method: ReINVITE
    Fax Process NSE: yes


  • Enable SPAMASSASSIN on Postfix in 5 minutes


    Centos 5 Postfix and SPAMASSASSIN Tutorial
    yum install spamassassin
    chkconfig spamassassin on


    vi /etc/mail/spamassassin/local.cf
    ##############
    #required_hits 5
    #report_safe 0
    #rewrite_header Subject [SPAM]

    #5 is the least restrictive (means only the most obvious SPAM is caught. 0 is obviously the most restrictive/sensitive and would have lots of false positives
    required_score 5.0
    #0 = this way the header is modified only
    #1 = new message is created and original is attached
    #2 = attached to new report as plain text
    report_safe 0
    #I don't like this option
    #rewrite_header Subject **SPAM**
    ##############


    service spamassassin restart



    #Setup Postfix

    vi /etc/postfix/master.cf

    Edit the following lines:

    Basically we're just adding this at the end of the line "-o content_filter=spamassassin"

    Change:

    smtp      inet  n       -       n       -       -       smtpd
    To:
    smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin


    Change:
    smtps     inet  n       -       n       -       -       smtpd
    To:
    smtps     inet  n       -       n       -       -       smtpd -o content_filter=spamassassin

    Add to the end of the config:


    spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
    ####
    service postfix restart

    error

    ======

    Feb 18 15:29:44 mailbox postfix/pipe[13415]: fatal: get_service_attr: unknown username: spamd
    Feb 18 15:29:44 mailbox postfix/smtpd[13406]: disconnect from 192.168.5.91
    Feb 18 15:29:45 mailbox postfix/qmgr[12261]: warning: premature end-of-input on private/spamassassin socket while reading input attribute name
    Feb 18 15:29:45 mailbox postfix/qmgr[12261]: warning: private/spamassassin socket: malformed response
    Feb 18 15:29:45 mailbox postfix/qmgr[12261]: warning: transport spamassassin failure -- see a previous warning/fatal/panic logfile record for the problem description
    Feb 18 15:29:45 mailbox postfix/master[12258]: warning: process /usr/libexec/postfix/pipe pid 13415 exit status 1
    Feb 18 15:29:45 mailbox postfix/master[12258]: warning: /usr/libexec/postfix/pipe: bad command startup -- throttling
    Feb 18 15:29:45 mailbox postfix/qmgr[12261]: B5F4C337002D: to=<user@localbox.com>, relay=none, delay=1.3, delays=0.22/1/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)

    ##
    #####fixed (use correct user and group in spamassasssin line):
    ##
    Feb 18 19:39:40 mailbox dovecot: auth(default): new auth connection: pid=30122
    Feb 18 19:40:03 mailbox postfix/smtpd[29887]: connect from 192.168.5.91
    Feb 18 19:40:03 mailbox dovecot: auth(default): client in: AUTH    2    PLAIN    service=smtp    resp=AGpzQHJlYWx0ZWNodGFsay5jb20AV1JYU1RpMjAwNQ==
    Feb 18 19:40:03 mailbox dovecot: auth(default): passwd-file(user@localbox.com): lookup: user=user@localbox.com file=/etc/dovecot.passwd
    Feb 18 19:40:03 mailbox dovecot: auth(default): client out: OK    2    user=user@localbox.com
    Feb 18 19:40:04 mailbox postfix/smtpd[29887]: 043DD337002E: client=192.168.5.91, sasl_method=PLAIN, sasl_username=user@localbox.com
    Feb 18 19:40:04 mailbox postfix/cleanup[29895]: 043DD337002E: message-id=<4D5F3B93.9070803@re.com>
    Feb 18 19:40:04 mailbox postfix/qmgr[29844]: 043DD337002E: from=<user@localbox.com>, size=306, nrcpt=1 (queue active)
    Feb 18 19:40:04 mailbox spamd[8024]: spamd: connection from localhost.localdomain [127.0.0.1] at port 59429
    Feb 18 19:40:04 mailbox spamd[8024]: spamd: setuid to mailuser succeeded
    Feb 18 19:40:04 mailbox spamd[8024]: spamd: processing message <4D5F3B93.9070803@re.com> for mailuser:102
    Feb 18 19:40:04 mailbox spamd[8024]: spamd: identified spam (5.8/5.0) for mailuser:102 in 0.0 seconds, 331 bytes.
    Feb 18 19:40:04 mailbox spamd[8024]: spamd: result: Y 5 - DNS_FROM_OPENWHOIS,FH_DATE_PAST_20XX,NO_RECEIVED,NO_RELAYS scantime=0.0,size=331,user=mailuser,uid=102,required_score=5.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=59429,mid=<4D5F3B93.9070803@re.com>,autolearn=no
    Feb 18 19:40:04 mailbox postfix/pickup[29843]: 604203370033: uid=102 from=<user@localbox.com>
    Feb 18 19:40:04 mailbox postfix/cleanup[29895]: 604203370033: message-id=<4D5F3B93.9070803@re.com>
    Feb 18 19:40:04 mailbox postfix/pipe[29899]: 043DD337002E: to=<user@localbox.com>, relay=spamassassin, delay=0.45, delays=0.4/0/0/0.05, dsn=2.0.0, status=sent (delivered via spamassassin service)
    Feb 18 19:40:04 mailbox postfix/qmgr[29844]: 043DD337002E: removed
    Feb 18 19:40:04 mailbox postfix/qmgr[29844]: 604203370033: from=<user@localbox.com>, size=850, nrcpt=1 (queue active)


    =======
    enable Razor DCC
    yum install razor-agents

    You don't need to run any commands or change config files, it should work right away after a spamassassin restart.  The command below and that other guides mention are only if you want to report SPAM I believe.

    Now just restart spamassassin and you should see razor in action in the headers (only when it detects something though):

     

    	*  1.5 RAZOR2_CF_RANGE_E8_51_100 Razor2 gives engine 8 confidence level
    	*      above 50%
    	*      [cf: 100]
    	*  0.5 RAZOR2_CHECK Listed in Razor2 (http://razor.sf.net/)
    	*  0.5 RAZOR2_CF_RANGE_51_100 Razor2 gives confidence level above 50%
    	*      [cf: 100]
    

     

    Don't follow below, it just screws things up:

    ====
    vi /etc/mail/spamassassin/.razor

    razor-admin -home=/etc/mail/spamassassin/.razor -register
    razor-admin -home=/etc/mail/spamassassin/.razor -create
    razor-admin -home=/etc/mail/spamassassin/.razor -discover

    echo "razor_config /etc/mail/spamassassin/.razor/razor-agent.conf" >> /etc/mail/spamassassin/local.cf


  • VPS Server Scam/Review/Complaint List


    These are the only two I've encountered but here is the low-end and note my story is not at all unique.

    In my case I was scammed out of money and did not receive any service at all from either company.

    Santrex Review/Scam/Complaint

    • Santrex never provided any working server, I believe it was just a dummy management Solus server because the server said it was booted but never connected to the console.  I complained to them and eventually the support admitted the server was not working and to wait for 24 hours.  I waited for 4-days, after which they sent an e-mail saying my service was being disabled for SPAM ...(when SolusVM shows 0kb of traffic).  They aren't fazed by threats since their reputation couldn't get any worse.  They escalated the PayPal dispute after we provided our evidence and screenshots, along with proof that this case is not unique.

    Santrex is widely known as not only a company that does not provide what the customer asks, but when they do provide something it is often out of spec or an extremely poor and unreliable service with fees being stolen due to phony TOS violations.

    I thought I'd add it's ironic that they make up phony TOS SPAM notices to steal money and yet they are actually SPAMMERS themselves (if you use RBL's you'll probably find their e-mails blocked):

    	*  2.5 URIBL_SBL Contains an URL listed in the SBL blocklist
    	*      [URIs: santrex.net]
    

    Here are links to Santrex complaints/reviews/scams that tell a similar story about Santrex:

    www.thedave.ca/geek/santrex-net-worst-hosting-company-on-the-planet/comment-page-1/#comment-2350

    www.web-hosting-top.com/web-hosting/web-hosting-top.santrex.net/

    www.blackhatworld.com/blackhat-seo/shit-list/246599-santrex-webhosting-epic-fail-avoid-all-costs.html

    www.freeindex.co.uk/profile%28santrex-internet-services%29_77491.htm

    forums.digitalpoint.com/showthread.php

    Report Santrex to the local UK government by filling out this simple form (eventually they will be shut down if we all complain):

    http://www.tradingstandards.gov.uk/towerhamlets/complain.htm

     

    Santrex Scam Proof

    Virpus Review/Scam/Complaint

    • Virpus is advertised on LEB (lowendbox.com) and when I reported on LEB BLOG posts that I was scammed the comments were never approved (I tried several times).  This calls into serious question the trustworthiness of LEB when they seem to pick and choose what company they will call-out, and when they facilitate a company like Virpus.  My initial payment was refunded after days of not receiving the VPS, but a subscrption payment went through.  They ignored the requests in the ticket and by e-mail for a refund and even escalated the PayPal dispute that "we're assuming this is for a service that was provided" (when they obviously know otherwise by their own system).

    Virpus is known to take money from customers by also falsely claiming TOS violations, and aside from that is known to lose customer data and be extremely unreliable.

     

    Virpus Networks Scam Proof

     

    Links to Virpus complaints/reviews/scams:

    www.blackhatworld.com/blackhat-seo/shit-list/257359-virpus-scammed-me-proof-scam-method-inside.html

    Out of the dozens of providers I've tried, those two companies are the only ones who actually stole from me, and are also the only ones known to provide such poor and unreliable service, it seems the two go together.


  • Linux - mptbase/MPT Fusion LSI Logic Error mptbase: ioc0: ERROR - didn't initialize properly! (-1)


    kernel 2.6.27.54

    Fusion MPT base driver 3.04.07
    Copyright (c) 1999-2008 LSI Corporation
    Fusion MPT SPI Host driver 3.04.07
    mptbase: ioc0: Initiating bringup
    mptbase: ioc0: WARNING - Unexpected doorbell active!
    mptbase: ioc0: ERROR - Doorbell ACK timeout (count=4999), IntStatus=80000001!
    mptbase: ioc0: ERROR - Diagnostic reset FAILED! (102h)
    mptbase: ioc0: WARNING - NOT READY!
    mptbase: ioc0: ERROR - didn't initialize properly! (-1)
    mptspi: probe of 0000:01:04.0 failed with error -1
    ========
    Fixed by using modprobe and not building modules into the kernel:


    request_module: runaway loop modprobe net-pf-1
    SCSI subsystem initialized
    Fusion MPT base driver 3.04.07
    Copyright (c) 1999-2008 LSI Corporation
    Fusion MPT SPI Host driver 3.04.07
    mptbase: ioc0: Initiating bringup
    ioc0: LSI53C1030 B2: Capabilities={Initiator,Target}
    scsi0 : ioc0: LSI53C1030 B2, FwRev=01032300h, Ports=1, MaxQ=255, IRQ=29
    scsi 0:0:0:0: Direct-Access     SEAGATE  ST336607LW       DS09 PQ: 0 ANSI: 3
     target0:0:0: Beginning Domain Validation
     target0:0:0: Ending Domain Validation
     target0:0:0: FAST-160 WIDE SCSI 320.0 MB/s DT IU RTI WRFLOW PCOMP (6.25 ns, offset 63)
    scsi 0:0:1:0: Direct-Access     SEAGATE  ST336607LW       DS09 PQ: 0 ANSI: 3
     target0:0:1: Beginning Domain Validation
     target0:0:1: Ending Domain Validation
     target0:0:1: FAST-160 WIDE SCSI 320.0 MB/s DT IU RTI WRFLOW PCOMP (6.25 ns, offset 63)
    scsi 0:0:8:0: Direct-Access     SEAGATE  ST336607LW       0007 PQ: 0 ANSI: 3
     target0:0:8: Beginning Domain Validation
     target0:0:8: Ending Domain Validation
     target0:0:8: FAST-160 WIDE SCSI 320.0 MB/s DT IU RTI WRFLOW PCOMP (6.25 ns, offset 63)

     


  • SPAMASSASSIN Enable Pyzor and DCC


    *Remember to restart spamassassin after all of this.

    DCC

    wget http://www.dcc-servers.net/dcc/source/dcc.tar.Z
    tar -zxvf dcc.tar.Z
    cd dcc-1.3.138/
    ./configure;make;make install


    #enable DCC, uncomment the line that disables it near the top
    vi /etc/mail/spamassassin/v310.pre

    pyzor

    wget http://sourceforge.net/projects/pyzor/files/pyzor/0.5.0/pyzor-0.5.0.tar.gz/download
    tar -zxvf pyzor-0.5.0.tar.gz
    cd pyzor-0.5.0
    python setup.py build
    python setup.py install

    chmod -R a+rX /usr/share/doc/pyzor
                    /usr/lib/python2.4/site-packages/pyzor
                    /usr/bin/pyzor /usr/bin/pyzord

    change the "python2.4" path as necessary if you have a different python version.


  • Apache MPM worker vs prefork


    find what MPM Apache is using, it will either be using "worker" or "prefork"

    apachectl -l
    Compiled in modules:
      core.c
      prefork.c
      http_core.c
      mod_so.c


    In my case it is "prefork"

    vi /etc/httpd/conf/httpd.conf

    Find the section that looks like this (by default one will normally exist for prefork and for worker, but in my case I only care about prefork since prefork is what is compiled in):

    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # ServerLimit: maximum value for MaxClients for the lifetime of the server
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule prefork.c>
    StartServers      8
    MinSpareServers   5
    MaxSpareServers   20
    ServerLimit      2000
    MaxClients       5000
    MaxRequestsPerChild  4000
    </IfModule>

    As some have mentioned the MPM prefork/worker sections are VERY important they affect both stability and performance.
    In my case I'm the most concerned because I keep getting the MaxClients error message/hung Apache process without error (where Apache thinks it's running but can't connect and yet most of the time nothing in the debug log shows a problem).

    Enable Debug:

    Speaking of that you might want to enable this for debugging if you're having the issues I've seen (the crash but even with debug it often won't show the true error)

    Add this to your config file:  Loglevel debug

    Back to the issue, prefork means a new process/server is started for each new connection to the web server.

    My new settings:

    <IfModule prefork.c>
    StartServers      200
    MinSpareServers   50
    MaxSpareServers   200
    ServerLimit      400
    MaxClients       1000
    MaxRequestsPerChild  0
    </IfModule>


     WARNING: MaxClients of 1000 exceeds ServerLimit value of 400 servers,
     lowering MaxClients to 400.  To increase, please see the ServerLimit
     directive.

    Change ServerLimit to "4000" and restart


  • Virtualbox - Failed to open a session for the virtual machine XP. AMD-V is being used by another hypervisor. (VERR_SVM_IN_USE). - Solution


    Failed to open a session for the virtual machine XP.
    AMD-V is being used by another hypervisor. (VERR_SVM_IN_USE).
    VirtualBox can't enable the AMD-V extension. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_SVM_IN_USE)

    Solution - Unload KVM module (you can't use two hardware virtualization suites at once)


    sudo rmmod kvm_amd kvm


  • 95th Percentile Billing vs Usage Billing, what's better?


    There are all kinds of threads and links on the internet, and this seems to be a contentious issue but I don't know why.

    95th percentile is either a good deal for some or a big rip off for others, I just said it there :)

    But the reality is that for MOST people who transfer low amounts of data but burst to higher speeds such as 40mbit+ even for short periods of time, then you'll pay a lot of money to do that.

    Basically 95th percentile is an-old archaic method of billing and valuing data.  Why wouldn't it always be according to usage?  Well because most providers pay by 95th percentile so they like to pass  on the same model to the customer.

    It makes far more sense to charge per mbit in the sense that 1mbit = 322GB of data bursting at whatever port speed you have or just the equivalent rate in GB, but of course that wouldn't be profitable.  With 95th percentile it's easy to pay for several times more data than you actually transferred and used.  Imagine if you payed more for power or water just because you used a lot of power for short periods of time even though your overall usage is miniscule?

    If you can find a co-lo provider that gives you 1-2TB of flat data, that's a great deal compared to 95th percentile.  I'm so annoyed by 95th percentile that I'm considering on switching to another provider that works this way.  You'll find 9/10 people who arrogantly and rudely broadcast their thoughts about 95th percentile are people that stand to benefit by billing that way and don't want people to think otherwise.

    Real Life Example of Colo Client

    This is why I don't see how 95th benefits anyone but the ISP. 

    Look at the exampe below.

     

    Interface Current Rate Max Rate 95th %
    Name Description Router In (Mbps) Out (Mbps) In Out In Out
          0.63 0.21 20.81 8.28 1.66 1.11

    Only .63 mbit was transferred out and only .21 mbit was transferred in.

    This is a total transfer of .84mbit which is about 270 GB of actual data transfer.

    But you don't get billed for the .84mbit.  You get billed for the 95th percentile (1.66mbit) which ends up being more than twice the cost of actual data usage and transfer.

    The 95th percentile in essence ends up double charging you based on how much data you transfer and how fast you transfer it (burst rate).  I can't see any possible situation where it would save you money, nor do is it fair or beneficial to the customer to pay for bursting, it should be based on usage.  If a 100mbit port speed is provided, you shouldn't be penalized for using it too quickly, but only for how much

    Here's some articles on 95th percentile:

    http://webdesign.about.com/od/colocation/a/aa012405.htm

    http://www.antonolsen.com/2007/07/18/95th-percentile-bandwidth-tracking/

    http://www.ocmodshop.com/ocmodshop.aspx?a=363&p=987


  • Virpus Review/Scam/Complaint


    Virpus Review/Scam/Complaint

    • Virpus is advertised on LEB (lowendbox.com).  My initial payment was refunded after days of not receiving the VPS, but two subscrption payments went through and I only received notification after the second one.  They ignored the requests in the ticket and by e-mail for a refund and even escalated the PayPal dispute that "we're assuming this is for a service that was provided" (when they obviously know otherwise by their own system).

    Virpus is known to take money from customers by also falsely claiming TOS violations, and aside from that is known to lose customer data and be extremely unreliable.

    You can see my account status in the screen below, it clearly shows a credit balance yet Virpus ignored my requests for a refund and even lied to PayPal and said the service was provided.

     

    Virpus Networks Scam Proof

     

    Links to Virpus complaints/reviews/scams:

    www.blackhatworld.com/blackhat-seo/shit-list/257359-virpus-scammed-me-proof-scam-method-inside.html


  • Firefox Download Error - /tmp/J_5JHKXU.bin.part could not be saved, because the source file could not be read. Try again later, or contact the server administrator.


    /tmp/J_5JHKXU.bin.part could not be saved, because the source file could not be read.

    Try again later, or contact the server administrator.

    This is actually not a download problem related to the server/site you're using but actually some weird bug with Firefox.  I know because no matter what site I tried to download from this error kept happening.

    Simpy restarting Firefox was enough to get things working again.


  • Linux High IOWAIT updatedb can't be killed and crash with mdadm


    high IO wait

      424 root      39  19  1900  848  552 D  0.0  0.0   0:00.91 updatedb

    root       424  0.0  0.0   1900   848 ?        DN   Mar11   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root      2907  0.0  0.0   1768   492 ?        DN   Mar15   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root      8691  0.0  0.0   1768   492 ?        DN   Mar12   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root     10642  0.0  0.0   4004   696 pts/0    S+   00:38   0:00 grep updatedb
    root     14937  0.0  0.0   1768   492 ?        DN   Mar16   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root     16697  0.0  0.0   1768   488 ?        DN   Mar13   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root     18790  0.0  0.0   1768   496 ?        DN   Mar18   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root     24783  0.0  0.0   1768   500 ?        DN   Mar14   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root     24922  0.0  0.0   1768   492 ?        DN   Mar17   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs
    root     29655  0.0  0.0   1768   496 ?        DN   Mar19   0:00 /usr/bin/updatedb -f sysfs?rootfs?bdev?proc?cpuset?binfmt_misc?debugfs?sockfs?usbfs?pipefs?anon_inodefs?futexfs?tmpfs?inotifyfs?eventpollfs?devpts?ramfs?hugetlbfs?mqueue?rpc_pipefs?autofs


    I noticed that updatedb was running for days and then this dmesg message:

    (manually killing the process and also killall updatedb does not stop it or kill it)

    INFO: task updatedb:424 blocked for more than 300 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    updatedb      D F79C8CF0  6476   424    419                     (NOTLB)
           e740bdd4 00000086 c30045c0 000e2832 f7acea4c 00000001 f79c8cf0 c30f8800
           000e2832 000f4240 556bd125 0024f991 f79c8e14 f7d14000 556bf321 0024f991
           00000002 00000000 00000001 00000000 c0419058 f7d14000 c06ecd80 f7a0cdec
     Call Trace:
     [<c0419058>] __wake_up+0x2a/0x3d
     [<c0625676>] io_schedule+0x3b/0x64
     [<c0460ead>] sync_page+0x0/0x3b
     [<c0460ee5>] sync_page+0x38/0x3b
     [<c062578e>] __wait_on_bit_lock+0x2a/0x52
     [<c0460e28>] __lock_page+0x52/0x59
     [<c0436000>] wake_bit_function+0x0/0x3c
     [<c04686c9>] truncate_inode_pages_range+0x20b/0x260
     [<f8c698d3>] journal_stop+0x208/0x213 [jbd]
     [<c0468727>] truncate_inode_pages+0x9/0xe
     [<f8ca5a1e>] ext3_delete_inode+0x13/0xba [ext3]
     [<f8ca5a0b>] ext3_delete_inode+0x0/0xba [ext3]
     [<c0499c51>] generic_delete_inode+0x91/0xfe
     [<c0499728>] iput+0x67/0x69
     [<c04970dd>] d_kill+0x19/0x32
     [<c049821d>] dput+0x19f/0x1ac
     [<c04909c3>] sys_renameat+0x15f/0x1af
     [<c04ebb8e>] _atomic_dec_and_lock+0x2a/0x44
     [<c0453cf8>] audit_syscall_entry+0x160/0x192
     [<c0490a24>] sys_rename+0x11/0x15
     [<c06289e7>] syscall_call+0x7/0xb
     =======================

    kill -9 424
    strace -p 424

    Process 424 attached - interrupt to quit

    attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted

    ==========================
    Eventually the system crashed with references to ext3 and inodes etc..
    After a reboot it did the following:

    md: md0: raid array is not clean -- starting background reconstruction
    raid1: raid set md0 active with 2 out of 2 mirrors
    md: ... autorun DONE.
    md: syncing RAID array md0
    md: Autodetecting RAID arrays.
    md: autorun ...
    md: ... autorun DONE.
    md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    md: using 128k window, over a total of 511999424 blocks.
    EXT3-fs: INFO: recovery required on readonly filesystem.
    EXT3-fs: write access will be enabled during recovery.
    kjournald starting.  Commit interval 5 seconds
    EXT3-fs: md0: orphan cleanup on readonly fs
    ext3_orphan_cleanup: deleting unreferenced inode 97467990
    ext3_orphan_cleanup: deleting unreferenced inode 76153118
    EXT3-fs: md0: 2 orphan inodes deleted
    EXT3-fs: recovery complete.
    EXT3-fs: mounted filesystem with ordered data mode.
     


  • Yahoo Mail (email) DNS Server Out Of Date Problems


    I don't expect this to be solved soon but some of Yahoo's DNS servers are out of whack.  I changed the IPs of some nameservers of some domains and now most Yahoo users can't e-mail to those domains!

    As you can see below by the "No MX or A records for mychangedomain.com", now Yahoo's DNS/mailserver DNS cache is wrong.  You would think they would at least have cached the old incorrect records, but instead for some reason their DNS cache has no entry and doesn't seem to want to update itself.  Hotmail and Gmail all work fine, and some Yahoo users (probably on different nodes with different DNS) are able to e-mail me.  These DNS changes were now done over 2 months ago so it's not simply a matter of slow propagation time to Yahoo DNS Servers.

    I'm sure that I'm not the only one, other sysadmins who have changed nameservers IPs may have noticed this.  Basically when you send an e-mail to the affected domains you'll get a bounceback like below (it may take minutes, hours or days to get the bounceback).

    This is a real annoyance since many people use Yahoo mail.

    I actually contacted them about it and nothing was done but I did receive some sort of template/automated response that the issue was forwarded and escalated.  I never heard anything further for days and then I sent followup e-mails and not only were they ignored but suddenly my Yahoo mail account was inaccessible.

    Failure Notice
    ...
    From:   
    "MAILER-DAEMON@nm19.bullet.mail.ne1.yahoo.com" <MAILER-DAEMON@nm19.bullet.mail.ne1.yahoo.com>  [Chat now]
    ...
    Add to Contacts
    Sorry, we were unable to deliver your message to the following address.

    <user@mychangedomain.com>:
    No MX or A records for mychangedomain.com

    --- Below this line is a copy of the message.

    Received: from [98.138.90.55] by nm19.bullet.mail.ne1.yahoo.com with NNFMP; 28 Mar 2011 08:41:39 -0000
    Received: from [98.138.87.2] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 28 Mar 2011 08:41:36 -0000
    Received: from [127.0.0.1] by omp1002.mail.ne1.yahoo.com with NNFMP; 28 Mar 2011 08:41:36 -0000
    X-Yahoo-Newman-Property: ymail-3
    X-Yahoo-Newman-Id: 85723.72865.bm@omp1002.mail.ne1.yahoo.com
    Received: (qmail 42791 invoked by uid 60001); 28 Mar 2011 08:41:35 -0000
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1301301695; bh=wx4RiKYlHcoyZoYUjZHx8K6MF8wQ1K/sbLsQjPLE5fI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=duaEA/s3E70zLsLXgcHeILphV9fGNuHEIqV48rEIBzGFNd8gPyAxOXO5tKI2zO1EM8OBzd1Ou8VzfqF3vvrhYSGzt75O77/8flKR4IRmaUXwlzNHtp4oAKiDumZ879lHl7VOraxI13IM6CdKeATCEYM06Msfb5aosC4mHa1c6Is=
    DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws;
      s=s1024; d=yahoo.com;
      h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type;
      b=2qG7JakvDlcjFHS9vFXNmqab4QgyFrOkMe0eLUoXPssnnBG02sjzLMHFi1GRGs98cp79leYqHO6yYDXUBvgtiZSrrRYrXFuqfizKsLny9zJ5bQMMq4T4U9vtmNFXvL9Xk7tMtY0DZtegjinomTOVpKua18hS4XgiWYjT9gEFTvI=;
    Message-ID: <879745.46782.qm@web121610.mail.ne1.yahoo.com>
    X-YMail-OSG: PTsb7J4VM1n3oxK5NWarlmnFuvB5Y7RUEpEwGcKVbkB04D1
    PBHJG_VPG.LWruo8SSbcUFN4vLR6Af1WLJTBZdqcBDyPejFfqYX13wqZwMHq
    OIdgxtoApIixpHmBBaBunDAcEX.HVVGgI4amFS6ZQK4BAx0xzyP0bmBFPOvO
    3K6k23pTJkWD_25X113W2r0j2ryNTE9JwIVWxEepLdiEImFt0DAsnxbnE2zX
    oKsVh4hYsVrv7ciLPBPDUhtbuZPPBiV0B_izYKV0IUJnlSJ066ny4Ipm9cd1
    MRhoYVDkwWIJo9T_GUP7KDirCnY9vbBLgyuXJ3u7fkA--
    Received: from [] by web121610.mail.ne1.yahoo.com via HTTP; Mon, 28 Mar 2011 01:41:35 PDT
    X-Mailer: YahooMailRC/559 YahooMailWebService/0.8.109.295617


  • Drupal 6.2 Install and how to move install to root/non-subdirectory


    drup 6.2 install
    $cd drupgoodinst3883/
    [ drupgoodinst3883]$ ls
    CHANGELOG.txt  cron.php  index.php          INSTALL.pgsql.txt  INSTALL.txt  MAINTAINERS.txt  modules   robots.txt  sites   update.php   xmlrpc.php
    COPYRIGHT.txt  includes  INSTALL.mysql.txt  install.php        LICENSE.txt  misc             profiles  scripts     themes  UPGRADE.txt
    [ drupgoodinst3883]$ ls sites/default/default.settings.php
    [ drupgoodinst3883]$ cd sites/default/

    #The Drupal installer requires write permissions to ./sites/default/settings.php during the installation process. If you are unsure how to grant file
    #permissions, please consult the on-line handbook.

    [ default]$ cp default.settings.php settings.php
    mkdir files; chmod 777 files
    chmod 777 settings.php

     

    Move Drupal Install to Root and not a Subdirectory

    1. Copy the contents of the directory where you installed drupal to the main root of your site eg. /var/www/vhosts/yoursite.com/
    2. Manually copy the .htaccess file from your Drupal install (this is the only real requirement for moving your Drupal installation -or you'll get lots of weird errors/things won't work right).

     


  • Convert PDF to JPG/JPEG without low resolution/small picture size


    convert -density 400 somepdf.pdf -scale 2000x1000 output.jpg

    The key is the "-density 400" switch and also -scale 2000x1000

    To give credit I found the solution here: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10928

    That was the perfect solution when I was frustrated with how small the resulting JPG's resulted.  I'm sure this will help a lot of people when it comes time to converting a PDF to JPG which I'm amazed ImageMagick can do.  It has got to be one of the best utilies of all time in my opinion.


  • diff: memory exhausted


    I don't have a solution other than to use rsync, I used diff on about 1.7TB of data which includes hundreds of thousands if not millions of small files to ensure nothing was missing or corrupt.

    diff didn't even get past the first large directory without spitting that error out.

    Keep in mind I used "diff -r" because that means recursive, otherwise it wouldn't compare all files and subdirectories and would be a false way of doing it.


  • monit example tutorial how to enable status checking and manipulation


    You need to enable the httpd daemon with monit to actually view the status and control, it's not only for the web interface since the httpd is the ONLY way of controlling monit and viewing the status.

    monit monitor all will also reinstate disabled services if they've timed out too much.  Just restarting the service will do nothing to re-monitor a service that monit has stopped monitoring due to too many failures.

    *Also note that /etc/monit.conf is what is used for configuring all parameters, the monitrc file seems to be deprecated, this includes setting the daemon time:

    monit -c /etc/monitrc status
    monit: The control file '/etc/monitrc' must have permissions no more than -rwx------ (0700); right now permissions are -rw-r--r-- (0644).
    [root@boxhost vhosts]# chmod 700 /etc/monitrc
    [root@boxhost vhosts]# monit -c /etc/monitrc status
    monit: generated unique Monit id f9a36510746eba21b0ec9418de8850d5 and stored to '/root/.monit.id'
    monit: error connecting to the monit daemon
    [root@boxhost vhosts]# monit -c /etc/monitrc status
    monit: error connecting to the monit daemon

    edit /etc/monit.conf (change the paths as appropriate too):


    set httpd port 2812
      allow localhost

     set daemon  60           # check services at 2-minute intervals
    set idfile /var/monit/id
    set statefile /var/monit/state
     set mailserver localhost               # primary mailserver
     set alert youremail@host.com
      check file apache_bin with path /usr/sbin/httpd
      check process apache with pidfile /usr/local/apache/logs/httpd.pid every 2 cycles
        start program = "/etc/init.d/httpd start" with timeout 60 seconds
        stop program  = "/etc/init.d/httpd stop"
        #if cpu > 60% for 2 cycles then alert
        #if cpu > 80% for 5 cycles then restart
        #if totalmem > 200.0 MB for 5 cycles then restart
        #if children > 250 then restart
        #if loadavg(5min) greater than 10 for 8 cycles then stop
        if failed host yourserver.com port 80 protocol http
           and request "/"
           with timeout 15 seconds
           then restart
        #if failed port 443 type tcpssl protocol http
        #   with timeout 15 seconds
        #   then restart
        if 2 restarts within 2 cycles then exec "/usr/bin/killall -9 httpd;/sbin/service httpd restart"
        depends on apache_bin
        group server
    include /etc/monit.d/*

    service monit restart
     


  • Dying Samsung DVDRW Drive


    My Samsung drive failed on me, at first I thought it was the enclosure but a direct SATA connection causes the same problems for discs that are inserted.  It will work fine for a few minutes but then starts spewing the errors below.

    I've never been a fan of Korean made optical drives and have always had trouble with them.  The problem is that I don't believe NEC and Lite-ON make drives anymore, and I considered them the leaders.

     

    Apr  7 11:58:48 box kernel: [71534.740594] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 04 00 00 00 02 00
    Apr  7 11:58:48 box kernel: [71534.763443] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 11:58:48 box kernel: [71534.763454] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
    Apr  7 11:58:48 box kernel: [71534.763464] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range
    Apr  7 11:58:48 box kernel: [71534.763474] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 02 00
    Apr  7 11:58:48 box kernel: [71534.765714] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 11:58:48 box kernel: [71534.765725] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
    Apr  7 11:58:48 box kernel: [71534.765734] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range
    Apr  7 11:58:48 box kernel: [71534.765745] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 02 00
    Apr  7 11:58:48 box kernel: [71534.785779] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 11:58:48 box kernel: [71534.785790] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
    Apr  7 11:58:48 box kernel: [71534.785800] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range
    Apr  7 11:58:48 box kernel: [71534.785811] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 01 00
    Apr  7 11:58:48 box kernel: [71534.787761] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 11:58:48 box kernel: [71534.787772] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
    Apr  7 11:58:48 box kernel: [71534.787782] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range
    Apr  7 11:58:48 box kernel: [71534.787792] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 01 00 00 01 00
    Apr  7 11:58:48 box kernel: [71534.789910] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 11:58:48 box kernel: [71534.789921] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
    Apr  7 11:58:48 box kernel: [71534.789931] sr 1:0:0:0: [sr0] Add. Sense: Logical block address out of range
    Apr  7 11:58:48 box kernel: [71534.789942] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 02 00
    Apr  7 12:10:38 box kernel: [72245.143338] sr 1:0:0:0: [sr0] Unhandled sense code
    Apr  7 12:10:38 box kernel: [72245.143347] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 12:10:38 box kernel: [72245.143356] sr 1:0:0:0: [sr0] Sense Key : Medium Error [current]
    Apr  7 12:10:38 box kernel: [72245.143367] sr 1:0:0:0: [sr0] Add. Sense: L-EC uncorrectable error
    Apr  7 12:10:38 box kernel: [72245.143378] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 05 6a 50 00 00 02 00
    Apr  7 12:10:38 box kernel: [72245.144761] __ratelimit: 506 callbacks suppressed
    Apr  7 12:10:43 box kernel: [72249.989290] sr 1:0:0:0: [sr0] Unhandled sense code
    Apr  7 12:10:43 box kernel: [72249.989299] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 12:10:43 box kernel: [72249.989308] sr 1:0:0:0: [sr0] Sense Key : Medium Error [current]
    Apr  7 12:10:43 box kernel: [72249.989319] sr 1:0:0:0: [sr0] Add. Sense: L-EC uncorrectable error
    Apr  7 12:10:43 box kernel: [72249.989329] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 05 6a 50 00 00 02 00
    Apr  7 12:10:48 box kernel: [72254.834402] sr 1:0:0:0: [sr0] Unhandled sense code
    Apr  7 12:10:48 box kernel: [72254.834412] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 12:10:48 box kernel: [72254.834421] sr 1:0:0:0: [sr0] Sense Key : Medium Error [current]
    Apr  7 12:10:48 box kernel: [72254.834432] sr 1:0:0:0: [sr0] Add. Sense: L-EC uncorrectable error
    Apr  7 12:10:48 box kernel: [72254.834442] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 05 6a 50 00 00 02 00
    Apr  7 12:10:53 box kernel: [72259.755456] sr 1:0:0:0: [sr0] Unhandled sense code
    Apr  7 12:10:53 box kernel: [72259.755465] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    Apr  7 12:10:53 box kernel: [72259.755475] sr 1:0:0:0: [sr0] Sense Key : Medium Error [current]
    Apr  7 12:10:53 box kernel: [72259.755485] sr 1:0:0:0: [sr0] Add. Sense: L-EC uncorrectable error
    Apr  7 12:10:53 box kernel: [72259.755496] sr 1:0:0:0: [sr0] CDB: Read(10): 28 00 00 05 6a 50 00 00 02 00


  • MYSQL Error Can't find file: './wf/Sessions.frm' (errno: 13) Solution


    mysql errors even though these files do exist:

    110405 13:21:37  InnoDB: Operating system error number 13 in a file operation.
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.
    InnoDB: File name ./ibdata1
    InnoDB: File operation call: 'open'.
    InnoDB: Cannot continue operation.
    110405 13:26:15  InnoDB: Operating system error number 13 in a file operation.
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.
    InnoDB: File name ./ibdata1
    InnoDB: File operation call: 'open'.
    InnoDB: Cannot continue operation.
    110405 13:28:50  InnoDB: Operating system error number 13 in a file operation.
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.
    InnoDB: File name ./ibdata1
    InnoDB: File operation call: 'open'.
    InnoDB: Cannot continue operation.

    InnoDB: File name ./ibdata1
    InnoDB: File operation call: 'open'.
    InnoDB: Cannot continue operation.
    110405 13:26:15  InnoDB: Operating system error number 13 in a file operation.

    I accidentally set all ownership on everything in /var/lib to root.root

    This meant that the normal mysql directory now had root ownership, so MySQL could no longer read its own files.

    I was getting worried because one by one my databases couldn't be read, I feared the worse (a RAID array corruption), but fortunately it was just an idiotic and simple mistake to fix.

    So the "error 13" is correct, that basically the DB lacks permissions to access the relevant files.


  • Are my WDEARS20 Drives dying already?


    This happened during a RAID array check:

    SMART says both drives pass the test, but I'm doing a long test on them and hopefully this is not a hardware error.

    Apr  3 04:22:01 remote kernel: md: syncing RAID array md2
    Apr  3 04:22:01 remote kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Apr  3 04:22:01 remote kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Apr  3 04:22:01 remote kernel: md: using 128k window, over a total of 488287552 blocks.
    Apr  3 04:22:01 remote kernel: md: delaying resync of md1 until md2 has finished resync (they share one or more physical units)
    Apr  3 04:29:28 remote ntpd[7131]: synchronized to 24.215.0.24, stratum 2
    Apr  3 05:25:01 remote auditd[6570]: Audit daemon rotating log files
    Apr  3 08:35:07 remote kernel: ata4.00: exception Emask 0x0 SAct 0x7fffffff SErr 0x0 action 0x0
    Apr  3 08:35:07 remote kernel: ata4.00: irq_stat 0x40000008
    Apr  3 08:35:07 remote kernel: ata4.00: cmd 60/80:80:c0:41:69/00:00:42:00:00/40 tag 16 ncq 65536 in
    Apr  3 08:35:07 remote kernel:          res 41/40:00:38:42:69/cd:00:42:00:00/40 Emask 0x409 (media error) <F>
    Apr  3 08:35:07 remote kernel: ata4.00: status: { DRDY ERR }
    Apr  3 08:35:07 remote kernel: ata4.00: error: { UNC }
    Apr  3 08:35:07 remote kernel: ata4.00: configured for UDMA/133
    Apr  3 08:35:07 remote kernel: ata4: EH complete
    Apr  3 08:35:07 remote kernel: SCSI device sdb: 3907029168 512-byte hdwr sectors (2000399 MB)
    Apr  3 08:35:07 remote kernel: sdb: Write Protect is off
    Apr  3 08:35:07 remote kernel: SCSI device sdb: drive cache: write back
    Apr  3 08:35:09 remote kernel: ata4.00: exception Emask 0x0 SAct 0x5f8079ff SErr 0x0 action 0x0
    Apr  3 08:35:21 remote kernel: ata4.00: irq_stat 0x40000008
    Apr  3 08:35:21 remote kernel: ata4.00: cmd 60/80:70:c0:41:69/00:00:42:00:00/40 tag 14 ncq 65536 in
    Apr  3 08:35:21 remote kernel:          res 41/40:00:38:42:69/cd:00:42:00:00/40 Emask 0x409 (media error) <F>
    Apr  3 08:35:21 remote kernel: ata4.00: status: { DRDY ERR }
    Apr  3 08:35:21 remote kernel: ata4.00: error: { UNC }
    Apr  3 08:35:21 remote kernel: ata4.00: configured for UDMA/133
    Apr  3 08:35:21 remote kernel: ata4: EH complete
    Apr  3 08:35:21 remote kernel: SCSI device sdb: 3907029168 512-byte hdwr sectors (2000399 MB)
    Apr  3 08:35:21 remote kernel: sdb: Write Protect is off
    Apr  3 08:35:21 remote kernel: SCSI device sdb: drive cache: write back
    Apr  3 08:35:21 remote kernel: ata4.00: exception Emask 0x0 SAct 0xfffff SErr 0x0 action 0x0
    Apr  3 08:35:21 remote kernel: ata4.00: irq_stat 0x40000008
    Apr  3 08:35:21 remote kernel: ata4.00: cmd 60/80:38:c0:41:69/00:00:42:00:00/40 tag 7 ncq 65536 in
    Apr  3 08:35:21 remote kernel:          res 41/40:00:38:42:69/cd:00:42:00:00/40 Emask 0x409 (media error) <F>
    Apr  3 08:35:21 remote kernel: ata4.00: status: { DRDY ERR }
    Apr  3 08:35:21 remote kernel: ata4.00: error: { UNC }
    Apr  3 08:35:21 remote kernel: ata4.00: configured for UDMA/133
    Apr  3 08:35:21 remote kernel: ata4: EH complete
    Apr  3 08:35:21 remote kernel: SCSI device sdb: 3907029168 512-byte hdwr sectors (2000399 MB)
    Apr  3 08:35:21 remote kernel: sdb: Write Protect is off
    Apr  3 08:35:21 remote kernel: SCSI device sdb: drive cache: write back
    Apr  3 08:35:21 remote kernel: ata4.00: exception Emask 0x0 SAct 0xb9800 SErr 0x0 action 0x0
    Apr  3 08:35:21 remote kernel: ata4.00: irq_stat 0x40000008
    Apr  3 08:35:21 remote kernel: ata4.00: cmd 60/80:60:c0:41:69/00:00:42:00:00/40 tag 12 ncq 65536 in
    Apr  3 08:35:22 remote kernel:          res 41/40:00:38:42:69/cd:00:42:00:00/40 Emask 0x409 (media error) <F>
    Apr  3 08:35:22 remote kernel: ata4.00: status: { DRDY ERR }
    Apr  3 08:35:22 remote kernel: ata4.00: error: { UNC }
    Apr  3 08:35:22 remote kernel: ata4.00: configured for UDMA/133
    Apr  3 08:35:22 remote kernel: ata4: EH complete
    Apr  3 08:35:22 remote kernel: SCSI device sdb: 3907029168 512-byte hdwr sectors (2000399 MB)
    Apr  3 08:35:22 remote kernel: sdb: Write Protect is off
    Apr  3 08:35:22 remote kernel: SCSI device sdb: drive cache: write back
    Apr  3 08:35:22 remote kernel: ata4.00: exception Emask 0x0 SAct 0x3f SErr 0x0 action 0x0
    Apr  3 08:35:22 remote kernel: ata4.00: irq_stat 0x40000008
    Apr  3 08:35:22 remote kernel: ata4.00: cmd 60/80:20:c0:41:69/00:00:42:00:00/40 tag 4 ncq 65536 in
    Apr  3 08:35:22 remote kernel:          res 41/40:00:38:42:69/cd:00:42:00:00/40 Emask 0x409 (media error) <F>
    Apr  3 08:35:22 remote kernel: ata4.00: status: { DRDY ERR }
    Apr  3 08:35:22 remote kernel: ata4.00: error: { UNC }
    Apr  3 08:35:22 remote kernel: ata4.00: configured for UDMA/133
    Apr  3 08:35:22 remote kernel: ata4: EH complete
    Apr  3 08:35:22 remote kernel: SCSI device sdb: 3907029168 512-byte hdwr sectors (2000399 MB)
    Apr  3 08:35:22 remote kernel: sdb: Write Protect is off
    Apr  3 08:35:22 remote kernel: SCSI device sdb: drive cache: write back
    Apr  3 08:35:22 remote kernel: ata4.00: exception Emask 0x0 SAct 0x32 SErr 0x0 action 0x0
    Apr  3 08:35:22 remote kernel: ata4.00: irq_stat 0x40000008
    Apr  3 08:35:22 remote kernel: ata4.00: cmd 60/80:08:c0:41:69/00:00:42:00:00/40 tag 1 ncq 65536 in
    Apr  3 08:35:22 remote kernel:          res 41/40:00:38:42:69/cd:00:42:00:00/40 Emask 0x409 (media error) <F>
    Apr  3 08:35:22 remote kernel: ata4.00: status: { DRDY ERR }
    Apr  3 08:35:22 remote kernel: ata4.00: error: { UNC }
    Apr  3 08:35:22 remote kernel: ata4.00: configured for UDMA/133
    Apr  3 08:35:22 remote kernel: sd 3:0:0:0: SCSI error: return code = 0x08000002
    Apr  3 08:35:22 remote kernel: sdb: Current [descriptor]: sense key: Medium Error
    Apr  3 08:35:22 remote kernel:     Add. Sense: Unrecovered read error - auto reallocate failed
    Apr  3 08:35:22 remote kernel:
    Apr  3 08:35:22 remote kernel: Descriptor sense data with sense descriptors (in hex):
    Apr  3 08:35:22 remote kernel:         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
    Apr  3 08:35:22 remote kernel:         42 69 42 38
    Apr  3 08:35:22 remote kernel: end_request: I/O error, dev sdb, sector 1114194488
    Apr  3 08:35:22 remote kernel: ata4: EH complete
    Apr  3 08:35:22 remote kernel: SCSI device sdb: 3907029168 512-byte hdwr sectors (2000399 MB)
    Apr  3 08:35:22 remote kernel: sdb: Write Protect is off
    Apr  3 08:35:22 remote kernel: SCSI device sdb: drive cache: write back
    Apr  3 08:46:45 remote kernel: md: md2: sync done.
    Apr  3 08:46:45 remote kernel: md: syncing RAID array md1
    Apr  3 08:46:45 remote kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
    Apr  3 08:46:45 remote kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
    Apr  3 08:46:45 remote kernel: md: using 128k window, over a total of 29302464 blocks.
    Apr  3 08:46:45 remote kernel: RAID1 conf printout:
    Apr  3 08:46:45 remote kernel:  --- wd:2 rd:2
    Apr  3 08:46:45 remote kernel:  disk 0, wo:0, o:1, dev:sda3
    Apr  3 08:46:45 remote kernel:  disk 1, wo:0, o:1, dev:sdb3
    Apr  3 08:51:54 remote kernel: md: md1: sync done.
    Apr  3 08:51:54 remote kernel: RAID1 conf printout:
    Apr  3 08:51:54 remote kernel:  --- wd:2 rd:2
    Apr  3 08:51:54 remote kernel:  disk 0, wo:0, o:1, dev:sda2
    Apr  3 08:51:54 remote kernel:  disk 1, wo:0, o:1, dev:sdb2
     


  • telnet force escape/quite with Ctrl + ]


    telnet localhost 80
    Trying localhost...
    Connected to localhost).
    Escape character is '^]'.
    ^]
    telnet>

    A lot of people don't know that "^" means the Control Key, so many times you can't force quite telnet without knowing that (Ctrl + C won't always work).

    *Just use Ctrl + ]

    I hope this saves some time and frustration from some people.


  • GREP how to ignore blank lines


    grep -v '^$'

  • SMARTCTL additional SMART command testing using short and long tests


    smartctl -t long /dev/sda (note you can specify short, but it's not as thorough as long of course).


    smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
    Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
    Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
    Testing has begun.
    Please wait 161 minutes for test to complete.
    Test will complete after Fri Apr  8 14:59:25 2011

    Use smartctl -X to abort test.

    Then just check the smartctl status again with smartctl -a /dev/sda once the test should have completed:

     

     


  • phpMyAdmin - Error Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.


    The fix for this was setting the correct permissions in /var/lib/php, it needs to be "root.root"

    And /var/lib/php/session needs to be "root.apache" to work properly.

    After that I was able to login to phpMyAdmin as normal.  This whole thing happened because I accidentally changed all of /var/lib to root.root.


  • encrypt bash scripts to hide source code


    http://www.datsi.fi.upm.es/~frosal/

    SHC is a program written by the author above that does just that, it's a great little tool to have.

    Some have said it isn't exactly encrypting the code but just making it hard to read by obfuscating the code.

    There was also a good discussion about that here: http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1302465567943+28353475&threadId=1192978

    http://nixcraft.com/shell-scripting/12097-binary-conversion-shell-script-shell-script-compiler.html


  • Linux OCR Comparison


    http://www.splitbrain.org/blog/2010-06/15-linux_ocr_software_comparison

    They did a great writeup and comparison on the different OCR options available for Linux.


  • Upgade VBOX/Virtualbox 3.2 to 4.0 in Linux


    I was afraid to remove the virtualbox 3.2 package in Ubuntu because I didn't know if it might remove the .virtualbox folder which contains all of my VM data.

    I have a backup so I did remove the package and found everything was intact, so I installed and upgrade to VBOX 4.0 which seems to be a huge improvement, especially in UI performance.


  • iPhone 3G/3GS/4 Undelete Photos/Videos Datarecovery


    I found this technique listed in many places which shows you how to use a common Linux tool "dd" to dump the raw partition of your iPhone.

    I give credit to this site for showing me the correct way to dd from the iPhone, I never thought to try it in the other direction: http://log.ijulien.com/post/182804914/iphone-3gs-data-recovery

    Requirements

    1.) Jailbreak your phone

    2.) Install OpenSSH on your phone

    Steps

    *WARNING - make sure that you don't mix up the if= and of= commands, if you make that mistake your iphone will either be bricked and you will lose data for sure.

    1.) From your computer (from the shell/terminal) run this command (*Note you must run it from your computer and not your iPhone, otherwise it won't work):

    Correct Command: ssh root@youriphoneipaddress dd if=/dev/rdisk0s2s1 bs=1M | dd of=iphonebackup.img

    This command is posted all over but doesn't work: dd bs=4096 if=/dev/disk0s2s1 | ssh user@192.168.1.125 ‘dd of=iphonebackup.img'
    /bin/dd: opening `/dev/disk0s2s1’: Resource busy

    2.) Recover with testdisk/photorec

    Just point photorec to the image, and it will ask you a few questions and do the rest.

    I was able to recover a lot of things but some .mov files don't play, I believe they may be alright but I need to find a way to fix the header (the header seems to be missing so they won't work).


  • PayPal Solution - Error Detected Error Message We were unable to decrypt the certificate id. We were unable to decrypt the certificate id.


    Error Detected


    Error Message

    We were unable to decrypt the certificate id.

    We were unable to decrypt the certificate id.
     

    Solution for "unable to decrypt the certificate id".

    Let me start by saying there are many reasons this can happen, it's best to start with a good and known to work template.

    Here are some common things that cause this message:

    • Having extra spaces/formatting in the variables you are making part of your encrypted payment.
    • Having duplicate fields

    Here is what happened to my client and may be happening to others:

    Mixing up your public key and PayPal's public key, it sounds funny but I've seen this enough times.

    So make sure you check the contents of all the keys, see if they match.  It's easy when transferring the keys around to different machines to mix them up.

    Solution was to make sure your public key and paypal's public key don't get mixed up.  I saw a case where both keys were the same (either both were PayPal or both were the client's public key).


  • htaccess modrewrite problem with rewriting url with- dashes solution


    I was getting frustrated with trying to write a simple URL like this:

    /example-withdash

    I used the htaccess code like this:

    Rewriterule ^example-withdash$ / [R=301]

    I also tried escaping the dash which I thought should have treated it as a literal but that didn't work either:

    Rewriterule ^example-withdash$ / [R=301]

    But it wouldn't work, apparently the "-" dash means don't substitute, so this means in plain Engilsh that my rule is not treated as intended or expected.

    - (dash)
    A dash indicates that no substitution should be performed (the existing path is passed through untouched). This is used when a flag (see below) needs to be applied without changing the path.
      http://httpd.apache.org/docs/current/mod/mod_rewrite.html

    The Solution:

    Put brackets around the rewrite rule ()

    Rewriterule ^(example-withdash)$ / [R=301]

    Now it works, it's very simple but quite frustrating when you don't know this.  I actually think Apache should have a debug mode or some switch to run an .htaccess file and verbosely output the interpretation of each rule.


  • vnstat setup guide/tutorial


    yum -y install vnstat
    chown nobody.nobody -R /var/lib/vnstat/

    #replace venet0 below with your desired interface
    sudo -u nobody vnstat -u -i venet0

    #edit: vi /etc/sysconfig/vnstat
    #VNSTAT_OPTIONS="-i venet0"
    # only use the sed below if you are using venet0 instead of eth0 or replace accordingly
    sed -i 's/eth0/venet0/g' /etc/sysconfig/vnstat


     

    [root@monitor]# yum install vnstat
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: centos.mirror.netelligent.ca
     * base: centos.mirror.netelligent.ca
     * centosplus: centos.mirror.iweb.ca
     * contrib: centos.mirror.netelligent.ca
     * extras: centos.mirror.netelligent.ca
     * rpmforge: apt.sw.be
     * updates: centos.mirror.netelligent.ca
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package vnstat.i386 0:1.10-1.el5.rf set to be updated
    --> Finished Dependency Resolution

    Dependencies Resolved

    =============================================================================================================================================================
     Package                            Arch                             Version                                      Repository                            Size
    =============================================================================================================================================================
    Installing:
     vnstat                             i386                             1.10-1.el5.rf                                rpmforge                              65 k

    Transaction Summary
    =============================================================================================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)

    Total download size: 65 k
    Is this ok [y/N]: y
    Downloading Packages:
    vnstat-1.10-1.el5.rf.i386.rpm                                                                                                         |  65 kB     00:00    
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : vnstat                                                                                                                                1/1

    Installed:
      vnstat.i386 0:1.10-1.el5.rf                                                                                                                               

    Complete!
    [root@monitor]# vnstat
    vnstat       vnstat.cron 
    [root@monitor]# vnstat
    No database found, nothing to do. Use --help for help.

    A new database can be created with the following command:
        vnstat -u -i eth0

    Replace 'eth0' with the interface that should be monitored.

    The following interfaces are currently available:
        lo venet0
    [root@monitor]# vnstat -u -i venet0
    Error: Unable to read database "/var/lib/vnstat/venet0".
    Info: -> A new database has been created.
    [root@monitor]#



    -----------
    vnstat

                          rx      /      tx      /     total    /   estimated
     ppp0: Not enough data available yet.

    Let's check the cron log:
    cat /var/log/cron

    OK so it is executing the vnstat.cron:
    crond[10880]: (nobody) CMD (/usr/sbin/vnstat.cron)

    Let's execute the cron script as nobody:
    sudo -u nobody /usr/sbin/vnstat.cron
    Error: Unable to write database "/var/lib/vnstat/eth0".

    Let's check the permissions on that path:
    # ls -al /var/lib/vnstat
    total 20
    drwxr-xr-x  2 nobody nobody 4096 Apr  5 10:40 .
    drwxr-xr-x 24 root   root   4096 Apr  5 10:38 ..
    -rw-r--r--  1 root   root   2272 Apr  5 10:38 eth0
    -rw-r--r--  1 nobody nobody 2272 Apr  5 10:53 .eth0
    -rw-r--r--  1 root   root   2272 Apr  5 10:38 venet0

    Fix:
    chown nobody.nobody -R /var/lib/vnstat/.*

    sudo -u nobody /usr/sbin/vnstat.cron
    [root@ vnstat]# vnstat

                          rx      /      tx      /     total    /   estimated
     eth0:
           Apr '11     19.70 MiB  /  424.90 MiB  /  444.60 MiB  /    2.91 GiB
             today     19.70 MiB  /  424.90 MiB  /  444.60 MiB  /     967 MiB

    The problem is that whenever you add an interface with vnstat as root is that it creates it as root in /var/lib/vnstat
    The other solution (not preferable I admit) is to edit the cron script to run as root:

    change:
    */5 * * * * nobody /usr/sbin/vnstat.cron

    to

    */5 * * * * /usr/sbin/vnstat.cron
     


  • Apache High CPU Usage Enable Mod_Status Guide Solution - Find Cause of High CPU Usage Script/Domain


    mod_status is a great way to track down the source of high CPU usage and to find what vhost/script is the cause of it.

    It gives you a live view of bandwith usage, CPU usage, and memory usage broken down by domain/vhost and script/URI.

    Enable mod_status

    vi /etc/httpd/conf/httpd.conf

    ExtendedStatus On

    <Location /server-status>
    SetHandler server-status

    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    </Location>

    Add your IP after 127.0.0.1.  I believe you could also require an htaccess pasword if you want.

    After that reload Apache and browse to your webserver to http://yourhost.com/server-status and you'll see something like below:


    Apache Server Status for localhost

    Server Version: Apache/2.2.3 (CentOS)
    Server Built: Aug 30 2010 12:32:08

    Current Time: Saturday, 30-Apr-2011 15:55:46 PDT

    Restart Time: Thursday, 28-Apr-2011 23:03:58 PDT
    Parent Server Generation: 3
    Server uptime: 1 day 16 hours 51 minutes 48 seconds
    Total accesses: 243995 - Total Traffic: 1.7 GB
    CPU Usage: u18.36 s1.75 cu2.88 cs0 - .0156% CPU load
    1.66 requests/sec - 12.1 kB/second - 7.3 kB/request
    1 requests currently being processed, 3 idle workers
    W_..__....

    Scoreboard Key:
    "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
    "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
    "C" Closing connection, "L" Logging, "G" Gracefully finishing,
    "I" Idle cleanup of worker, "." Open slot with no current process

    Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
    0-3 22481 0/29/36628 W 0.42 0 0 0.0 0.04 307.98 9 testdomain.com GET /server-status?refresh=10 HTTP/1.1
    1-3 18115 0/271/37239 _ 6.33 4 236 0.0 1.20 255.47   forums.testdomain.com POST /mgc_cb_evo_ajax.php HTTP/1.1
    2-3 - 0/0/35305 . 0.61 54 0 0.0 0.00 235.80   forums.testdomain.com GET /forumdisplay.php?s=e5pr
    3-3 - 0/0/34526 . 9.19 69 0 0.0 0.00 235.66 ::1 00-defaultsite.com OPTIONS * HTTP/1.0
    4-3 22258 0/49/28952 _ 1.12 4 0 0.0 0.21 194.55   forums.testdomain.com GET /cpstyles/kartel/kartel/misc/down9x9.gif HTTP/1.1
    5-3 19843 0/232/27942 _ 3.10 1 137 0.0 0.77 181.58   unitetest.com GET //index.php?action=profile;u=174 HTTP/1.1
    6-3 - 0/0/19301 . 2.31 569 0 0.0 0.00 130.28 ::1 00-defaultsite.com OPTIONS * HTTP/1.0
    7-3 - 0/0/16325 . 0.26 2102 0 0.0 0.00 141.16 ::1 00-defaultsite.com OPTIONS * HTTP/1.0
    8-3 - 0/0/5534 . 0.01 2103 0 0.0 0.00 36.51 ::1 00-defaultsite.com OPTIONS * HTTP/1.0
    9-3 - 0/0/2243 . 0.09 2100 0 0.0 0.00 15.39 ::1 00-defaultsite.com OPTIONS * HTTP/1.0


    Srv Child Server number - generation
    PID OS process ID
    Acc Number of accesses this connection / this child / this slot
    M Mode of operation
    CPU CPU usage, number of seconds
    SS Seconds since beginning of most recent request
    Req Milliseconds required to process most recent request
    Conn Kilobytes transferred this connection
    Child Megabytes transferred this child
    Slot Total megabytes transferred this slot

    SSL/TLS Session Cache Status:
    cache type: SHMCB, shared memory: 512000 bytes, current sessions: 3
    sub-caches: 32, indexes per sub-cache: 133
    time left on oldest entries' SSL sessions: avg: 6 seconds, (range: 6...7)
    index usage: 0%, cache usage: 0%
    total sessions stored since starting: 571
    total sessions expired since starting: 568
    total (pre-expiry) sessions scrolled out of the cache: 0
    total retrieves since starting: 15093 hit, 512 miss
    total removes since starting: 0 hit, 0 miss

  • mysql enable slow query logging/Query Cache Solution - find/track cause of slow mysqld/high IO/CPU usage


    If you have a webserver and find you have high IO/lagginess MySQL is one of the first things to check.  It turns out MySQL was my problem and it was creating a high load on my server, especially for IO.

    How to Enable MySQL Slow Query Logging To Find Slow Performance/Queries

    vi /etc/my.cnf

    Add this anywhere under [mysqld]

    #slow queries
    log-slow-queries = /var/log/mysql/mysqlslowqueries.log
    long_query_time = 1

    You can change the log path to whatever you like.  You can also chanege the threshold for slow queries, I have it sent on 1 second.  Once you do this and restart mysqld you'll start seeing the user, database and exact query that is slowing things down.

    I was finding queries that were taking as long as 42 seconds long!  That was 42 seconds of slow IO performance that was wreaking havoc on my webserver.

    The Quick Fix for slow MySQL performance Queries?

    I thought about creating a MySQL cluster but it requires several servers and takes some time to setup and test.  I also thought about a hardware upgrade, getting faster RPM HDD's and maybe going SSD, but this takes time and money even if I wanted to do it now.

    What can be done immediately?  The answer for me and a lot of people will be MySQL Query Caching.

    Enable MySQL Query Caching To Improve MySQL performance

    vi /etc/my.cnf

    Under [mysqld] add:

    #increase performance with caching
    #128MB of memory cache in KB
    query_cache_size=131072
    query_cache_type=1
    #maximum size of individual query that can be cached in KB (about 1 gig although note the cache total size is restricted to 128MB now)
    query_cache_limit=1048576

    After doing this my performance issues were solved.  A quick note about Query Caching is that it only works for the EXACT same SELECT statements when data has not changed, if data changes the cache becomes irrelevant until the next request. Also note that if the SELECT statement expliclity specifies NOCACHE (can't remember the syntax) then the cache will not be used.

    For many database driven sites this is still good and at least it can only improve performance.  I've found it to make a huge difference.

     


  • Virtualbox Guest Hang/Freeze Ghost Zombie VM Machine Problem/Solution


    Virtualbox hang problem



    A VM just froze and wouldn't close so I had to force it, but the VBox GUI thinks it's running even when I close it.


    I manually killed the related process by doing ps aux|grep VirtualBox and found the PID 6191


    I killed it with "kill -kill 6191" but it remains open and as "defunct" so I can't restart it because the GUI freezes when I click on it because it thinks it is running still



     6191  5.2  0.0      0     0 ?        Zl   09:31   0:53 [VirtualBox] <defunct>


    After several minutes the process disappeared but there's no way that I know to instantly solve this issue.  Even killing the GUI doesn't fix it, the only way would probably be to restart the entire service, thus killing your other VMs at the same time.


  • Apache Crash Solution Can't Restart Due to Socket In use - (98)Address already in use: make_sock: could not bind to address [::]:80 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting d


    (98)Address already in use: make_sock: could not bind to address [::]:80
    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down

    This will even trip you up if you have a service like monit to save you if httpd crashes.  The only way to fix this is to either wait (it's not an option for production situations) or to kill the ghost httpd processes that wouldn't gracefully close:

    Solution:

    killall -9 httpd


  • SPAMASSASSIN/spamcd solution - spamc[16225]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection timed out


    May  6 08:16:57 devbox spamc[16225]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection timed out
    May  6 08:17:02 devbox spamc[20214]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection timed out
    spamc[16225]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection timed out

    First make sure that the spamd service is actually running, this is your spamd (spamassassin server) cannot be reached.  In my case it was, so what happened, why can't I connect?  I even restarted the service.

    Then I realized that I setup a quick iptables script, one which didn't explicitly allow the spamd port to be contacted which is port 783.  Make sure the port is open otherwise you'll see these errors and you'll wonder where your e-mail went!


  • Mysql Solution - Timeout error occurred trying to stop MySQL Daemon. Stopping MySQL: [FAILED]


    Timeout error occurred trying to stop MySQL Daemon.
    Stopping MySQL:                                            [FAILED]

    [root@devbox stats]#

    Solution (force kill mysqld - warning you do risk table corruption here but there's no choice if you want your DB up right away)


    [root@devbox stats]# killall -9 mysqld
    [root@devbox stats]# service mysqld restart
    Stopping MySQL:                                            [  OK  ]
    Starting MySQL:                                            [  OK  ]


  • Kernel linux-2.6.39 In file included from drivers/block/cciss.c:1015: include/asm-generic/pci-dma-compat.h: In function `cmd_special_free': drivers/block/cciss.c:196: sorry, unimplemented: inlining failed in call to 'cciss_tag_discard_error_bits': fu


    In file included from drivers/block/cciss.c:1015:
    include/asm-generic/pci-dma-compat.h: In function `cmd_special_free':
    drivers/block/cciss.c:196: sorry, unimplemented: inlining failed in call to 'cciss_tag_discard_error_bits': function body not available
    include/asm-generic/pci-dma-compat.h:25: sorry, unimplemented: called from here
    make[2]: *** [drivers/block/cciss.o] Error 1
    make[1]: *** [drivers/block] Error 2
    make: *** [drivers] Error 2

    Once again with a new kernel "linux-2.6.39" another huge bug.


  • Directadmin Solution "This is e-mail notification to warn you that your hostname is setup improperly on your system."


    This is e-mail notification to warn you that your hostname is setup improperly on your system.
    

    This is an annoying message and bug with Directadmin, my hostname is set correctly, why does it complain?

    To get of this message just run this command:

    /usr/local/directadmin/scripts/hostname.sh yourhostname.com


  • Virtualbox How To Clone VM/Container VDI file


    You can't just do a straight copy of the VDI image of your virtual machine because there is a unique UUID, well I believe you can and then you can create a new UUID manually (at least you could with VMWARE) but to keep it clean just use this method:

    VBoxManage clonevdi /path/to/your.vdi outputname.vdi
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

    That's all there is to it, just wait for it copy and you can then create a new VM with your cloned VDI.  This is nice if you want to create templates etc... or if you want to make a copy of a testing machine for more testing.


  • VBox/Virtualbox how to shrink VDI image and recover/reclaim unused disk space


    VBoxManage modifyvdi /path/to/your.vdi compact

    I believe this should be done only when your VM is powered off, but I decided to try it with the system powered on.  i wouldn't recommend it because it's dangerous even if it does work but this is a test system.  For anything important/production I would always take a backup first and make sure the system is powered off.

     VBoxManage modifyvdi XP-clone.vdi compact
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%


  • Linux how to use find recursively to find certain types of files/extensions


    Normally if you're in a certain directory you could do:

    find *.txt and it will work as expected, but it won't work recursively through child directories, here's the correct way to do it:

    find . -type f -name *.txt

    The "-type f" is optional because that means only files, but we could have specified d for directory etc...

    The above command will work recursively as you'd expect.  In that way I find "find" to be unintuitive but this is basically what all find functions on all computers are implemented AFAIK (eg. front end search GUI's for different OS's).


  • List of Free Public DNS Servers IP Addresses


    One thing to note about DNS servers and providers is that they aren't always trustworthy, not even if they're Google or your favorite ISP.  Any DNS server can compromise your privacy, and they are likely tracking your browsing habits and keeping logs of it.  Sometimes it's for Marketing/Research purposes such as Google's GMail service which they admit is scraped/datamined.  I would expect nothing less from their DNS service.

    The other danger with such widely used and publicly advertised DNS services in general is that if they are ever attacked and poisoned it could result in ID theft for many people.  Eg. if Google's DNS cache is poisoned or servers hacked, and someone sets paypal.com to resolve to a hacked server, those people will unwittingly give their details away to the phishing site, or worse yet, if they login to their bank account and the cache is poisoned to a hacked server for a major bank.

    As for ISPs, I would not trust them more either, of course your own ISP probably does the same but do keep this in mind that many DNS providers don't have good intentions.  At the very least, remember that your browsing habits and websites and visited are can always be tracked and monitored by whoever your ISP is and whoever your DNS server operator is.

    The one benefit of using these servers is that sometimes they can help you can.

    It can make tracking and logging by your own ISP more difficult, they at least can't do it at the DNS level of their own servers unless they are actively logging all traffic outgoing to udp port 53 (DNS).

    In countries where content is banned, sometimes you can get around filtering and blocks by simply using a foreign DNS server (assuming those servers aren't blocked and assuming the block is at the DNS level only and actively filtered by port filtering and content inspection, or based on IP etc..).

    With the warning/disclaimer above here are some free DNS server providers.

    Scrubit Free DNS servers

    1. 67.138.54.100
    2. 207.225.209.66
    OpenDNS free DNS Servers:
    1. 208.67.222.222
    2. 208.67.220.220

    Verizon Free DNS Server (used by many VPS server providers)

    1. 4.2.2.1
    2. 4.2.2.2
    3. 4.2.2.3
    4. 4.2.2.4
    5. 4.2.2.5
    6. 4.2.2.6

    Google's Free Public DNS Servers:

    1. 8.8.8.8
    2. 8.8.4.4

  • Kernel/make compilation time and how to improve compile times/compile the Linux kernel faster without hardware upgrades


    I thought only a faster CPU and SSD would help but I already have a Quad-Core CPU and it wasn't being maxed out.  The actual tests were performed on an AMD-V enabled 128MB dual core VMWare container though.

    There is a flag that can be passed to make in order to start multiple threads, by specifying 4 threads I was able to reduce the whole kernel compilation time from scratch by about 50%! (65minutes vs 31minutes!).  *Yes I did do a make clean before each compilation too!

    *Part of the slow kernel time is that I use the slow method of making my own initramfs (not pre-compressed and the kernel compile takes like 10x longer for the same thing I could do with a script which I normally do).

    Normal Make (single thread by default):

    make

    real    65m18.956s

    Threaded Make (4 threads):

    make -j 4

    real    31m57.877s

    second run:

    real    27m28.745s
     

    Threaded Make (8 threads):

    *I believe the worse result is likely due to swapping since I only had 128MB of RAM.  Perhaps a lot more RAM could improve things too.

    real    58m29.142s
    user    33m3.616s
    sys    19m13.064s

    By increasing RAM to 512MB here are the results (when compiling RAM is more important than CPU and disk speed):

    real    18m46.933s
    user    20m11.776s
    sys    6m51.334s

    With 1GB of RAM

    real    18m38.608s
    user    20m31.857s
    sys    7m46.141s

    I believe the time was disappointing because of the initramfs creation.

    With pre-created initramfs linked into kernel:

    real    10m47.362s
    user    18m24.837s
    sys    1m48.095s
     

    With 12 threads:

    real    10m34.550s

    Clearly the threads no longer help once the CPU is maxed out, I didn't check but considering with 8 threads that I was often at 80-90% CPU, now the CPU is the bottleneck.  I'm going to increase my cores to 4 and try again.

    It only shaved off 13 seconds, but the crazy thing is that initramfs takes 8 minutes to create alone!  That's how inefficient the routine from the kernel is.  The same initramfs is created through a script in about 1 minute or less!


     

    Snapshot of top with 8 threads showing high iowait:

    You can really see iowait is starting to become a factor (40-60% on both cores on average).  I'm already running a RAID 1 with 7200 RPM 1TB drives.  I believe SSD would make a huge improvement with the iowait.  The CPU io often hits 70-80% but I believe the main culprit is the high iowait.  The system with 8 threads is quite unresponsive to even shell commands and typing.

    11:24:56 up 54 days,  1:29,  5 users,  load average: 11.80, 10.36, 6.08
     

    top - 11:22:12 up 54 days,  1:27,  5 users,  load average: 11.79, 9.53, 5.04
    Tasks: 121 total,   6 running,  97 sleeping,  18 stopped,   0 zombie
     Cpu0 : 18.1% us, 13.3% sy,  0.0% ni,  0.0% id, 67.7% wa,  0.0% hi,  0.9% si
     Cpu1 : 13.3% us, 19.5% sy,  0.0% ni,  0.0% id, 53.6% wa,  1.1% hi, 12.4% si
    Mem:    126980k total,   116308k used,    10672k free,      788k buffers
    Swap:   377488k total,   107036k used,   270452k free,     5180k cached

      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                        
     7970 root      18   0 17596  14m 2976 D 18.2 11.5   0:00.75 cc1                                                                                            
     7932 root      18   0 19220  13m 1612 D 17.8 10.9   0:00.94 cc1                                                                                            
     7923 root      18   0 24152  13m 3140 R 13.4 11.0   0:01.37 cc1                                                                                            
     7938 root      18   0 19448  12m 1612 R 10.8 10.4   0:00.83 cc1                                                                                            
       14 root      10  -5     0    0    0 S  8.0  0.0   5:17.26 kblockd/1                                                                                      
     7687 root      18   0 36760  13m 3036 R  7.6 10.7   0:05.45 cc1                                                                                            
     7905 root      18   0 21188  14m 3064 D  7.0 11.5   0:00.64 cc1                                                                                            
      118 root      10  -5     0    0    0 D  3.5  0.0  15:23.71 kswapd0                                                                                        
     7915 root      18   0 27164  17m 1616 D  2.9 14.1   0:00.69 cc1                 

    With 512MB of RAM instead of 128MB

    real    18m46.933s
    user    20m11.776s
    sys    6m51.334s
     

    Things don't fee lagged at all on the system unlike last time when it had 128MB of RAM.

    The load is lower and iowait is virtually non-existent.

     03:52:52 up 4 min,  2 users,  load average: 10.55, 5.14, 2.02

     04:02:46 up 14 min,  2 users,  load average: 1.85, 5.12, 4.13

    top - 03:53:11 up 5 min,  2 users,  load average: 10.30, 5.43, 2.18
    Tasks:  93 total,  12 running,  81 sleeping,   0 stopped,   0 zombie
     Cpu0 : 90.0% us,  9.7% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.3% hi,  0.0% si
     Cpu1 : 89.3% us, 10.0% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  0.7% si
    Mem:    516820k total,   431108k used,    85712k free,   176120k buffers
    Swap:   377488k total,        0k used,   377488k free,   111164k cached

    top - 04:02:42 up 14 min,  2 users,  load average: 1.84, 5.18, 4.14
    Tasks:  55 total,   2 running,  53 sleeping,   0 stopped,   0 zombie
     Cpu0 : 10.0% us, 40.2% sy,  0.0% ni, 49.8% id,  0.0% wa,  0.0% hi,  0.0% si
     Cpu1 : 11.6% us, 37.9% sy,  0.0% ni, 49.5% id,  1.0% wa,  0.0% hi,  0.0% si
     

    Free Memory gets low sometimes:

                total       used       free     shared    buffers     cached
    Mem:           504        486         18          0          4        427
     

    With 1GB

    Clearly 1GB is the sweet spot, I'm tempted to turn the threads up from 8 to at least 12 or 16.

    We can also see that CPU usage gets higher, so it is a factor and that iowait when compiling is usually caused by swapping because of too little RAM.

     Cpu0 : 92.0% us,  8.0% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  0.0% si
     Cpu1 : 93.4% us,  6.6% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  0.0% si

    total       used       free     shared    buffers     cached
    Mem:          1012        408        603          0         37        291

     

     04:24:24 up 13 min,  2 users,  load average: 2.43, 6.33, 4.47

     04:33:13 up 21 min,  2 users,  load average: 10.58, 7.00, 5.06

    Even with the high load the system is very responsive, unlike at 128MB of RAM

    Free Mem does get low still:

                 total       used       free     shared    buffers     cached
    Mem:          1012        986         26          0          7        900
    -/+ buffers/cache:         77        934
    Swap:          368          0        368 

    *Note that if you specify -j with no number it opens unlimited threads, it basically causes gcc to crash/fail in my experience.  Perhaps with more memory this wouldn't have happened, I'm not sure what caused it for sure other than my system being unable to handle unlimited threads.

    You'll get errors like this if specifying unlimited threads:


      CC      kernel/time/timekeeping.o
    gcc: gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
    For Debian GNU/Linux specific bug reporting instructions, see
    <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.

    Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
    For Debian GNU/Linux specific bug reporting instructions, see
    <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.

    make[2]: make[1]: *** [arch/x86/kernel/setup.o] Killed
    *** [fs/file_table.o] Killed
    gcc: gcc: make[2]: *** [arch/x86/kernel/x86_init.o] Killed
    make[1]: *** [fs/super.o] Killed
    gcc: gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
    For Debian GNU/Linux specific bug reporting instructions, see
    <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.
    Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
    For Debian GNU/Linux specific bug reporting instructions, see
    <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.
    Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
    For Debian GNU/Linux specific bug reporting instructions, see
    <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.
    Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
    For Debian GNU/Linux specific bug reporting instructions, see
    <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.
    make[2]:

     

    Conclusion/What I Learned

    The single most important factor for faster compiling is RAM and 1GB+ is preferable.  The first wall I hit was high iowait due to insufficient RAM and swapping.  With more RAM the iowait virtually disappears and you can see the CPU's getting loaded to 80-90%.

    Basically using make with more threads, decreases the compile time exponentially, but only so long as you have enough RAM to support those threads, and the next bottleneck will become CPU processing power.  The key is to add more cores at that point. Having a Quad Core or even 6 core with lots of RAM would give you the best performance and faster compliing.  I feel disk speed is of little impact when compiling so SSD wouldn't make much of a difference.


  • How to recover from dead DRBD partition/hard drive in two simple commands


    This assumes that you've at least created the correct partition for your DRBD already.
    Notice that I am "diskless", that's because either your DRBD partition doesn't exist/has been renamed (eg. sdb becomes sda when sdb dies and you reboot) or because that drive is really actually dead/gone.

    *If you need to permanently change the partition/device for your resource be sure to edit /etc/drbd.conf on both hosts and reload the config.

    (replace r0 with the name of the resource you're recovering from):
    drbdadm create-md r0

    DRBD module version: 8.3.4
       userland version: 8.3.8
    preferably kernel and userland versions should match.
    Writing meta data...
    initializing activity log
    NOT initialized bitmap
    New drbd meta data block successfully created.

    drbdadm attach r0


    That's all there is to it, you're recovered and just need to wait for the sync to complete.


    Check /proc/drbd and you'll see it is rsyncing to your newly added disk.

    cat /proc/drbd
    version: 8.3.4 (api:88/proto:86-91)
    GIT-hash: 70a645ae080411c87b4482a135847d69dc90a6a2 build by xemul@ovzcore.sw.ru, 2009-10-12 19:29:01
     0: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate A r----
        ns:0 nr:378692 dw:378340 dr:0 al:0 bm:22 lo:13 pe:1478 ua:11 ap:0 ep:1 wo:b oos:487894364
        [>....................] sync'ed:  0.1% (476456/476828)M
        finish: 2:08:56 speed: 63,056 (63,056) K/sec
     


  • Hitachi 2TB HDS5C3020ALA632 drive DOA


    I had one of these shipped and it was not recognized when plugged in, here's what a dead drive looks like (I assume it's teh circuit board which is dead):
     

    ata1: link is slow to respond, please be patient (ready=0)
    ata1: softreset failed (device not ready)
    ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata1: link online but device misclassified, retrying
    ata1: link is slow to respond, please be patient (ready=0)
    ata1: softreset failed (device not ready)
    ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata1: link online but device misclassified, retrying
    ata1: link is slow to respond, please be patient (ready=0)
    ata1: softreset failed (device not ready)
    ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata1: link online but device misclassified, retrying
    ata1: limiting SATA link speed to 1.5 Gbps
    ata1: softreset failed (device not ready)
    ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    ata1: link online but device misclassified, device detection might fail
    ata2: SATA link down (SStatus 0 SControl 300)
     

    Here is a working one, they're actually great drives as long as they work:

     

    smartctl -a /dev/sdb
    smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF INFORMATION SECTION ===
    Device Model:     Hitachi HDS5C3020ALA632
    Serial Number:    ML4220F318DZ2K
    Firmware Version: ML6OA580
    User Capacity:    2,000,398,934,016 bytes
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   8
    ATA Standard is:  ATA-8-ACS revision 4
    Local Time is:    Thu Jun  9 16:37:16 2011 PDT
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled

    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED

    General SMART Values:
    Offline data collection status:  (0x84)    Offline data collection activity
                        was suspended by an interrupting command from host.
                        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:          (23306) seconds.
    Offline data collection
    capabilities:              (0x5b) 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.
                        Selective Self-test supported.
    SMART capabilities:            (0x0003)    Saves SMART data before entering
                        power-saving mode.
                        Supports SMART auto save timer.
    Error logging capability:        (0x01)    Error logging supported.
                        General Purpose Logging supported.
    Short self-test routine
    recommended polling time:      (   1) minutes.
    Extended self-test routine
    recommended polling time:      ( 255) minutes.
    SCT capabilities:            (0x003d)    SCT Status supported.
                        SCT Feature Control supported.
                        SCT Data Table supported.

    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
      2 Throughput_Performance  0x0005   134   134   054    Pre-fail  Offline      -       100
      3 Spin_Up_Time            0x0007   100   100   024    Pre-fail  Always       -       0
      4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       3
      5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
      8 Seek_Time_Performance   0x0005   150   150   020    Pre-fail  Offline      -       27
      9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       27
     10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       3
    192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       3
    193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       3
    194 Temperature_Celsius     0x0002   187   187   000    Old_age   Always       -       32 (Lifetime Min/Max 25/35)
    196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

    SMART Error Log Version: 1
    No Errors Logged

    SMART Self-test log structure revision number 1
    No self-tests have been logged.  [To run self-tests, use: smartctl -t]


    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.


  • GRUB Solution to error "Error 6: Mismatched or corrupt version of stage1/stage2"


        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]

    grub> root (hd1,0)
     Filesystem type is ext2fs, partition type 0xfd

    grub> setup (hd1)
     Checking if "/boot/grub/stage1" exists... yes
     Checking if "/boot/grub/stage2" exists... yes
     Checking if "/boot/grub/e2fs_stage1_5" exists... yes
     Running "embed /boot/grub/e2fs_stage1_5 (hd1)"...  15 sectors are embedded.
    succeeded
     Running "install /boot/grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/boot/grub/stage2 /boot/grub/grub.conf"... failed

    Error 6: Mismatched or corrupt version of stage1/stage2

    In my case this problem happened because hd1 is a newly added drive in a mdadm RAID 1 array and was still syncing at the time.  I imagine you could also run into this error with a partition/filesystem that is still being formatted.

    This is the only way/scenario that I've ever received that error and the solution is to wait for the RAID array to finish syncing.


  • Centos Solution to "Warning: Unable to open /dev/fd0 read-write (Read-only file system). /dev/fd0 has been opened read-only."


    Warning: Unable to open /dev/fd0 read-write (Read-only file system).  /dev/fd0 has been opened read-only.

    That's a very annoying error, it's simply because Centos for some reason thinks it's wise to load the "floppy" kernel module, who has a floppy drive?  I haven't seen or used a floppy for over 12 years!

    It's more than just annoying, if you probe the drives attached to your system, eg. with grub or partprobe, it keeps trying to locate a floppy dirve that doesn't exist and literally takes a few minutes to let you complete the task of grub or partprobe or related commands.

    The solution, remove the "floppy" kernel module

    rmmod floppy

    That takes effect right away,now grub will load right away and partprobe will take a few seconds at most.

    You'll also want to prevent it from loading again in the future at boot time:

    For Centos/RHEL

    echo "alias floppy off" >> /etc/modprobe.conf

    For Debian based Distros

    echo "blacklist floppy" >> /etc/modprobe.d/blacklist

    The command above tells the kernel not to load the "floppy" module ever again by adding "blacklist floppy" to the blacklist list.


  • smart is not smart, it thinks a dead drive is still good


    I had a dying drive that smart thought until it totally disappeared was a good drive, and actually all parameters did look fine but this system was causing my system to lockup and other bad behavior:

     

    === START OF INFORMATION SECTION ===
    Device Model:     WDC WD20EARS-00MVWB0
    Serial Number:    WD-WMAZ20139
    Firmware Version: 50.0AB50
    User Capacity:    2,000,398,934,016 bytes
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   8
    ATA Standard is:  Exact ATA specification draft version not indicated
    Local Time is:    Fri Jun  3 09:53:36 2011 PDT
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled

    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED

    General SMART Values:
    Offline data collection status:  (0x84)    Offline data collection activity
                        was suspended by an interrupting command from host.
                        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:          (35400) seconds.
    Offline data collection
    capabilities:              (0x7b) SMART execute Offline immediate.
                        Auto Offline data collection on/off support.
                        Suspend Offline collection upon new
                        command.
                        Offline surface scan supported.
                        Self-test supported.
                        Conveyance Self-test supported.
                        Selective Self-test supported.
    SMART capabilities:            (0x0003)    Saves SMART data before entering
                        power-saving mode.
                        Supports SMART auto save timer.
    Error logging capability:        (0x01)    Error logging supported.
                        General Purpose Logging supported.
    Short self-test routine
    recommended polling time:      (   2) minutes.
    Extended self-test routine
    recommended polling time:      ( 255) minutes.
    Conveyance self-test routine
    recommended polling time:      (   5) minutes.
    SCT capabilities:            (0x3035)    SCT Status supported.
                        SCT Feature Control supported.
                        SCT Data Table supported.

    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
      3 Spin_Up_Time            0x0027   191   170   021    Pre-fail  Always       -       5416
      4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       12
      5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
      9 Power_On_Hours          0x0032   091   091   000    Old_age   Always       -       6833
     10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
     11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       11
    192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       6
    193 Load_Cycle_Count        0x0032   042   042   000    Old_age   Always       -       475936
    194 Temperature_Celsius     0x0022   117   099   000    Old_age   Always       -       33
    196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       1
    198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       1
    199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
    200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       2

    SMART Error Log Version: 1
    No Errors Logged

    SMART Self-test log structure revision number 1
    No self-tests have been logged.  [To run self-tests, use: smartctl -t]


    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.

    At the end smart did catch it, but just before it died:

     

    un  1 17:47:52 box10 smartd[8529]: Device: /dev/sda, opened
    Jun  1 17:47:52 box10 smartd[8529]: Device /dev/sda: using '-d sat' for ATA disk behind SAT layer.
    Jun  1 17:47:52 box10 smartd[8529]: Device: /dev/sda, opened
    Jun  1 17:47:52 box10 smartd[8529]: Device: /dev/sda, not found in smartd database.
    Jun  1 17:47:52 box10 smartd[8529]: Device: /dev/sda, is SMART capable. Adding to "monitor" list.
    Jun  1 17:47:53 box10 smartd[8529]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 17:47:53 box10 smartd[8529]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 18:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 18:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 18:47:53 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 18:47:53 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 19:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 19:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 19:47:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 19:47:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 20:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 20:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 20:47:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 20:47:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 21:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 21:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 21:47:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 21:47:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 22:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 22:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 22:47:53 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 22:47:53 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 23:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
    Jun  1 23:17:54 box10 smartd[8546]: Device: /dev/sda, 1 Offline uncorrectable sectors
    Jun  1 23:47:53 box10 smartd[8546]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
     


  • How To Test If Your Hard Drive Is Good/Signs of dying hard drive


    I like dd, although it only reads it, usually a read test of the entire disk will uncover if your hard drive is bad in some parts.  This is a good thing to do at least once a month, a lot of times bizarre program behavior, laginess and crashing/unnmounting problems etc.. are due to a failing disc and SMART won't know it or indicate a problem:

    We must also remember there's never a guarantee, I've found that ever since we moved to larger and more platters per drive with 1TB drives and up, that hard drives in general have become more prone to errors, problems and failures that I've never seen with smaller drives after years of use.  It's scary how cheap and poor quality most hard drives are today, they're still the most unreliable component and are actually getting less reliable.

    My way to test a drive:

     


    It takes a long time but this should uncover a dying drive that may not be noticeable since dd reads every sector on the whole drive.

    dd if=/dev/sdb of=/dev/null
    3907029168+0 records in
    3907029168+0 records out
    2000398934016 bytes (2.0 TB) copied, 28390.9 seconds, 70.5 MB/s


    Here is my Hitachi 2TB drive (new) tested and I checked dmesg and smartctl without any errors:

    3907029168+0 records in
    3907029168+0 records out
    2000398934016 bytes (2.0 TB) copied, 21359.7 seconds, 93.7 MB/s

    smartctl -a /dev/sdb
    smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF INFORMATION SECTION ===
    Device Model:     Hitachi HDS5C3020ALA632
    Serial Number:    ML4220F318DZ2K
    Firmware Version: ML6OA580
    User Capacity:    2,000,398,934,016 bytes
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   8
    ATA Standard is:  ATA-8-ACS revision 4
    Local Time is:    Wed Jun  8 19:14:06 2011 PDT
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled

    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED

    General SMART Values:
    Offline data collection status:  (0x80)    Offline data collection activity
                        was never started.
                        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:          (23306) seconds.
    Offline data collection
    capabilities:              (0x5b) 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.
                        Selective Self-test supported.
    SMART capabilities:            (0x0003)    Saves SMART data before entering
                        power-saving mode.
                        Supports SMART auto save timer.
    Error logging capability:        (0x01)    Error logging supported.
                        General Purpose Logging supported.
    Short self-test routine
    recommended polling time:      (   1) minutes.
    Extended self-test routine
    recommended polling time:      ( 255) minutes.
    SCT capabilities:            (0x003d)    SCT Status supported.
                        SCT Feature Control supported.
                        SCT Data Table supported.

    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
      2 Throughput_Performance  0x0005   100   100   054    Pre-fail  Offline      -       0
      3 Spin_Up_Time            0x0007   100   100   024    Pre-fail  Always       -       0
      4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       3
      5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
      8 Seek_Time_Performance   0x0005   100   100   020    Pre-fail  Offline      -       0
      9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       6
     10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       3
    192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       3
    193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       3
    194 Temperature_Celsius     0x0002   176   176   000    Old_age   Always       -       34 (Lifetime Min/Max 25/35)
    196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

    SMART Error Log Version: 1
    No Errors Logged

    SMART Self-test log structure revision number 1
    No self-tests have been logged.  [To run self-tests, use: smartctl -t]


    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.

    If there's a problem/Signs of a dying hard drive

     

    You'll get errors like this (your drive is about to die and will be taken offline):

    Jun  5 11:56:10 box11 kernel: end_request: I/O error, dev sdb, sector 0
    Jun  5 11:56:10 box11 kernel: Buffer I/O error on device sdb, logical block 0
    Jun  5 11:56:10 box11 kernel: Buffer I/O error on device sdb, logical block 1
    Jun  5 11:56:10 box11 kernel: Buffer I/O error on device sdb, logical block 2
    Jun  5 11:56:10 box11 kernel: Buffer I/O error on device sdb, logical block 3
    Jun  5 11:56:10 box11 kernel: end_request: I/O error, dev sdb, sector 0

    May 31 22:02:50 box11 kernel: sd 3:0:0:0: SCSI error: return code = 0x00040000
    May 31 22:02:50 box11 kernel: end_request: I/O error, dev sdb, sector 0
    May 31 22:02:50 box11 kernel: Buffer I/O error on device sdb, logical block 0
    May 31 22:02:50 box11 kernel: sd 3:0:0:0: SCSI error: return code = 0x00040000
    May 31 22:02:50 box11 kernel: end_request: I/O error, dev sdb, sector 3907029160

    Here's an example of how mdadm reacts to the failed disc (I was experiencing bizarre database issues, crashes, freezes etc.. too)

     

    May 31 12:45:54 box11 kernel: ata4.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x6 frozen
    May 31 12:45:54 box11 kernel: ata4: SError: { HostInt }
    May 31 12:45:54 box11 kernel: ata4.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0
    May 31 12:45:54 box11 kernel:          res 40/00:04:b8:21:7e/cd:00:0a:00:00/40 Emask 0x44 (timeout)
    May 31 12:45:54 box11 kernel: ata4.00: status: { DRDY }
    May 31 12:45:54 box11 kernel: ata4: hard resetting link
    May 31 12:46:00 box11 kernel: ata4: link is slow to respond, please be patient (ready=0)
    May 31 12:46:04 box11 kernel: ata4: softreset failed (device not ready)
    May 31 12:46:04 box11 kernel: ata4: hard resetting link
    May 31 12:46:10 box11 kernel: ata4: link is slow to respond, please be patient (ready=0)
    May 31 12:46:14 box11 kernel: ata4: softreset failed (device not ready)
    May 31 12:46:14 box11 kernel: ata4: hard resetting link
    May 31 12:46:20 box11 kernel: ata4: link is slow to respond, please be patient (ready=0)
    May 31 12:46:54 box11 kernel: ata4: softreset failed (device not ready)
    May 31 12:46:54 box11 kernel: ata4: limiting SATA link speed to 1.5 Gbps
    May 31 12:46:54 box11 kernel: ata4: hard resetting link
    May 31 12:47:01 box11 kernel: ata4: softreset failed (device not ready)
    May 31 12:47:03 box11 kernel: ata4: reset failed, giving up
    May 31 12:47:03 box11 kernel: ata4.00: disabled
    May 31 12:47:03 box11 kernel: sd 3:0:0:0: timing out command, waited 30s
    May 31 12:47:03 box11 kernel: ata4: EH complete
    May 31 12:47:03 box11 kernel: sd 3:0:0:0: SCSI error: return code = 0x00040000
    May 31 12:47:03 box11 kernel: end_request: I/O error, dev sdb, sector 117210047
    May 31 12:47:03 box11 kernel: raid1: Disk failure on sdb1, disabling device.
    May 31 12:47:03 box11 kernel:        Operation continuing on 1 devices
    May 31 12:47:03 box11 kernel: sd 3:0:0:0: SCSI error: return code = 0x00040000
    May 31 12:47:04 box11 kernel: end_request: I/O error, dev sdb, sector 1152390464
    May 31 12:47:04 box11 kernel: raid1: Disk failure on sdb3, disabling device.
    May 31 12:47:04 box11 kernel:        Operation continuing on 1 devices
    May 31 12:47:04 box11 kernel: sd 3:0:0:0: SCSI error: return code = 0x00040000
    May 31 12:47:04 box11 kernel: end_request: I/O error, dev sdb, sector 749321600
    May 31 12:47:04 box11 kernel: raid1: sdb3: rescheduling sector 573506240
    May 31 12:47:04 box11 kernel: sd 3:0:0:0: SCSI error: return code = 0x00040000
    May 31 12:47:04 box11 kernel: end_request: I/O error, dev sdb, sector 750128368
    May 31 12:47:04 box11 kernel: raid1: sdb3: rescheduling sector 574313008
     

    The first sign of my dying drive were there's errors infrequently while doing heavy reads:

    May 15 04:46:59 box11 kernel: ata2.00: exception Emask 0x0 SAct 0x7fffffff SErr 0x0 action 0x0
    May 15 04:46:59 box11 kernel: ata2.00: irq_stat 0x40000008
    May 15 04:46:59 box11 kernel: ata2.00: cmd 60/80:a0:c0:ad:76/00:00:16:00:00/40 tag 20 ncq 65536 in
    May 15 04:46:59 box11 kernel:          res 41/40:00:28:ae:76/cd:00:16:00:00/40 Emask 0x409 (media error) <F>
    May 15 04:46:59 box11 kernel: ata2.00: status: { DRDY ERR }
    May 15 04:46:59 box11 kernel: ata2.00: error: { UNC }
    May 15 04:46:59 box11 kernel: ata2.00: configured for UDMA/133
    May 15 04:46:59 box11 kernel: ata2: EH complete
    May 15 04:46:59 box11 kernel: SCSI device sda: 3907029168 512-byte hdwr sectors (2000399 MB)
    May 15 04:46:59 box11 kernel: sda: Write Protect is off
    May 15 04:46:59 box11 kernel: SCSI device sda: drive cache: write back
    May 15 04:47:01 box11 kernel: ata2.00: exception Emask 0x0 SAct 0x7fcfffdf SErr 0x0 action 0x0
    May 15 04:47:13 box11 kernel: ata2.00: irq_stat 0x40000008
    May 15 04:47:13 box11 kernel: ata2.00: cmd 60/80:50:c0:ad:76/00:00:16:00:00/40 tag 10 ncq 65536 in
    May 15 04:47:13 box11 kernel:          res 41/40:00:28:ae:76/cd:00:16:00:00/40 Emask 0x409 (media error) <F>
    May 15 04:47:13 box11 kernel: ata2.00: status: { DRDY ERR }
    May 15 04:47:13 box11 kernel: ata2.00: error: { UNC }
    May 15 04:47:13 box11 kernel: ata2.00: configured for UDMA/133
     

     What if the problem occurs only when writing data?

    With Linux or whatever OS you, you'll find that you begin to have random crashes, and if you look at your console in Linux it might offer clues but this can be hard to track down.  I'm about 99% positive one of my WD EARS drives has been causing a crash on my computers for months and have realized it can be identified by a high "Multi-Zone Error Rate" and also if the Load Cycle is high (mine is over 1 million) thenyou can expect the drive is on the way out.

    The problem is that you can't do a full badblocks or dd write test on an existing partition without destroying data.  There's no good way of testing write issues except by taking the drive off-line and/or willfully destroying your data.

     

    === START OF INFORMATION SECTION ===
    Device Model:     WDC WD20EARS-00MVWB0
    Serial Number:    WD-WMAZ20148885
    Firmware Version: 50.0AB50
    User Capacity:    2,000,398,934,016 bytes
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   8
    ATA Standard is:  Exact ATA specification draft version not indicated
    Local Time is:    Sat Sep 17 08:57:20 2011 PDT
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    General SMART Values:
    Offline data collection status:  (0x84)    Offline data collection activity
                        was suspended by an interrupting command from host.
                        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:          (36600) seconds.
    Offline data collection
    capabilities:              (0x7b) SMART execute Offline immediate.
                        Auto Offline data collection on/off support.
                        Suspend Offline collection upon new
                        command.
                        Offline surface scan supported.
                        Self-test supported.
                        Conveyance Self-test supported.
                        Selective Self-test supported.
    SMART capabilities:            (0x0003)    Saves SMART data before entering
                        power-saving mode.
                        Supports SMART auto save timer.
    Error logging capability:        (0x01)    Error logging supported.
                        General Purpose Logging supported.
    Short self-test routine
    recommended polling time:      (   2) minutes.
    Extended self-test routine
    recommended polling time:      ( 255) minutes.
    Conveyance self-test routine
    recommended polling time:      (   5) minutes.
    SCT capabilities:            (0x3035)    SCT Status supported.
                        SCT Feature Control supported.
                        SCT Data Table supported.
    
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
      3 Spin_Up_Time            0x0027   179   174   021    Pre-fail  Always       -       6041
      4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       19
      5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
      9 Power_On_Hours          0x0032   088   088   000    Old_age   Always       -       9360
     10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
     11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       18
    192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       13
    193 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       1080578 194 Temperature_Celsius     0x0022   120   109   000    Old_age   Always       -       30
    196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
    200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       10 
    

    I'd also say that if you begin to see a Multi_Zone_Error_Rate high than 0 then consider these serious write errors that will get worse and ultimately start crashing your system and affecting stability (this is what I found as any of my drives that are WD EARS 2TB started to have issues as that number crept up).  In the above example it started at just 1,2 and then got higher and the crashes got progressively worse.

    Some of the errors/crashes showed the following which I believe are due to this dying EARS drive (I'll know in a few weeks since I'm replacing this drive today):


    [<c0466769>] free_hot_cold_page+0xfc/0x150

    [<c04667d1>] __pagevec_free+0x14/0x1a

    [<c0468c6b>] release_pages+0x127/0x12f

    [<c04692d1>] __pagevec_release+0x15/0x1d

    [<c04697db>] __invalid_mapping_pages+0x120/0x156

    [<c0469818>] invalidate_mapping_pages+0x7/0x9

    [<c049c22e>] shrink_icache_memory+0xf5/0x295

    [<c046aeab>] shrink_slab+0xfb/0x16e

    [<c046b271>] kswapd+0x2d7/0x3fb

    [<c0436e1f>] autoremove_wake_function+0x0/0x2d

    [<c046af9a>] kswapd+0x0/0x3fb

    [<c0436d5d>] kthread+0xc0/0xeb

    [<c0436c9d>] kthread+0x0/0xeb

    [<c062d243>] kernel_thread_helper+0x7/0x10

    Code: 43 1c 31 c0 eb 0d 31 d2 89 f1 55 89 f8 e8 74 f0 ff ff 5a 5b 5e 5f 5d c3 55

    89 d5 57 89 c7 56 53 8b 70 20 85 f6 0f 84 e9 00 00 00 <8b> 06 3d 75 62 75 62 0f

    84 86 00 00 00 50 56 57 68 28 0e 63 c0

    EIP: [<c043b5b4>] ub_page_uncharge+0x13/0x101 SS:ESP 0068:f7861df0

    Kernel panic - not syncing: Fatal exception

     

    ---------

    [<c0466769>] free_hot_cold_page+0xfc/0x150
    [<c04667d1
    >] __pagvec_free+0x14/0x1a
    [<c0468c37
    >] release_pages+0xf3/0x12f
    [<c0469Zd1
    >] __pagevec_release+0x15/0x1d
    [<c0469b1Z
    >] truncate_inode_pages_range+0xcc/0x260
    [<f916c8d3
    >] journal_stop+0x208/0x213 [jbd]
    [<c0469caf
    >] truncate_inode_pages+0x9/0xe
    [<f91a8a57
    >] ext3_delete_inode+0x13/0xba [ext3]
    [<f91a8a44
    >] ext3_delete_inode+0x0/0xba [ext3]
    [<c049b9ea
    >] generic_deIete_inode+0x91/0xfe
    [<c049b4c1
    >] input+x67/0x69
    [<c0498df5
    >] d_kill+0x19/0x32
    [<c0499f36
    >] dput+19f/0x1ac
    [<c049Z717
    >] sys_renameat+0x15f/0x1af
    [<c047Z410
    >] remove_vma+0x47/0x4c
    [<c047Ze3a
    >] do_munmap+0x19e/0x1ba
    [<c049Z778
    >] sys_rename+0x11/0x15
    [<c06Zc4eb
    >] syscall_call+0x7/0xb

    Code: 43 1c 31 c0 eb 0d 31 dZ 89 f1 55 89 f8 e8 74 f0 ff ff 5a 5b 5e 5f 5d c3 5'
    89 d5 57 89 c7 56 53 8b 70 Z0 85 f6 0f 84 e9 00 00 00 <8b> 06 3d 75 6Z 75 6Z 0
    84 86 00 00 00 50 56 57 68 Z8 0e 63 c0
    EIP:  [<c043b5b4>] ub_page_uncharge+0x13/0x101 SS:ESP 0068:f7acbd9c
    Kernel panic - not syncing: Fatal exception


  • Linux Out of Memory OOM Object Killer Solution "Out of memory: kill process 1955 (sshd) score 81 or a child"


    I had a system running a 128MB live CD image with 2.8 gigs of available RAM and the OOM kernel killer went crazy when using dd for more than 8 minutes and kept killing everything.  I've read that this is due to a low-memory issue and paging in the kernel and 32-bit systems with lots of RAM.

    I even enabled swapspace on my LiveCD and the issue happened 25 minutes into dd rather than 8 minutes, so what gives?
    Also no swap space was ever used!

    cat /proc/swaps 
    Filename                Type        Size    Used    Priority
    /dev/sda2                               partition    30716152    2784    -1


    Here is a nice thread on the issue: http://www.redhat.com/archives/redhat-list/2007-August/msg00060.html
    I believe the option below in the kernel under "Processor Type & Features" should resolve this.

    Solution for OOM


     [*] Allocate 3rd-level pagetables from highmem


    Here is meminfo when the OOM killer is not active

    -bash-3.1# cat /proc/meminfo
    MemTotal:      2855128 kB
    MemFree:         77016 kB
    Buffers:         47012 kB
    Cached:        2646720 kB
    SwapCached:        908 kB
    Active:        1411204 kB
    Inactive:      1283876 kB
    HighTotal:     1963904 kB
    HighFree:          428 kB
    LowTotal:       891224 kB
    LowFree:         76588 kB
    SwapTotal:    30716152 kB
    SwapFree:     30712628 kB
    Dirty:               0 kB
    Writeback:         296 kB
    AnonPages:         876 kB
    Mapped:           1424 kB
    Slab:            45668 kB
    SReclaimable:    40420 kB
    SUnreclaim:       5248 kB
    PageTables:        328 kB
    NFS_Unstable:        0 kB
    Bounce:              0 kB
    WritebackTmp:        0 kB
    CommitLimit:  32143716 kB
    Committed_AS:     8416 kB
    VmallocTotal:   114680 kB
    VmallocUsed:     16336 kB
    VmallocChunk:    97976 kB
    HugePages_Total:     0
    HugePages_Free:      0
    HugePages_Rsvd:      0
    HugePages_Surp:      0
    Hugepagesize:     4096 kB
    DirectMap4k:      4096 kB
    DirectMap4M:    913408 kB

    Here is meminfo when OOM killer is active
     

    cat /proc/meminfo
    MemTotal:      2855128 kB
    MemFree:         76440 kB
    Buffers:             0 kB
    Cached:        2712884 kB
    SwapCached:        520 kB
    Active:        1433708 kB
    Inactive:      1279804 kB
    HighTotal:     1963904 kB
    HighFree:          428 kB
    LowTotal:       891224 kB
    LowFree:         76012 kB
    SwapTotal:    30716152 kB
    SwapFree:     30713364 kB
    Dirty:               0 kB
    Writeback:           0 kB
    AnonPages:         372 kB
    Mapped:           2616 kB
    Slab:            28280 kB
    SReclaimable:    22952 kB
    SUnreclaim:       5328 kB
    PageTables:        320 kB
    NFS_Unstable:        0 kB
    Bounce:              0 kB
    WritebackTmp:        0 kB
    CommitLimit:  32143716 kB
    Committed_AS:     6888 kB
    VmallocTotal:   114680 kB
    VmallocUsed:     16336 kB
    VmallocChunk:    97976 kB
    HugePages_Total:     0
    HugePages_Free:      0
    HugePages_Rsvd:      0
    HugePages_Surp:      0
    Hugepagesize:     4096 kB
    DirectMap4k:      4096 kB
    DirectMap4M:    913408 kB

    dmesg

    2kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    1585 pages shared
    692675 pages non-shared
    Out of memory: kill process 1955 (sshd) score 81 or a child
    Killed process 3302 (sshd)
    bash invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
    Pid: 3311, comm: bash Not tainted 2.6.27.54 #31
     [<c014ecd2>] oom_kill_process+0xe6/0x10c
     [<c014efd3>] out_of_memory+0xaf/0x100
     [<c0150844>] __alloc_pages_internal+0x31c/0x3b0
     [<c015a53f>] do_wp_page+0x9f/0x49c
     [<c011855e>] ? task_new_fair+0x6e/0xb0
     [<c015b757>] handle_mm_fault+0x183/0x1e0
     [<c0113e07>] do_page_fault+0x11f/0x43c
     [<c0113ce8>] ? do_page_fault+0x0/0x43c
     [<c026f572>] error_code+0x72/0x78
     =======================
    Mem-Info:
    DMA per-cpu:
    CPU    0: hi:    0, btch:   1 usd:   0
    CPU    1: hi:    0, btch:   1 usd:   0
    CPU    2: hi:    0, btch:   1 usd:   0
    CPU    3: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: hi:  186, btch:  31 usd: 150
    CPU    1: hi:  186, btch:  31 usd: 171
    CPU    2: hi:  186, btch:  31 usd: 145
    CPU    3: hi:  186, btch:  31 usd: 153
    HighMem per-cpu:
    CPU    0: hi:  186, btch:  31 usd:  80
    CPU    1: hi:  186, btch:  31 usd: 157
    CPU    2: hi:  186, btch:  31 usd: 208
    CPU    3: hi:  186, btch:  31 usd: 137
    Active:358187 inactive:320084 dirty:0 writeback:0 unstable:0
     free:19121 slab:7075 mapped:659 pagetables:82 bounce:0
    DMA free:11164kB min:64kB low:80kB high:96kB active:1472kB inactive:1240kB present:15868kB pages_scanned:9835 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 2776 2776
    Normal free:64892kB min:3744kB low:4680kB high:5616kB active:382712kB inactive:382612kB present:894080kB pages_scanned:372896 all_unreclaimable? no
    lowmem_reserve[]: 0 0 15223 15223
    HighMem free:428kB min:512kB low:2552kB high:4592kB active:1048564kB inactive:896484kB present:1948560kB pages_scanned:31617081 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 1*4kB 7*8kB 40*16kB 75*32kB 36*64kB 9*128kB 4*256kB 3*512kB 2*1024kB 0*2048kB 0*4096kB = 11164kB
    Normal: 15423*4kB 18*8kB 9*16kB 2*32kB 6*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 64988kB
    HighMem: 1*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 428kB
    678222 total pagecache pages
    28 pages in swap cache
    Swap cache stats: add 9762, delete 9734, find 2155/3264
    Free swap  = 30713264kB
    Total swap = 30716152kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    1911 pages shared
    692514 pages non-shared
    Out of memory: kill process 1955 (sshd) score 81 or a child
    Killed process 3310 (sshd)
    cronscript.sh invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
    Pid: 3322, comm: cronscript.sh Not tainted 2.6.27.54 #31
     [<c014ecd2>] oom_kill_process+0xe6/0x10c
     [<c014efd3>] out_of_memory+0xaf/0x100
     [<c0150844>] __alloc_pages_internal+0x31c/0x3b0
     [<c015a53f>] do_wp_page+0x9f/0x49c
     [<c0132948>] ? __wake_up_bit+0xc/0x40
     [<c015b757>] handle_mm_fault+0x183/0x1e0
     [<c0113e07>] do_page_fault+0x11f/0x43c
     [<c0113ce8>] ? do_page_fault+0x0/0x43c
     [<c026f572>] error_code+0x72/0x78
     =======================
    Mem-Info:
    DMA per-cpu:
    CPU    0: hi:    0, btch:   1 usd:   0
    CPU    1: hi:    0, btch:   1 usd:   0
    CPU    2: hi:    0, btch:   1 usd:   0
    CPU    3: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: hi:  186, btch:  31 usd: 143
    CPU    1: hi:  186, btch:  31 usd: 161
    CPU    2: hi:  186, btch:  31 usd: 142
    CPU    3: hi:  186, btch:  31 usd: 171
    HighMem per-cpu:
    CPU    0: hi:  186, btch:  31 usd:  80
    CPU    1: hi:  186, btch:  31 usd: 157
    CPU    2: hi:  186, btch:  31 usd: 208
    CPU    3: hi:  186, btch:  31 usd: 137
    Active:358354 inactive:319939 dirty:0 writeback:0 unstable:0
     free:19071 slab:7075 mapped:689 pagetables:111 bounce:0
    DMA free:11164kB min:64kB low:80kB high:96kB active:1472kB inactive:1240kB present:15868kB pages_scanned:10539 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 2776 2776
    Normal free:64692kB min:3744kB low:4680kB high:5616kB active:383072kB inactive:382340kB present:894080kB pages_scanned:1310990 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 15223 15223
    HighMem free:428kB min:512kB low:2552kB high:4592kB active:1048872kB inactive:896176kB present:1948560kB pages_scanned:31666018 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 1*4kB 7*8kB 40*16kB 75*32kB 36*64kB 9*128kB 4*256kB 3*512kB 2*1024kB 0*2048kB 0*4096kB = 11164kB
    Normal: 15343*4kB 21*8kB 9*16kB 2*32kB 6*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 64692kB
    HighMem: 1*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 428kB
    678265 total pagecache pages
    61 pages in swap cache
    Swap cache stats: add 11379, delete 11318, find 2543/3850
    Free swap  = 30712744kB
    Total swap = 30716152kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    2492 pages shared
    692547 pages non-shared
    Out of memory: kill process 3318 (cronscript.sh) score 107 or a child
    Killed process 3319 (cronscript.sh)
    bash invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
    Pid: 3323, comm: bash Not tainted 2.6.27.54 #31
     [<c014ecd2>] oom_kill_process+0xe6/0x10c
     [<c014efd3>] out_of_memory+0xaf/0x100
     [<c0150844>] __alloc_pages_internal+0x31c/0x3b0
     [<c015a53f>] do_wp_page+0x9f/0x49c
     [<c015b757>] handle_mm_fault+0x183/0x1e0
     [<c0113e07>] do_page_fault+0x11f/0x43c
     [<c0113ce8>] ? do_page_fault+0x0/0x43c
     [<c026f572>] error_code+0x72/0x78
     =======================
    Mem-Info:
    DMA per-cpu:
    CPU    0: hi:    0, btch:   1 usd:   0
    CPU    1: hi:    0, btch:   1 usd:   0
    CPU    2: hi:    0, btch:   1 usd:   0
    CPU    3: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: hi:  186, btch:  31 usd: 178
    CPU    1: hi:  186, btch:  31 usd: 180
    CPU    2: hi:  186, btch:  31 usd: 171
    CPU    3: hi:  186, btch:  31 usd: 179
    HighMem per-cpu:
    CPU    0: hi:  186, btch:  31 usd:  80
    CPU    1: hi:  186, btch:  31 usd: 157
    CPU    2: hi:  186, btch:  31 usd: 208
    CPU    3: hi:  186, btch:  31 usd: 137
    Active:358137 inactive:320124 dirty:0 writeback:0 unstable:0
     free:19044 slab:7075 mapped:659 pagetables:100 bounce:0
    DMA free:11164kB min:64kB low:80kB high:96kB active:1464kB inactive:1240kB present:15868kB pages_scanned:10731 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 2776 2776
    Normal free:64584kB min:3744kB low:4680kB high:5616kB active:382404kB inactive:382720kB present:894080kB pages_scanned:1952385 all_unreclaimable? no
    lowmem_reserve[]: 0 0 15223 15223
    HighMem free:428kB min:512kB low:2552kB high:4592kB active:1048680kB inactive:896424kB present:1948560kB pages_scanned:31674398 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 1*4kB 7*8kB 40*16kB 75*32kB 36*64kB 9*128kB 4*256kB 3*512kB 2*1024kB 0*2048kB 0*4096kB = 11164kB
    Normal: 15332*4kB 13*8kB 9*16kB 2*32kB 6*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 64584kB
    HighMem: 1*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 428kB
    678229 total pagecache pages
    14 pages in swap cache
    Swap cache stats: add 11572, delete 11558, find 2617/3965
    Free swap  = 30712912kB
    Total swap = 30716152kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    2337 pages shared
    692510 pages non-shared
    Out of memory: kill process 1955 (sshd) score 81 or a child
    Killed process 3313 (sshd)
    sshd invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
    Pid: 1955, comm: sshd Not tainted 2.6.27.54 #31
     [<c014ecd2>] oom_kill_process+0xe6/0x10c
     [<c014efd3>] out_of_memory+0xaf/0x100
     [<c0150844>] __alloc_pages_internal+0x31c/0x3b0
     [<c0162251>] read_swap_cache_async+0x81/0xb4
     [<c01622d0>] swapin_readahead+0x4c/0x84
     [<c015afc9>] do_swap_page+0x16d/0x254
     [<c015b73c>] handle_mm_fault+0x168/0x1e0
     [<c0113e07>] do_page_fault+0x11f/0x43c
     [<c0113ce8>] ? do_page_fault+0x0/0x43c
     [<c026f572>] error_code+0x72/0x78
     [<c01cb286>] ? __copy_to_user_ll+0x46/0x178
     [<c0102a9f>] setup_frame+0x10b/0x324
     [<c0129e7d>] ? dequeue_signal+0x29/0x114
     [<c012b4a6>] ? ptrace_signal+0xa/0xbc
     [<c0103266>] handle_signal+0x116/0x15c
     [<c0103322>] do_signal+0x76/0x128
     [<c015af66>] ? do_swap_page+0x10a/0x254
     [<c017d4f6>] ? sys_select+0x9e/0x15c
     [<c01033f5>] do_notify_resume+0x21/0x24
     [<c01035b6>] work_notifysig+0x13/0x19
     =======================
    Mem-Info:
    DMA per-cpu:
    CPU    0: hi:    0, btch:   1 usd:   0
    CPU    1: hi:    0, btch:   1 usd:   0
    CPU    2: hi:    0, btch:   1 usd:   0
    CPU    3: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: hi:  186, btch:  31 usd: 183
    CPU    1: hi:  186, btch:  31 usd: 180
    CPU    2: hi:  186, btch:  31 usd: 171
    CPU    3: hi:  186, btch:  31 usd: 179
    HighMem per-cpu:
    CPU    0: hi:  186, btch:  31 usd:  80
    CPU    1: hi:  186, btch:  31 usd: 157
    CPU    2: hi:  186, btch:  31 usd: 208
    CPU    3: hi:  186, btch:  31 usd: 137
    Active:358256 inactive:320033 dirty:0 writeback:0 unstable:0
     free:19044 slab:7075 mapped:613 pagetables:100 bounce:0
    DMA free:11164kB min:64kB low:80kB high:96kB active:1464kB inactive:1240kB present:15868kB pages_scanned:10731 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 2776 2776
    Normal free:64584kB min:3744kB low:4680kB high:5616kB active:382836kB inactive:382456kB present:894080kB pages_scanned:1975428 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 15223 15223
    HighMem free:428kB min:512kB low:2552kB high:4592kB active:1048724kB inactive:896436kB present:1948560kB pages_scanned:31675298 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 1*4kB 7*8kB 40*16kB 75*32kB 36*64kB 9*128kB 4*256kB 3*512kB 2*1024kB 0*2048kB 0*4096kB = 11164kB
    Normal: 15332*4kB 13*8kB 9*16kB 2*32kB 6*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 64584kB
    HighMem: 1*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 428kB
    678229 total pagecache pages
    14 pages in swap cache
    Swap cache stats: add 11572, delete 11558, find 2617/3967
    Free swap  = 30713236kB
    Total swap = 30716152kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    1948 pages shared
    692583 pages non-shared
    Out of memory: kill process 3273 (sshconnect.sh) score 64 or a child
    Killed process 3280 (ssh)
    ssh invoked oom-killer: gfp_mask=0x1280d2, order=0, oomkilladj=0
    Pid: 3327, comm: ssh Not tainted 2.6.27.54 #31
     [<c014ecd2>] oom_kill_process+0xe6/0x10c
     [<c014efd3>] out_of_memory+0xaf/0x100
     [<c0150844>] __alloc_pages_internal+0x31c/0x3b0
     [<c015b0ff>] do_anonymous_page+0x4f/0x128
     [<c015b773>] handle_mm_fault+0x19f/0x1e0
     [<c0113e07>] do_page_fault+0x11f/0x43c
     [<c0113ce8>] ? do_page_fault+0x0/0x43c
     [<c026f572>] error_code+0x72/0x78
     [<c01cb286>] ? __copy_to_user_ll+0x46/0x178
     [<c01780af>] ? __follow_mount+0xb/0x70
     [<c014c1cf>] file_read_actor+0x47/0x148
     [<c0153a3f>] ? activate_page+0x97/0xac
     [<c014bf2d>] do_generic_file_read+0x1a5/0x400
     [<c014c3fe>] generic_file_aio_read+0x9e/0x1b0
     [<c014c188>] ? file_read_actor+0x0/0x148
     [<c0170e38>] do_sync_read+0xc8/0x118
     [<c015d6b2>] ? mmap_region+0x30e/0x424
     [<c01328bc>] ? autoremove_wake_function+0x0/0x38
     [<c015da16>] ? arch_get_unmapped_area_topdown+0x136/0x158
     [<c0170ca2>] ? rw_verify_area+0xe/0xa0
     [<c0170f10>] vfs_read+0x88/0x124
     [<c0170d70>] ? do_sync_read+0x0/0x118
     [<c01720ac>] ? fget_light+0xc/0xa4
     [<c0171228>] sys_read+0x40/0x68
     [<c0103526>] syscall_call+0x7/0xb
     =======================
    Mem-Info:
    DMA per-cpu:
    CPU    0: hi:    0, btch:   1 usd:   0
    CPU    1: hi:    0, btch:   1 usd:   0
    CPU    2: hi:    0, btch:   1 usd:   0
    CPU    3: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: hi:  186, btch:  31 usd: 172
    CPU    1: hi:  186, btch:  31 usd: 153
    CPU    2: hi:  186, btch:  31 usd: 162
    CPU    3: hi:  186, btch:  31 usd: 178
    HighMem per-cpu:
    CPU    0: hi:  186, btch:  31 usd:  80
    CPU    1: hi:  186, btch:  31 usd: 157
    CPU    2: hi:  186, btch:  31 usd: 208
    CPU    3: hi:  186, btch:  31 usd: 137
    Active:358103 inactive:320166 dirty:0 writeback:0 unstable:0
     free:19054 slab:7073 mapped:537 pagetables:77 bounce:0
    DMA free:11164kB min:64kB low:80kB high:96kB active:1472kB inactive:1240kB present:15868kB pages_scanned:11371 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 2776 2776
    Normal free:64624kB min:3744kB low:4680kB high:5616kB active:382440kB inactive:383044kB present:894080kB pages_scanned:903678 all_unreclaimable? no
    lowmem_reserve[]: 0 0 15223 15223
    HighMem free:428kB min:512kB low:2552kB high:4592kB active:1048500kB inactive:896492kB present:1948560kB pages_scanned:31715649 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 1*4kB 7*8kB 40*16kB 75*32kB 36*64kB 9*128kB 4*256kB 3*512kB 2*1024kB 0*2048kB 0*4096kB = 11164kB
    Normal: 15316*4kB 22*8kB 11*16kB 2*32kB 6*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 64624kB
    HighMem: 1*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 428kB
    678265 total pagecache pages
    61 pages in swap cache
    Swap cache stats: add 12299, delete 12238, find 2815/4300
    Free swap  = 30713708kB
    Total swap = 30716152kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    1505 pages shared
    692612 pages non-shared
    Out of memory: kill process 3325 (sshconnect.sh) score 64 or a child
    Killed process 3327 (ssh)
    sshconnect.sh invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
    Pid: 3325, comm: sshconnect.sh Not tainted 2.6.27.54 #31
     [<c014ecd2>] oom_kill_process+0xe6/0x10c
     [<c014efd3>] out_of_memory+0xaf/0x100
     [<c0150844>] __alloc_pages_internal+0x31c/0x3b0
     [<c0162251>] read_swap_cache_async+0x81/0xb4
     [<c01622d0>] swapin_readahead+0x4c/0x84
     [<c015afc9>] do_swap_page+0x16d/0x254
     [<c015b73c>] handle_mm_fault+0x168/0x1e0
     [<c0113e07>] do_page_fault+0x11f/0x43c
     [<c0113ce8>] ? do_page_fault+0x0/0x43c
     [<c026f572>] error_code+0x72/0x78
     =======================
    Mem-Info:
    DMA per-cpu:
    CPU    0: hi:    0, btch:   1 usd:   0
    CPU    1: hi:    0, btch:   1 usd:   0
    CPU    2: hi:    0, btch:   1 usd:   0
    CPU    3: hi:    0, btch:   1 usd:   0
    Normal per-cpu:
    CPU    0: hi:  186, btch:  31 usd: 170
    CPU    1: hi:  186, btch:  31 usd: 160
    CPU    2: hi:  186, btch:  31 usd: 162
    CPU    3: hi:  186, btch:  31 usd: 178
    HighMem per-cpu:
    CPU    0: hi:  186, btch:  31 usd:  80
    CPU    1: hi:  186, btch:  31 usd: 157
    CPU    2: hi:  186, btch:  31 usd: 208
    CPU    3: hi:  186, btch:  31 usd: 137
    Active:358117 inactive:320156 dirty:0 writeback:0 unstable:0
     free:19108 slab:7072 mapped:336 pagetables:69 bounce:0
    DMA free:11164kB min:64kB low:80kB high:96kB active:1472kB inactive:1240kB present:15868kB pages_scanned:11371 all_unreclaimable? yes
    lowmem_reserve[]: 0 873 2776 2776
    Normal free:64840kB min:3744kB low:4680kB high:5616kB active:382444kB inactive:382888kB present:894080kB pages_scanned:191395 all_unreclaimable? no
    lowmem_reserve[]: 0 0 15223 15223
    HighMem free:428kB min:512kB low:2552kB high:4592kB active:1048552kB inactive:896496kB present:1948560kB pages_scanned:31719106 all_unreclaimable? yes
    lowmem_reserve[]: 0 0 0 0
    DMA: 1*4kB 7*8kB 40*16kB 75*32kB 36*64kB 9*128kB 4*256kB 3*512kB 2*1024kB 0*2048kB 0*4096kB = 11164kB
    Normal: 15370*4kB 27*8kB 12*16kB 2*32kB 6*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 64896kB
    HighMem: 1*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 428kB
    678251 total pagecache pages
    38 pages in swap cache
    Swap cache stats: add 12434, delete 12396, find 2851/4356
    Free swap  = 30714276kB
    Total swap = 30716152kB
    720352 pages RAM
    490976 pages HighMem
    6570 pages reserved
    849 pages shared
    692792 pages non-shared
    Out of memory: kill process 3317 (cronscript.sh) score 56 or a child
    Killed process 3325 (sshconnect.sh)
    -bash-3.1# exit
    logout

    ============
    Solution use "Allocate 3rd-level pagetables from highmem enabled in kernel"
    ===============

    Note that LowFree is almost 845MB compared to about 74MB without this option enabled.
    I believe I am correct about this kernel option, it should be enabled by default or strongly advised not to be disabled.


    MemTotal:      2855128 kB
    MemFree:       2402716 kB
    Buffers:           496 kB
    Cached:         129748 kB
    SwapCached:          0 kB
    Active:         295048 kB
    Inactive:       108476 kB
    HighTotal:     1963904 kB
    HighFree:      1557316 kB
    LowTotal:       891224 kB
    LowFree:        845400 kB
    SwapTotal:           0 kB
    SwapFree:            0 kB
    Dirty:               0 kB
    Writeback:           0 kB
    AnonPages:      273288 kB
    Mapped:           3380 kB
    Slab:            26836 kB
    SReclaimable:    21348 kB
    SUnreclaim:       5488 kB
    PageTables:        692 kB
    NFS_Unstable:        0 kB
    Bounce:              0 kB
    WritebackTmp:        0 kB
    CommitLimit:   1427564 kB
    Committed_AS:   284300 kB
    VmallocTotal:   114680 kB
    VmallocUsed:      1592 kB
    VmallocChunk:   112784 kB
    HugePages_Total:     0
    HugePages_Free:      0
    HugePages_Rsvd:      0
    HugePages_Surp:      0
    Hugepagesize:     4096 kB
    DirectMap4k:      4096 kB
    DirectMap4M:    913408 kB
     

    It's not all about the numbers either, this kernel option stopped my kernel from triggering the OOM killer.


  • How to view UDP and other protocol connections?


    netstat is weak and can't show udp connections and most other protocols, use "ss" which is what netstat should have been:

    The "-u" switch stands for udp, here's a list of other options:

    Usage: ss [ OPTIONS ]
           ss [ OPTIONS ] [ FILTER ]
       -h, --help        this message
       -V, --version    output version information
       -n, --numeric    don't resolve service names
       -r, --resolve       resolve host names
       -a, --all        display all sockets
       -l, --listening    display listening sockets
       -o, --options       show timer information
       -e, --extended      show detailed socket information
       -m, --memory        show socket memory usage
       -p, --processes    show process using socket
       -i, --info        show internal TCP information
       -s, --summary    show socket usage summary

       -4, --ipv4          display only IP version 4 sockets
       -6, --ipv6          display only IP version 6 sockets
       -0, --packet    display PACKET sockets
       -t, --tcp        display only TCP sockets
       -u, --udp        display only UDP sockets
       -d, --dccp        display only DCCP sockets
       -w, --raw        display only RAW sockets
       -x, --unix        display only Unix domain sockets
       -f, --family=FAMILY display sockets of type FAMILY

       -A, --query=QUERY
           QUERY := {all|inet|tcp|udp|raw|unix|packet|netlink}[,QUERY]

       -F, --filter=FILE   read filter information from FILE
           FILTER := [ state TCP-STATE ] [ EXPRESSION ]

    ss -u
    State       Recv-Q Send-Q                                            Local Address:Port                                                Peer Address:Port  
    ESTAB       0      0                                                192.168.5.21:44862                                               156.154.70.1:domain 
    ESTAB       0      0                                                192.168.5.21:55120                                             208.67.222.222:domain 
    ESTAB       0      0                                                192.168.5.21:51548                                             208.67.222.222:domain 
    ESTAB       0      0                                                192.168.5.21:37629                                               156.154.70.1:domain 
    ESTAB       0      0                                                192.168.5.21:50728                                             208.67.222.222:domain


  • Openvz Container IP not working suddenly Solution


    This may not apply to everyone but here is what happened to me.

    One day my IP connectivity for one container went dead, I could ping the hostnode from it and the hostnode could ping it but there was no external routing.  I restarted the network service but it didn't help.

    I checked the routing table inside the VPS and the host and everything looked normal.  I added another different IP on the same subnet to the container and it worked.  Right away I started thinking that that one IP was stolen by another user on the network or that it had been null routed.

    Then I decided to do a traceroute to it, I found the last IP it hit was a different hostnode than my server was on.  Then I checked the route table on the other hostnode, sure enough it was routing for my containers IP even though it wasn't running there.

    How did this happen?  Because I had a failed attempt at live-migrating this server days before,and when the othe hostnode was restarted it brought up the other copy of my failed migration and added my IP to the routing table, so the two nodes were fighting and advertising the route for my containers IP.

    The solution was just a "route del xx.xx.xx.xx venet0" from the hostnode that wasn't running my container.


  • Did Rogers and other wireless block Mobile Twitter on government/police orders during the Canucks Stanely Cup Riot?


    I am watching the Canucks riot and a reporter said Twitter is down.

    My home connection on Shaw is fine, but when I used my Rogers network over the cell, it says "Rate Limit Exceeded".  I wonder if this is a transparent redirect by Rogers under police order?

    I noticed that the Telus network loaded Twitter just fine.


  • ifup eth0 SIOCSIFFLAGS: Cannot allocate memory Failed to bring up eth0 Centos Network won't work after kernel update and reboot


    ifup eth0
    SIOCSIFFLAGS: Cannot allocate memory
    Failed to bring up eth0

    This is on a Centos 5.5 machine with OpenVZ kernel 2.6.18-238.12.1.el5.028stab091.1PAE, I updated 3 systems with the same hardware to the same kernel and for some reason the network didn't come back.

    This only happened once the first time I booted into the new kernel and hasn't happened again but this is a serious issue for those running systems from remote locations such as a datacenters.

    I believe rebooting is what fixed everything or possibly removing and reloading the kernel module for the NIC.


    This may be a sign of a bad motherboard or power supply, eventually the related system just wouldn't come back after a reboot and would not power up at all.  Further, before the system died weird and random things happened with grub needing to be reinstalled after being corrupted etc...


  • IO/delay and high load when a SATA hard drive dies


    dd if=/dev/sda of=/dev/null creates ever increasing load every second.
    After minutes the load has moved up to 4.79
    I've tried with two different discs in my system.

    I wonder if it's a delay or problem with the SATA bus because one drive I have connected has recently failed.
    I notice when drives fail that you get some IO/blocking issue when they don't respond properly.

    Yes I believe it was, because here's the same disc after removing the dead SATA drive from the SATA bus:

     03:49:32 up 11 min,  2 users,  load average: 1.18, 1.00, 0.52
     04:00:27 up 22 min,  2 users,  load average: 1.18, 1.15, 0.84
     13:22:19 up 44 min,  2 users,  load average: 1.01, 1.12, 1.07

    It's too bad Linux doesn't have a way I know of to tell the SATA bus to stop probing a dead SATA drive/port.
    This feels almost like the blocking IO that you can get between IDE Slave/Master when one drive malfunctions.

     


  • rpmforge: [#### ] 471/10722Segmentation fault yum[18934]: segfault at 0000000000000000 rip 00002ade62153a30 rsp 00007fff76f9fe58 error 4


    A few days ago this happened on multiple Centos 5 servers and apparently anyone using rpmforge was affected by this error and there was no solution other than disabling that repo to fix it.

    To some this highlighted a few points, that there is a reason RHEL exists with full paid support, and also that this could be a vulnerability and huge flaw with yum.  A yum search or install should not segfault just because the rpmforge repo goes down.

    Fortunately it came back up as expected but it was definitely an inconvenience for many and hopefully a lesson learned by everyone including the yum devs

    rpmforge: [####                                                                                                  ] 471/10722Segmentation fault


    yum[18934]: segfault at 0000000000000000 rip 00002ade62153a30 rsp 00007fff76f9fe58 error 4

     

     


  • screen Cannot open your terminal '/dev/pts/2' - please check.


    The solution to this screen issue is simple.

    This happened to me in Centos 5 as a user, but I also su'd to it and I don't have any password for it.

    I've read some people say this is more common when su'ing.

    The solution is simple though, just give others rw access to the corresponding pts whether it's 0,1,2 etc..:

    As root do
    chmod o+rw /dev/pts/2
     


  • samba/smbd connection to share problems and solutions


    I'll start by showing some problems in the logs:


    [2011/08/07 16:22:06,  0] param/loadparm.c:8569(process_usershare_file)
      process_usershare_file: stat of /var/lib/samba/usershares/movie failed. Permission denied
    [2011/08/07 16:22:06,  1] smbd/service.c:676(make_connection_snum)
      create_connection_server_info failed: NT_STATUS_ACCESS_DENIED

    That means you don't have permission to access the files as a guest, if you're using Ubuntu make sure you check the "Guest access" box when sharing.  I forgot this because I normally share from the config file and use "guest ok = yes".

    [2011/08/07 16:26:37,  0] smbd/service.c:988(make_connection_snum)
      canonicalize_connect_path failed for service movie, path /home/q/Movie

     

    This is because you don't have permission at the filesystem level to access the share.

    This is usually because you're sharing something in your home directory and the permissions for /home/yourdir are always 700 for security.

    The only way around it is to do a chmod +x as root/sudo to /home/yourdirectory and then it will be resolved.

    The actual user message from the SAMBA client will be "tree connect failed: NT_STATUS_BAD_NETWORK_NAME" and note this has nothing to do with a bad network name.  I thought it meant it was because my computer name was very long and was truncated and it didn't recognize the full name but that wasn't the case.  These errors all came down to a permissions issue which is mainly unique to sharing something from your home directory.


  • wget download all files on page/directory automatically recursively


    Have you ever found a website/page that has several or perhaps dozens, hundreds or thousands of files that you need downloaded but don't have the time to manually do it?

    wget's recursive function called with -r does that, but also with some quirks to be warned about.
    If you're doing it from a standard web based directory structure, you will notice there is still a link to .. and wget will follow that.

    Eg. let's say you have files in http://serverip/documents/ and you call wget like this:
    wget -r http://serverip/documents, it will get everything inside documents but also browse up to .. and basically download every traversable file that can be followed (obviously this is usually not your intention).

    Another thing to watch out for is trying to use multiple sessions to traverse the same directory.
    By default wget will overwrite all files in place that it finds are duplicates.  The -nc option stops it from doing it, but I prefer the -N option which compares the time and size of the local and remote files and resumes if necessary and ignores them if they are the same (it doesn't compare by checksum though).  I think -N is what most will find makes sense for them.

    Avoid traversing outside of the intended path, by using -L for relative only.


    Best Way To Use wget recursively

    wget -nH -N -L -r http://serverip/path

    -nH means no host directory, otherwise you'll get a structure downloaded that mirrors the remove path which can be annoying.

    Eg. it would create serverip/path/file

    -N tells us to resume files if they are incomplete but if the remote file is newer or bigger, then resume/overwrite.  Otherwise nothing is done, the file is skipped since there's no sense in downloading the same thing again and overwriting.

    -L says stay in the relative path and is the behavior that you probably wanted and expected without using -L

    -r is obvious, it means recursive and to download from all links in the specified path

    But even the above still does some annoying things, it will traverse as many levels as it can find and see.


  • sed print specific line from file using Linux/Bash


    It may be hard to find by Googling by it's really quite simple and quicker than reading dozens of man page entries.

    sed -n 5p somefile.txt

    Just replace the 5 with whatever line you want to be printed.


  • vi disable color syntax highlighting/can't read syntax highlighting


    Within vi if you can't exit /etc/vim/vimrc you can type

    :syntax off

    And to turn it back on:

    :syntax on

    Many of us have a dark/black background in our terminal/shell making the default syntax unreadable, the solution is to either turn off syntax highlighting with :syntax off or to enable a special option in /etc/vim/vimrc

    Edit /etc/vim/vimrc

    The "syntax on" enables the highlighting permanently, and "syntax off" turn it off permanently (but of course it can temporarily be enabled or disabled within vi as shown above).

    if has("syntax")
      syntax on
    endif

    " If using a dark background within the editing area and syntax highlighting
    " turn on this option as well
    set background=dark

     

    If you are using a dark background then also set the "set background=dark" option on, otherwise it makes everything unreadable. I struggled with this until realizing that was an option.

    You can also run "set background=dark" from vi itself.


  • vi problem in Ubuntu/Debian distros when editing up,down,left,right arrow keys produce A,B,D,C respectively


    This is very annoying, the only known fix is to install vim

    apt-get install vim

    After that everything works as normal.


  • vino crashed/stopped working, restart vino manually without rebooting


    The normal solution would be as follows:

    export DISPLAY=:0.0

    /usr/lib/vino/vino-server &

    But what happens if that doesn't work?  I haven't been able to find much documentation about how to find the list of displays and how their numbering works in Xorg.

    Sometimes you'll get this error when trying to restart vino:

    Cannot open display:

    For some reason my display is not on 0.0, maybe it's because I restarted X a few times:

    View a list of all X displays:

    ls /tmp/.X*-lock

    /tmp/.X10-lock  /tmp/.X11-lock  /tmp/.X12-lock  /tmp/.X13-lock  /tmp/.X14-lock  /tmp/.X15-lock  /tmp/.X1-lock  /tmp/.X2-lock  /tmp/.X3-lock  /tmp/.X4-lock

    I exported each one manually and restarted vino-server until I found that mine was 4.0 (if you use X2 or X4 lock) then you need to pass it as 2.0 or 4.0 or X10 is 1.0 etc...

    export DISPLAY=:4.0

    /usr/lib/vino/vino-server&
    [1] 3854
    $ 04/09/2011 12:14:04 PM Autoprobing TCP port in (all) network interface
    04/09/2011 12:14:04 PM Listening IPv{4,6}://*:5900
    04/09/2011 12:14:04 PM Autoprobing selected port 5900
    04/09/2011 12:14:04 PM Advertising security type: 'TLS' (18)
    04/09/2011 12:14:04 PM Advertising authentication type: 'VNC Authentication' (2)
    04/09/2011 12:14:04 PM Advertising security type: 'VNC Authentication' (2)

    (vino-server:3854): Gtk-WARNING **: Error parsing gtk-icon-sizes string:
        'panel-menu=24,24
    panel=20,20
    gtk-button=18,18
    gtk-large-toolbar=24,24'


  • scp not found - solution


    Some minimal installs of Centos may be missing the scp command, which is actually part of the "openssh-clients" package.

    scp not found
    yum install openssh-clients


  • MySQL Import CSV data tutorial guide


    It's actually fairly straight forward:

    load data local infile 'billpayments-payments.csv' into table payments
    fields terminated by ','
    enclosed by '"'
    lines terminated by 'n'

    The above assumes that your fields are terminated by a comma (some programs like OpenOffice change this to a semi-colon ;) and that they are enclosed with "

    The above will insert the data from billpayments-payments.csv into the table payments.


  • convert carat ^M/M Windows based text files to Linux


    carat M isn't this symbol ^ that you think, it can only be produced by typing "Ctrl-v, Ctrl-m". That you might see in text files saved from Windows.

    tofrodos is the package that has dos2unix which is basically the same scripts that replace ^M with /n

    tofrodos is the Debian/Buntu package name which has the dos2unix and unix2dos binaries


  • Hitachi HDD/Drive RMA Process Experience


    The first Hitachi Deskstar 2TB 5K3000 drive I bought arrived DOA for whatever reason (not recognized by the BIOS or OS).  Perhaps it was shipping since I bought only 1 hard drive.  When I bought 4 through another Vendor, all 4 checked out fine.

    I was worried about the RMA process because a lot of people have complained about Hitachi taking weeks to send out their hard drive and almost implied the warranty is useless.

    I'm happy to report that my experience was great and quite easy.  Hitachi's system e-mailed me and their on-line status shows the progress of the RMA, whether or not they received the drive, and if they've shipped a new one back.

    RMA number: 3xxxxxxx

    The returned defective hard disk drive was received and the replacement hard disk drive was shipped.

    RMA issued on 2011-09-09

    Defective hard disk drive received on 2011-09-14

    Replacement hard disk drive sent on 2011-09-15

    Here's a convenient link to Hitach's RMA Process

    http://www.hitachigst.com/portal/site/en/support/warranty/

    Step 2 is handy to lookup your warranty status (shows if the product is under warranty and when it expires).


    Once again I've sent in 3 drives for RMA, they were shipped the next day.  I think that Western Digital takes far longer, it seems to take several days to get anything back from WD:

     

    RMA number: 3xxxxxxxx

    The returned defective hard disk drive was received and the replacement hard disk drive was shipped.

    RMA issued on 2013-05-27

    Defective hard disk drive received on 2013-06-28

    Replacement hard disk drive sent on 2013-06-29


  • Linux Kernel Panic Messages - Symptoms of bad RAM module/stick


    These were caused by a bad stick of Corsair RAM

    [<c0466769>] free_hot_cold_page+0xfc/0x150

    [<c04667d1>] __pagevec_free+0x14/0x1a

    [<c0468c6b>] release_pages+0x127/0x12f

    [<c04692d1>] __pagevec_release+0x15/0x1d

    [<c04697db>] __invalid_mapping_pages+0x120/0x156

    [<c0469818>] invalidate_mapping_pages+0x7/0x9

    [<c049c22e>] shrink_icache_memory+0xf5/0x295

    [<c046aeab>] shrink_slab+0xfb/0x16e

    [<c046b271>] kswapd+0x2d7/0x3fb

    [<c0436e1f>] autoremove_wake_function+0x0/0x2d

    [<c046af9a>] kswapd+0x0/0x3fb

    [<c0436d5d>] kthread+0xc0/0xeb

    [<c0436c9d>] kthread+0x0/0xeb

    [<c062d243>] kernel_thread_helper+0x7/0x10

    Code: 43 1c 31 c0 eb 0d 31 d2 89 f1 55 89 f8 e8 74 f0 ff ff 5a 5b 5e 5f 5d c3 55

    89 d5 57 89 c7 56 53 8b 70 20 85 f6 0f 84 e9 00 00 00 <8b> 06 3d 75 62 75 62 0f

    84 86 00 00 00 50 56 57 68 28 0e 63 c0

    EIP: [<c043b5b4>] ub_page_uncharge+0x13/0x101 SS:ESP 0068:f7861df0

    Kernel panic - not syncing: Fatal exception

     

    ---------

    [<c0466769>] free_hot_cold_page+0xfc/0x150
    [<c04667d1
    >] __pagvec_free+0x14/0x1a
    [<c0468c37
    >] release_pages+0xf3/0x12f
    [<c0469Zd1
    >] __pagevec_release+0x15/0x1d
    [<c0469b1Z
    >] truncate_inode_pages_range+0xcc/0x260
    [<f916c8d3
    >] journal_stop+0x208/0x213 [jbd]
    [<c0469caf
    >] truncate_inode_pages+0x9/0xe
    [<f91a8a57
    >] ext3_delete_inode+0x13/0xba [ext3]
    [<f91a8a44
    >] ext3_delete_inode+0x0/0xba [ext3]
    [<c049b9ea
    >] generic_deIete_inode+0x91/0xfe
    [<c049b4c1
    >] input+x67/0x69
    [<c0498df5
    >] d_kill+0x19/0x32
    [<c0499f36
    >] dput+19f/0x1ac
    [<c049Z717
    >] sys_renameat+0x15f/0x1af
    [<c047Z410
    >] remove_vma+0x47/0x4c
    [<c047Ze3a
    >] do_munmap+0x19e/0x1ba
    [<c049Z778
    >] sys_rename+0x11/0x15
    [<c06Zc4eb
    >] syscall_call+0x7/0xb

    Code: 43 1c 31 c0 eb 0d 31 dZ 89 f1 55 89 f8 e8 74 f0 ff ff 5a 5b 5e 5f 5d c3 5'
    89 d5 57 89 c7 56 53 8b 70 Z0 85 f6 0f 84 e9 00 00 00 <8b> 06 3d 75 6Z 75 6Z 0
    84 86 00 00 00 50 56 57 68 Z8 0e 63 c0
    EIP:  [<c043b5b4>] ub_page_uncharge+0x13/0x101 SS:ESP 0068:f7acbd9c
    Kernel panic - not syncing: Fatal exception

  • gocr - free Linux OCR (Optical Character Recognition) conversion tool


    gocr works great and it's simple, just invoke it like so:

    gocr filename.png

    The output will be printed to the screen.

    My only complaint/concern is that even with standard terminal output (not scanned) from a printscreen, gocr does make mistakes by inserting extra spaces where they don't belong, mistaking letters for numbers etc.. but it's definitely enough to be readable and figure out what you're looking at.

    I haven't tested yet with scanned input from invoices, receipts etc..


  • Install Android SDK and start testing on Debian/Ubuntu: How To Guide/Tutorial


    Visit http://linux.softpedia.com/get/Programming/Interpreters/Android-32340.shtml

    Basically copy and paste all of that below and you'll have installed and started the Android SDK before you know it.


    wget http://dl.google.com/android/android-sdk_r12-linux_x86.tgz
    sudo apt-get install openjdk-6-jre openjdk-6-lib openjdk-6-jre-headless
    tar -xvf android-sdk_r12-linux_x86.tgz
    cd android-sdk-linux_x86/tools
    ./android


  • iPhone Restore/Backup Location of Notes and Contact/Address Book


    *Make sure that the ownership is 501.501 or mobile.mobile when copying back (especially if using ssh or sftp as root on the iPhone) otherwise things will break.  Eg. the contacts will be blank even after trying to update due to incorrect ownership/permissions.

    iPhone Notes Location/Restore:
    /private/var/mobile/Library/AddressBook
    AddressBookImages.sqlitedb  AddressBook.sqlitedb

    Once you restore the contacts and restart your address book/contacts you'll see that an Apple