2009年8月31日 星期一
2009年7月8日 星期三
multipath at boot
- For Red Hat Enterprise Linux 4 or later, issue one of the following commands:
- chkconfig multipathd on
- chkconfig --level 345 multipathd onNote: This command enables multipathd service startup at boot.
- For SUSE Linux Enterprise Server 9 or later, issue one of the following commands:
- chkconfig boot.multipath on
- chkconfig --level 345 boot.multipath onNote: This command enables boot.multipath service startup at boot.
- chkconfig multipathd on
- chkconfig --level 345 multipathd onNote: This command enables multipathd service startup at boot.
2009年7月1日 星期三
mkinitrd
1. mkinitrd -c -k 2.6.27.7-smp -m reiserfs:jbd
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-2.6.27.7-smp
initrd = /boot/initrd.gz
root = /dev/hda6
label = Lnx26277smp
read-only
# Linux bootable partition config ends
/etc/modprobe.conf
Specifies SCSI modules to be loaded and module options to be used.install modulename command... This is the most powerful primitive in modprobe.conf: it tells modprobe to run your command instead of inserting the module in the kernel as normal. The command can be any shell command: this allows you to do any kind of complex processing you might wish. For example, if the module "fred" worked better with the module "barney" already installed (but it didn't depend on it, so modprobe won't automatically load it), you could say "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred", which would do what you wanted. Note the --ignore-install, which stops the second modprobe from re-running the same install command. See also remove below. You can also use install to make up modules which don't otherwise exist. For example: "install probe-ethernet /sbin/modprobe e100 || /sbin/modprobe eepro100", which will try first the e100 driver, then the eepro100 driver, when you do "modprobe probe-ethernet". If you use the string "$CMDLINE_OPTS" in the command, it will be replaced by any options specified on the modprobe command line. This can be useful because users expect "modprobe fred opt=1" to pass the "opt=1" arg to the module, even if there's an install command in the configuration file. So our above example becomes "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred $CMDLINE_OPTS"2009年6月1日 星期一
iometer & dynamo
2009年5月6日 星期三
2009年4月15日 星期三
2009年1月10日 星期六
kernel 重置
Kernel 重製:
流程:
- 設定 kernel 選項
- 編譯 kernel
- 編譯 modules, 安裝 modules
- 安裝 kernel
- 設定 boot loader
- 重新開機
步驟:
- cd 您解壓後的目錄下的 linux 目錄中
- make mrproper
- make xconfig (menuconfig 或 config), 它會存成 .config
- make dep
- make bzImage
- make modules
- make modules_install
- cp arch/boot/i386/bzImage /boot
- 編輯 /etc/lilo.conf 或 /boot/grub/grub.conf
- 執行 lilo -v -v; 若是使用 grub, 則不必.
- reboot
2009年1月8日 星期四
kthread
ps -ef
the process with [ ] is kernel thread
is kernel thread preemptive?
1. if CONFIG_PREEMPT is defined, kernel thread is preemptive
2. if CONFIG_PREEMPT is not defined, kernel thread is not preemptive. It will freeze the system if it doesn’t go to sleep.
kthread_create
2009年1月7日 星期三
2008年12月29日 星期一
2008年12月27日 星期六
linux list
struct list_head {
struct list_head *next, *prev;
};
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
INIT_LIST_HEAD: when list_head is first created, its next & prev point to itself
static inline void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
}
list_add: add new element A to B, if B's next is C, then final sequence is B, A, C
static inline void list_add(struct list_head *new, struct list_head *head)
{
__list_add(new, head, head->next);
}
static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
#define list_for_each(pos, head) \
for (pos = (head)->next; prefetch(pos->next), pos != (head); \
pos = pos->next)
/* list_entry - get the struct for this entry
@ptr: the &struct list_head pointer.
@type: the type of the struct this is embedded in.
@member: the name of the list_struct within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
/* container_of - cast a member of a structure out to the containing structure
@ptr: the pointer to the member.
@type: the type of the container struct this is embedded in.
@member: the name of the member within the struct.
*/
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
2008年12月25日 星期四
multipath-tools
http://christophe.varoqui.free.fr/
compile:
(1) install device-mapper-devel-1.02.13-6.14.x86_64.rpm
(2) install readline-devel-5.1-24.19.x86_64.rpm.rpm
(3) cd multipathd
(4) make
