=^.^=

Xen Virtual Disk I/O Errors

karma

I just encountered this while making a tar backup on one of my virtual filesystems:

lost page write due to I/O error on xvdb1
end_request: I/O error, dev xvdb1, sector 33707688
Buffer I/O error on device xvdb1, logical block 4213461

Unfortunately, my fs suffered corruption.

Some folks, particularly Ubuntu users with kernel 3.2.x seem to say the answer is adding

barrier=0

to your ext3/ext4 mount options.

In my case I'm pretty sure an OOM error killed something critical to the backend on dom0.

Be sure to check your dom0's dmesg.

UPDATE Uhh yeah, something actually managed to overflow the dom0's fs. >.> This is what I was getting in the dom0 dmesg:

loop: Write error at byte offset 17820364800, length 4096.

for which there is very little discussion, but a quick df told me what was going on.

Force File System Check (fsck) on Reboot

karma

You may wish to check the integrity of your root file system without using a live cd or different system. To force a file system check on reboot either:

# touch /forcefsck

or

# shutdown -rF now

Zimbra Firewall Configuration for RedHat (CentOS/RHEL/Fedora/Rocky Linux)

karma

The firewall on a RHEL system is configured by default with system-config-firewall, which on the console is an annoying ncurses menu which doesn't permit adding custom ports/protocols.

The ports you probably want open for Zimbra are:

25
    smtp [mta] - incoming mail to postfix 
80
    http [mailbox] - web mail client 
110
    pop3 [mailbox] 
143
    imap [mailbox] 
443
    https [mailbox] - web mail client over ssl 
465
    smtps [mta] - incoming mail to postfix over ssl (Outlook only) 
587
    smtp [mta] - Mail submission over tls 
993
    imaps [mailbox] - imap over ssl 
995
    pops [mailbox] - pop over ssl 
7071
    https [mailbox] - admin console

The raw iptables configuration is stored in /etc/sysconfig/iptables:

# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 143 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 456 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 587 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 993 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 995 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 7071 -j ACCEPT 
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Ensure the iptables init script is part of your default runlevel.

# chkconfig --level 345 iptables on

Restart it to apply the changes.

/etc/init.d/iptables restart

How to Rename a Linux User Account

karma

Use this command to rename a user without changing their UID:

usermod -l newname oldname

Convert a QCOW Image to Raw Disk Format (QEMU, Xen)

karma
qemu-img convert -O raw diskimage.qcow diskimage.raw