Linux file system goes read-only

All partitions of our Linux-based server suddenly went read-only, all write operations failed with “Read-only filesystem” error. I had never seen such strange problem before, after some Google search, I reached the conclusion that it might be caused by some serious hard disk issues.

It’s 3:00 am, and I had no choices but go to data center to fix that server by myself. It’s such a terrible experience, luckily, the problem got fixed finally.

Here are the steps I took:

1) I guess the problem was caused by some hard disk issues, and running fsck may have a chance fixing it

2) pressing the ‘reset’ button, after a few seconds, SUSE(SUSE Linux Enterprise Server 11) boot failed, and dropped a prompt asking for root password

3) inputting root password to enter safe-mode, we can run fsck to fix the filesystem of all partitions. we use ext3, so run fsck -t ext3 /dev/sda[n] on each partition.

4) Luckily, all filesystems were repaired successfully, Ctrl+D to exit the safe-mode shell, system rebooted.

5) everything went OK.

Many various issues may lead to such problem, these steps work for my particular situation, I can’t guarantee them work for yours. There is NO WARRANTY, run it on your own risk.

Posted in Uncategorized | Leave a comment

Managing crontab entries

If only maintaining several crontab entries, `crontab -e’ way is sufficient and straight forward. However, any non trivial website may have a large number of crontab entries to be maintained, and keeping these entries as files that tracked with VCS seems a better solution.

Most GNU/Linux distributions keep system-wide crontab entries in /etc/init.d directory. Two points that need to keep in mind here are:
a) owner of files in /etc/init.d must be root
b) files are reloaded when /etc/init.d is modified or files are modified

so we can use either way of:
1) check out crontab entry from repos, then chown root.root /file/in/repos, ln -sf /file/in/repos /etc/cron.d/file
2) check out crontab entry from repos, then chown root.root /file/in/repos, rsync /file/in/repos /etc/cron.d/file

at the end, the format of files in /etc/cron.d is like following

* * * * * root /path/to/script > /dev/null 2>&1

Posted in Uncategorized | Leave a comment

Experience free wifi in Beijing Capital Airport T3

People can use free wifi in beijing capital airport t3 to surf the internet now.

First connect the wifi-enabled devices to the “airport free wifi”, a wifi AP, then open a browser and visit some website, a window will pop-up asking for the username and password, which can be gained by filling your mobile phone number that can be used to receive them later. As long as you get your username/password you can use them to start your internet surfing.

The only drawback of the free wifi is its instability. During my trial, it got disconnected several times, and sometimes it could be very slow, probably because too many people are using it. After all, free is good.

Posted in Uncategorized | Leave a comment

Upgraded to WordPress 3.1

This blog had just Upgraded to WordPress 3.1 from 2.5, The upgrade process is smooth, since none customized plugins/themes were used.

WordPress 3.1 is great! I will write more frequently from now on, i guess.

Posted in Uncategorized | Leave a comment

solution for “git-upload-pack: command not found” issue on bluehost

Recently, Bluehost upgrade their openssh software, unfortunately, it
causes some problems.

While execute commands over remote ssh (git over ssh need it), it didn’t
set PATH env correctly, so `git update` fails with “git-upload-pack:
command not found” error messages.

To workaround this issue, for git, you can specify
–upload-pack/–receive-pack options in command line, for example:

git clone –upload-pack=/the/path/to/git-upload-pack YourGitRepos

use `git help clone` see more details about –upload-pack options.

Hope this post helps.

Posted in Uncategorized | Tagged , , | Leave a comment

Everything seems works!

It seems everything is ok.

Posted in Uncategorized | Tagged | Leave a comment

Test categories and tags.

Test if categories and tags works.

Posted in Uncategorized | Tagged | Leave a comment

Post an entry from GNU/Emacs.

Just for test :-)

Posted in Uncategorized | Leave a comment

rebinding alt + enter in SecureCRT for emacs.

“alt + enter” by default toggles fullscreen mode, we can rebinding it as follows:

1. click menu: Tools-> Keymap Editor

2. click “Map a Key”, and press “Alt + Enter”

3. select “Send String”, and input \033\015, and click ok

4. click save, and close.

5. now, alt + enter send M-RET in emacs.

Posted in Uncategorized | Leave a comment

Build Erlang/OTP R12B-3 from source on Slackware.

在SlackWare上编译erlang,遇到如下错误:

erlc -W +debug_info +warn_obsolete_guard -I/home/nbajamah/utils/otp_src_R12B-2/lib/stdlib/include -o../ebin yecc.erl
Fatal, could not get clock_monotonic value!, errno = 22
make[3]: *** [../ebin/yecc.beam] Aborted

查了源码,发现在 sys.c 中调用了 clock_gettime(),调用参数使用了 CLOCK_MONOTONIC,然后检查该函数的返回值,如果返回值非零,则直接报上述 fatal error 了。把这段代码拿出来单独编译,发现也有这个问题。但是把调用参数改为 CLOCK_REALTIME 就没有问题了。这两者的区别还没有去深究,不管怎么样编译没有问题了。

Posted in Uncategorized | Tagged | Leave a comment