寻觅生命中的那一片浅草......

每月存档 八月, 2010

rsync_error_deflate

Today I check synchronization status of my backup files.There is three files are not synchronizing.I type the rsync command manually to see what happend.

rsync -vazu –password-file=/etc/my.pass rsy@192.168.1.130::db_backup /data/backup/

it shows these errors:

deflate on token returned 0 (12912 bytes left)
rsync error: error in rsync protocol data stream (code 12) at token.c(274)
rsync: connection unexpectedly closed (347 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [receiver=2.6.8]
rsync: connection unexpectedly closed (327 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [generator=2.6.8]

After some googles,I find that There is something wrong with the last file in local directory.
Then I delete the last file in local directory and run the rsync command again.It works.All files are synchronizing.

References:
http://www.linuxsir.org/bbs/showthread.php?t=201042

2010-09-14
I can’t believe that the problem happens again.There is two files are not synchronizing.
I search this error “deflate on token returned” in google.I find this URL.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=50248
It’s very helpful.According to this article,that guy also get “deflate on token returned” error when he use “rsync -z” to deal with a 2GB big file
All my files are nearly 7GB.Maybe the “-z” option make rsync crash.
When I run “rsync -vau –password-file=/etc/my.pass rsy@192.168.1.130::db_backup /data/backup/”,it works.
At last, I remove -z from my rsync scripts.

Bypass a fsck during boot

Today,I reboot my CentOS box,It show some errors:

An error occurred during the file system check.
Dropping you to a shell;the system will reboot
when you leave the shell.
Give root password for maintenance
(or type Control-D to continue):

I know what cause this:Yesterday, I remove one partition, but I didn’t remove it from /etc/fstab

I don’t know the root’s password.so what only I can do is clicking Ctl+D,then the system reboot.

During the boot procedure,I edit the grub boot menu, add “single” at the end of kernel line.
After editing, it look likes ” kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ single”

I think the system will boot into single user mode.But unfortunately,it show the same errors.

I google with “boot ignore system check”,and I find an useful article.It shows that we can
put fastboot at the end of the kernel line.

In the end it should look as follow:
kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ fastboot

Greate!It works.

I ssh to the server and remove the old partition from /etc/fstab

OK,the article’s URL is http://www.cyberciti.biz/faq/linux-unix-bypassing-fsck/

http://www.cyberciti.biz/ is a great website,it contains many tips on linux,also it contains many shell scripts makes your system administration work easy.You must add it to your Favorite。

MySQL:how to ignore errors loading a dump

When we load a dump sql file using the following command:
mysql -uroot -pdbpassword test < /data/mysql.sql
the procedure will stop as it detects an error.
How to make procedure ignore the errors and continue anyway?
There are two kinds of methond can do that.

The first one:use “-f” option
mysql -uroot -pdbpassword -f test < /data/mysql.sql

The second one:access into mysql,and use the “source” command.
mysql -uroot -pdbpassword test
source /data/mysql.sql
exit

References:

http://forums.mysql.com/read.php?28,78316,78316

Using Ketchup to manage your kernel sources

Today I discovered Ketchup, a little command-line tool to manage your Linux kernel sources. If you’re one of the weirdos, who is still compiling his kernel manually for whatever reason (like I do), I can only recommend it. Ketchup nicely eases up the entire process of checking for updates and applying them to your system.

Let’s not hesitate and look at few usage examples… Want to know what’s the latest version of a particular kernel-tree?

$ ketchup -s 2.6

2.6.17.7

$ ketchup -s 2.6-mm

2.6.18-rc1-mm2

Let’s play with your kernel sources a bit. First of all, you surely want to check what version you currently got lying around…

$ cd /usr/src/linux

$ ketchup -m

2.6.17.6

Let’s assume there is a newer kernel version available and you want to download it, bunzip it, revert the old patch and apply the new one. Nothing easier than that:

# cd /usr/src/linux

# ketchup 2.6-tip

2.6.17.6 -> 2.6.17.7

Applying patch-2.6.17.6.bz2 -R

Applying patch-2.6.17.7.bz2

That’s really it. It will download the patches, revert and apply them, so all you will have to do is watch and wait

Switching to an entirely different kernel versions is just as easy:

# cd /usr/src/linux

# ketchup 2.6.16.2

Final note: If Ketchup should abort with a gpg error, then it couldn’t verify the patch’s or kernel’s signature. Either add the 2.6 public key to your keyring (this is the proper solution) or call Ketchup with an additional -G parameter (this will override signature checking). I’d suggest the former, which is really easy to do by downloading it from a public pgp server:

# gpg –keyserver wwwkeys.pgp.net –recv-keys 0x517D0F0E

Have fun compiling,

muesli

From:http://amarok.kde.org/blog/archives/199-Using-Ketchup-to-manage-your-kernel-sources.html

2010年八月
« 7月   9月 »
 1
2345678
9101112131415
16171819202122
23242526272829
3031