在 2003 年 10 月,GNU C 程序庫 glibc 中融入了 NPTL 支持,Red Hat 率先在 Red Hat Linux 9 和
Red Hat Enterprise Linux 中使用定制的 v2.4 內(nèi)核實(shí)現(xiàn)了 NPTL。
08.性能改進(jìn)
新的調(diào)度器算法
2.6 Linux 內(nèi)核引入了新的 O(1) 算法。在高負(fù)載情況下它運(yùn)行得特別好。新的調(diào)度器基于每個(gè) CPU 來分布時(shí)間片,
這樣就消除了全局同步和重新分配循環(huán),從而提高了性能。
12.除了對(duì)傳統(tǒng) Linux 文件系統(tǒng)的改進(jìn)支持以外,新的內(nèi)核完全支持在 Linux 中相對(duì)較新的 XFS 文件系統(tǒng)。
Linux 2.6 內(nèi)核現(xiàn)在還引入了對(duì) NTFS 文件系統(tǒng)的改進(jìn)的支持,現(xiàn)在允許以讀/寫模式安裝 NTFS 文件系統(tǒng)。
基于以上2.6的新特性,我決定用2.6的內(nèi)核,我的系統(tǒng)為Red Hat Enterprise Linux AS release 3 (Taroon Update 3)
硬件環(huán)境為DELL 2850
一、下載解壓并打上內(nèi)核補(bǔ)丁
我以2.6.10為例子,patche以bk4的例子,目的只是讓大家知道怎么打patch,
其實(shí)本人用的是2.6.6的內(nèi)核,因?yàn)樵贏S3.0上升級(jí)到2.6.9以上的內(nèi)核,
mount大的nfs網(wǎng)絡(luò)硬盤時(shí),df 顯示不正確,明明是800G的盤變成4.2G,
不過還是能正常用,我升級(jí)過nfs和mount的包都沒用,/var/log/message里
提示是kernel: nfs warning: mount version older than kernel,
還望知道的 告知一聲,謝 :) BTW:2.6.8的內(nèi)核沒用過
cd /usr/src
rm -rf linux
tar jxf /download/linux-2.6.10.tar.bz2
ln -s linux-2.6.10 linux
cd linux
bunzip2 -dv /download/patch-2.6.10-bk4.bz2 |patch -p1
如果在/usr/src目錄下就用patch -p0
[Copy to clipboard]
[ - ]
CODE:
./configure --prefix=/
make moveold
make all install
./generate-modprobe.conf /etc/modprobe.conf
2.下載新的mkinitrd
ftp://195.220.108.108/linux/6/fe ... d-4.1.18-2.i386.rpm
它需要lvm2 device-mapper
ftp://195.220.108.108/linux/6/fe ... -1.00.19-2.i386.rpm
ftp://195.220.108.108/linux/6/fe ... 00.25-1.01.i386.rpm
如果不更新這個(gè)包在make install時(shí)會(huì)提示以下錯(cuò)誤:
[Copy to clipboard]
[ - ]
CODE:
No module mptbase found for kernel 2.6.10-bk4, aborting.
mkinitrd failed
make[1]: *** [install] Error 1
make: *** [install] Error 2
安裝lvm2-2.00.25-1.01.i386.rpm時(shí)請(qǐng)用rpm -ivh --nodeps package name
四、make menuconfig
[Copy to clipboard]
[ - ]
CODE:
01.Code maturity level options --->;
[*] Prompt for development and/or incomplete code/drivers
[*] Select only drivers expected to compile cleanly
02.General setup --->;
[*] Support for paging of anonymous memory (swap)
[*] System V IPC
[*] POSIX Message Queues
[ ] BSD Process Accounting
[*] Sysctl support
[ ] Auditing support
[ ] Support for hot-pluggable devices
[*] Kernel Userspace Events
[ ] Kernel .config support
[*] Configure standard kernel features (for small systems) --->;
[*] Load all symbols for debugging/kksymoops
[ ] Do an extra kallsyms pass
[*] Enable futex support
[*] Enable eventpoll support
[ ] Optimize for size
[*] Use full shmem filesystem
03.Loadable module support --->;
[*] Enable loadable module support
[*] Module unloading
[ ] Forced module unloading
[ ] Module versioning support (EXPERIMENTAL)
[ ] Source checksum for all modules
[*] Automatic kernel module loading
04.Processor type and features --->;
Subarchitecture Type (PC-compatible) --->;
Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon) --->;
[*] Generic x86 support
[ ] HPET Timer Support
[*] Symmetric multi-processing support 多CPU
(8) Maximum number of CPUs (2-255)
[*] SMT (Hyperthreading) scheduler support
[*] Preemptible Kernel 搶占式內(nèi)核,請(qǐng)選上它
[ ] Machine Check Exception
>; Toshiba Laptop support
>; Dell laptop support
>; /dev/cpu/microcode - Intel IA32 CPU microcode support
>; /dev/cpu/*/msr - Model-specific register support
>; /dev/cpu/*/cpuid - CPU information support
Firmware Drivers --->;
High Memory Support (4GB) --->; 高內(nèi)存
[ ] Allocate 3rd-level pagetables from highmem
[ ] Math emulation
[*] MTRR (Memory Type Range Register) support
[*] Enable kernel irq balancing
[ ] Use register arguments (EXPERIMENTAL)
05.Power management options (ACPI, APM) --->; 電源管理 自定 (偶沒選)
06.Bus options (PCI, PCMCIA, EISA, MCA, ISA) --->; 板卡支持 自定
[*] PCI support
PCI access mode (Any) --->;
[ ] Message Signaled Interrupts (MSI and MSI-X)
[*] Legacy /proc/pci interface
[*] PCI device name database
[ ] ISA support
[ ] MCA support
>; NatSemi SCx200 support
07.Executable file formats --->;
[*] Kernel support for ELF binaries
M>; Kernel support for a.out and ECOFF binaries
M>; Kernel support for MISC binaries
08.Device Drivers --->; 設(shè)備驅(qū)動(dòng)及網(wǎng)絡(luò)支持
Generic Driver Options --->; 默認(rèn)
[*] Select only drivers that don't need compile-time external firmware
[*] Prevent firmware from being built
Memory Technology Devices (MTD) --->; 不選
Parallel port support --->; 并行端口 自定(偶沒選)
Plug and Play support --->; 支持熱插拔 自定(偶沒選)
Block devices --->;
*>; Normal floppy disk support
>; Compaq SMART2 support
>; Compaq Smart Array 5xxx support
>; Mylex DAC960/DAC1100 PCI RAID Controller support
>; Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)
M>; Loopback device support
>; Cryptoloop Support
M>; Network block device support
>; Promise SATA SX8 support
M>; RAM disk support
(16) Default number of RAM disks
(4096) Default RAM disk size (kbytes)
() Source directory of cpio_list
[ ] Support for Large Block Devices
>; Packet writing on CD/DVD media
IO Schedulers --->; IO調(diào)度器,都選上吧 可以在grub.conf指定用IO調(diào)度哪種方式,后面會(huì)講的
*>; Anticipatory I/O scheduler
*>; Deadline I/O scheduler
*>; CFQ I/O scheduler
ATA/ATAPI/MFM/RLL support --->; ATA設(shè)備 自定 (偶沒選)
SCSI device support --->; SCSI設(shè)備 自定我有scsi的設(shè)備所以有以下選項(xiàng)
*>; SCSI device support
[*] legacy /proc/scsi/ support
--- SCSI support type (disk, tape, CD-ROM)
*>; SCSI disk support
因?yàn)榕际組PT的SCSI,所以以下都沒選,省略之
Multi-device support (RAID and LVM) --->; 支持RAID和LVM(邏輯卷) 自定
[*] Multiple devices driver support (RAID and LVM)
*>; RAID support
>; Linear (append) mode
*>; RAID-0 (striping) mode
>; RAID-1 (mirroring) mode
>; RAID-10 (mirrored striping) mode (EXPERIMENTAL)
*>; RAID-4/RAID-5 mode
>; RAID-6 mode (EXPERIMENTAL)
*>; Multipath I/O support
>; Faulty test module for MD
*>; Device mapper support
>; Crypt target support
>; Snapshot target (EXPERIMENTAL)
>; Mirror target (EXPERIMENTAL)
>; Zero target (EXPERIMENTAL)
Fusion MPT device support --->; 偶的SCSI是這個(gè),所以選了 還是自定
*>; Fusion MPT (base + ScsiHost) drivers
(40) Maximum number of scatter gather entries
*>; Fusion MPT misc device (ioctl) driver
IEEE 1394 (FireWire) support --->; 自定 (偶沒選)
I2O device support --->; 自定 (偶沒選)
Networking support --->; 網(wǎng)絡(luò)選項(xiàng)
[*] Networking support
Networking options --->;
*>; Packet socket
[ ] Packet socket: mmapped IO
>; Netlink device emulation
*>; Unix domain sockets 如果你有網(wǎng)絡(luò)就選
>; PF_KEY sockets
[*] TCP/IP networking
[ ] IP: multicasting
[ ] IP: advanced router
[ ] IP: kernel level autoconfiguration
>; IP: tunneling
>; IP: GRE tunnels over IP
[ ] IP: ARP daemon support (EXPERIMENTAL)
[*] IP: TCP syncookie support (disabled per default) 能防DOS攻擊,但會(huì)降低一點(diǎn)性能,總的說性價(jià)比不錯(cuò)
>; IP: AH transformation
>; IP: ESP transformation
>; IP: IPComp transformation
>; IP: tunnel transformation
*>; IP: TCP socket monitoring interface
IP: Virtual Server Configuration --->; lvs 支持
>; The IPv6 protocol (EXPERIMENTAL)
[*] Network packet filtering (replaces ipchains) --->; 包過濾省略(知道的自己選,不熟悉的都選上)
以下都沒選,省略
[ ] Amateur Radio support --->;
>; IrDA (infrared) subsystem support --->;
>; Bluetooth subsystem support --->;
[*] Network device support
>; Dummy net driver support 這個(gè)是nis服務(wù)器的吧,不大清楚,沒用過
*>; Bonding driver support 雙網(wǎng)卡綁定的
>; EQL (serial line load balancing) support
>; Universal TUN/TAP device driver support
ARCnet devices --->;
Ethernet (10 or 100Mbit) --->;
Ethernet (1000 Mbit) --->;
>; Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support
>; D-Link DL2000-based Gigabit Ethernet support
>; Intel(R) PRO/1000 Gigabit Ethernet support
>; National Semiconduct DP83820 support
>; Packet Engines Hamachi GNIC-II support
>; Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)
>; Realtek 8169 gigabit ethernet support
>; Marvell Yukon Chipset / SysKonnect SK-98xx Support
*>; Broadcom Tigon3 support
以下都沒選,省略
ISDN subsystem --->;
Telephony Support --->;
Input device support --->;
Character devices --->;
I2C support --->;
Dallas's 1-wire bus --->;
Misc devices --->;
Multimedia devices --->;
Graphics support --->;
Sound --->;
USB support --->;
MMC/SD Card support --->; 以上都沒選,需要的自己選
09.File systems --->; 文件系統(tǒng)
>; Second extended fs support
*>; Ext3 journalling file system support
[ ] Ext3 extended attributes
[*] JBD (ext3) debugging support
>; Reiserfs support
>; JFS filesystem support
>; XFS filesystem support
>; Minix fs support
>; ROM file system support
[ ] Quota support
>; Kernel automounter support
*>; Kernel automounter version 4 support (also supports v3)
CD-ROM/DVD Filesystems --->;
*>; ISO 9660 CDROM file system support
[ ] Microsoft Joliet CDROM extensions
[ ] Transparent decompression extension
>; UDF file system support
DOS/FAT/NT Filesystems --->; floppy要用到的文件格式
*>; MSDOS fs support
*>; VFAT (Windows-95) fs support
(437) Default codepage for FAT (NEW)
(iso8859-1) Default iocharset for FAT (NEW)
>; NTFS file system support
Pseudo filesystems --->;
[*] /proc file system support proc文件系統(tǒng)支持
[ ] /proc/kcore support
[ ] /dev file system support (OBSOLETE)
[ ] /dev/pts Extended Attributes
[*] Virtual memory file system support (former shm fs) 虛擬內(nèi)存支持
[ ] tmpfs Extended Attributes
[ ] HugeTLB file system support
Miscellaneous filesystems --->;
Network File Systems --->;
*>; NFS file system support nfs客戶端支持
[*] Provide NFSv3 client support
[ ] Provide NFSv4 client support (EXPERIMENTAL)
[ ] Allow direct I/O on NFS files (EXPERIMENTAL)
>; NFS server support nfs服務(wù)端支持
>; Secure RPC: Kerberos V mechanism (EXPERIMENTAL)
>; Secure RPC: SPKM3 mechanism (EXPERIMENTAL)
>; SMB file system support (to mount Windows shares etc.) samba支持
>; CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)
>; NCP file system support (to mount NetWare volumes)
>; Coda file system support (advanced network fs)
>; Andrew File System support (AFS) (Experimental)
Partition Types --->;
Native Language Support --->; 自己選
10.Profiling support --->; 沒選
11.Kernel hacking --->; 沒選
12.Security options --->; 沒選
13.Cryptographic options --->; 沒選
14.Library routines --->;
>; CRC-CCITT functions
*>; CRC32 functions
M>; CRC32c (Castagnoli, et al) Cyclic Redundancy-Check
五、編譯安裝
步驟:make -jn(n代表同時(shí)編譯的進(jìn)程,可以加快編譯速度,n由你的配置決定,我的配置用15-25)
make modules_install
make install