如何选择Linux发行版?

@YeimMeMeMes 在其个人社交媒体主页上贴出了一张如何选择Linux发行版的图(原图链接:https://pbs.twimg.com/media/C3PoAagWMAAe5YT.jpg:large):

C3PoAagWMAAe5YT

因为这幅图上所列举的大部分Linux发行版我都没怎么使用过,所以我没有资格对这张图是否合理发表评论,仅供读者参考。下面我仅对我曾经使用过的一些Linux发行版谈些感受:

(1)这个图上并没有出现一些Linux的商业版本,譬如,RedHatRed Hat Enterprise LinuxSuSESUSE Linux Enterprise Server,等等。我以前做过这两个Linux商业版本上的测试工作,感觉还是很稳定的。给我一个很深的印象就是在Red Hat Enterprise Linux上编译和安装最新版本的Linux内核总是非常顺利,而在其它发行版上有时会遇到一些莫名其妙的问题。从去年开始,Red Hat Enterprise Linux对开发者已经免费了(可参考这篇文章:As in beer: Red Hat offers RHEL free to developers),有兴趣的朋友可以体验一下。

(2)最近两个月,在工作中我主要使用Arch LinuxArch Linux在软件包更新方面非常及时。有时你发现当前软件包不是最新的,只要在其网站上提一个请求,很快就会有维护者响应。如果你总是希望可以使用上最新的软件版本,不妨尝试一下Arch Linux

SLES12版本上Xen的一些变化

今天在网上找到一篇文档,描述了SLES12版本上Xen的一些变化:

(1)grub2
SLES12上使用grub2配置Xen参数。以配置dom0_max_vcpus为例:
a)SLES11使用/boot/grub/menu.lst(参考这里);
b)SLES12使用/etc/default/grub(参考这里)。

(2)xm/xend已经废弃了,要使用xl/libxl。下图做了一个简单对比:

Capture

(3)SLES12 Xen Stack

• Xen 4.4.1  
• kernel 3.12.x  
• libvirt 1.2.5  
• virt-install 1.1.x, vm-install 1.x.x  
• virt-manager 1.1.x  

 

 

Crash工具笔记 (3)—— 在Xen环境使用crash

这两周一直在crash邮件列表里讨论如何在SuSE Xen上使用crash调试Dom0 kernel。邮件来来回回讨论很多(参见这里),最后还发现了一个bug。细节不说了,把最后的结果总结一下:

(1)由于SuSE kerenl默认编译打开CONFIG_STRICT_DEVMEM编译开关,所以crash工具无法完全访问/dev/mem,可以使用/proc/kcore作为代替;

(2)SuSE带有crash.ko驱动(位于:“/lib/modules/uname -r/updates/crash.ko”),但默认没有安装,可以自己手动安装(使用insmod命令),然后就可以使用了:

# crash

crash 7.1.3
Copyright (C) 2002-2014  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.

crash: /boot/xen-4.5.gz: original filename unknown
       Use "-f /boot/xen-4.5.gz" on command line to prevent this message.

WARNING: machine type mismatch:
         crash utility: X86_64
         /var/tmp/xen-4.5.gz_ud3IRy: X86

crash: /boot/symtypes-3.12.49-6-default.gz: original filename unknown
       Use "-f /boot/symtypes-3.12.49-6-default.gz" on command line to
prevent this message.

crash: /boot/symvers-3.12.49-6-default.gz: original filename unknown
       Use "-f /boot/symvers-3.12.49-6-default.gz" on command line to
prevent this message.

GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

      KERNEL: /boot/vmlinux-3.12.49-6-xen.gz
   DEBUGINFO: /usr/lib/debug/boot/vmlinux-3.12.49-6-xen.debug
    DUMPFILE: /dev/crash
        CPUS: 128
        DATE: Fri Nov 20 06:55:06 2015
      UPTIME: 18:51:36
LOAD AVERAGE: 1.76, 1.48, 1.21
       TASKS: 1230
    NODENAME: dl980-5
     RELEASE: 3.12.49-6-xen
     VERSION: #1 SMP Mon Oct 26 16:05:37 UTC 2015 (11560c3)
     MACHINE: x86_64  (1995 Mhz)
      MEMORY: 125.9 GB
         PID: 6618
     COMMAND: "crash"
        TASK: ffff881ea93b2140  [THREAD_INFO: ffff881e869f2000]
         CPU: 112
       STATE: TASK_RUNNING (ACTIVE)

 

SLES和SLES SP的区别

今天才知道SLES(SUSE Linux Enterprise Server)SLES SP(SUSE Linux Enterprise Server Service Package)是不同的版本,SLES相当于主版本(major version),而SLES SP则相当于基于主版本发布的小版本(minor version)。参见wiki百科

SUSE Linux Enterprise Server (SLES) is a Linux-based operating system developed by SUSE. It is designed for servers, mainframes, and workstations but can be installed on desktop computers for testing as well. Major versions are released at an interval of 3–4 years, while minor versions (called “Service Packs”) are released about every 18 months. SUSE Linux Enterprise products, including SUSE Linux Enterprise Server, receive more intense testing than the openSUSE community product, with the intention that only mature, stable versions of the included components will make it through to the released enterprise product. SLES 11 SP4 was released July 16th, 2015, which is developed from a common code base with SUSE Linux Enterprise Desktop and other SUSE Linux Enterprise products.

查看SLES发行版信息:

linux-6fj5:/ # cat /etc/issue

Welcome to SUSE Linux Enterprise Server 11 SP4  (x86_64) - Kernel \r (\l).

Xen结构简介

Xen的虚拟化环境结构如下图所示:

Capture

Xen hypervisor:直接运行在硬件上,它负责CPU调度和为虚拟机划分内存。 Xen hypervisor不光为运行之上的虚拟机抽象出硬件,还会控制虚拟机的运行。

Domain 0Xen hypervisor启动的第一个,拥有特权的虚拟机:比如可以直接访问硬件,启动其它虚拟机等。

Domain U:其它无特权的虚拟机,可以为PVHM Guest

以支持XenSuse为例,/boot/grub/menu.lst文件如下:

title Xen -- SUSE Linux Enterprise Server 11 SP4 - 3.0.101-63
    root (hd0,1)
    kernel /boot/xen.gz vga=mode-0x314
    module /boot/vmlinuz-3.0.101-63-xen root=/dev/disk/by-id/ata-VBOX_HARDDISK_VBe358a50a-9595120d-part2 resume=/dev/disk/by-id/ata-VBOX_HARDDISK_VBe358a50a-9595120d-part1 splash=silent showopts vga=0x314
    module /boot/initrd-3.0.101-63-xen

可以看到,实际运行的kernel/boot/xen.gz,修改过的kernel(有-xen后缀)和initial ramdisk都是/boot/xen.gz的模块。

参考资料:
How does Xen work?

What is Dom0 and how can one use it?

Suse使用初体验

这两天折腾了一下SuseSLES 12 Beta版本),感觉和RedHat系列还是有一些不同。记录下来,以备以后查找:

(1)YaST2

YaST (Yet another Setup Tool)2Suse系统上的配置工具的:

Capture

感觉很好用。配置网络,FTPProxy等等,很方便。另外,单击图标就可以启动软件了,让用惯了“双击”的我开始不大适应。

(2)zypper

命令行安装软件使用zypper命令(in代表install):

zypper in git-core

卸载(rm):

zypper rm git-core

另外注意,git包的名字叫git-core

(3)命令窗口

使用Alt + F2快捷键可以调出命令窗口:

Capture1

输入gnome-terminal可以打开一个终端。

(4)supportconfig

Suse提供了supportconfig工具,用来抓取系统的信息,对debugging提供了很大的帮助:

Capture