Tuesday, March 12, 2013

Linux Troubleshoot




MBR rebuild
- boot to rescue mode
- # chroot /mnt/sysimage
- # grub-install /dev/sda
- # exit

Fix Grub menu
symptom: boot stop at grub> (e.g. after remove /etc/grub.conf)
grub> root (hd0,
 Possible partitions are:
     Partition num: 0, Filesystem type is ext2fs, partition type 0x83

     Partition num: 1, Filesystem type is ext2fs, partition type 0x83
     Partition num: 2, Filesystem type is unknown, partition type 0x82
     Partition num: 4, Filesystem type is ext2fs, partition type 0x83
grub> root (hd0,0)
  Filesystem type is ext2fs, partition type -x83
grub> kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/sda2 quiet
     [Linux-bzImage, setup=0x1e00, size=0x1c31d4]
grub> initrd /initrd=2.6.18-164.el5.img
     [Linux-initrd 0xfcb400, 0x276090 bytes]
grub> boot
After boot, # vi /boot/grub/grub.conf
(:.!ls /boot to insert content under /boot), the file grub.conf will be like:
default=0
timeout=5
hiddenmenu
title linux
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/sda2 quiet
initrd /initrd-2.6.18-164.el5.img
# cd /etc
# ln -s ../boot/grub/grub.conf .

fstab error
Can only boot to readonly root system:
Give root password for maintenance
(or type Control-D to continue):

remount the root partition:
# mount -o rw,remount /

Recovering /boot, fstab
- boot to rescue mode
- # findfs LABEL=/ find root partition and other partition
- manual mount / and other partition to /mnt/sysimage
- # chroot /mnt/sysimage
- rebuild/recreate fstab
- re-install kernel
  # rpm -ivh kernel-2.6.18-8.e15.i686.rpm --root=/ --force
  This will install /boot
- # grub-install /dev/sda

disk performance
# smartctl -H /dev/sdb
# hdparm -t /dev/sdb
# vmstat
# iostat -x -k 5
# strace -c ls -R /



tech blogs

VM
http://blog.vhowto.info/
http://drewsymo.com/cloud-computing/install-xen-on-centos-and-create-a-fedora-debian-vm/
XenServer PV guests and Cobblerhttp://jsosic.wordpress.com/2013/05/23/xenserver-pv-guests-and-cobbler/

Linux
http://www.unixmen.com/
Linux公社 http://www.linuxidc.com
Hadoop http://www.linuxidc.com/topicnews.aspx?tid=13
Linux数据库 http://doc.linuxpk.com/type198.html

NetApp


NetBackup
http://www.mass.dk/netbackup.html
http://netbackup.wordpress.com/

http://blogs.citrix.com/

------------------
Synology DSM in Virtual Machine
http://www.avsforum.com/t/1460222/how-to-roll-your-own-synology-diskstation-for-nas-update-5-28-2013-dsm-4-2-3211


---
general
http://www.thegeekstuff.com/

--------
read list for xen backup
https://github.com/xenserver/transfervm
http://technocrat.kagan.cc/2013/08/script-xenserver-backups.html
http://sysadminnotebook.blogspot.com/2011/06/xenserver-backup-solution.html
http://www.fungusware.com/