3. History
• Unix (very expensive) Minix (for students)
• Enter Linus Torvalds – Linux Kernel
• With GNU’s Richard Stallman – Bash Shell
• Linux Kernel + Shell = GNU/Linux
• “Linux is obsolete” - Andrew Tanenbaum, 1992
– Monolithic kernel
– Multithreading file system is useless
• Cost to rebuild: $1.4 Billion = 6 million lines of
code
• In 87% of Servers and supercomputers
• The Open Source Initiative
4. Introduction
• Cheap
• Huge community
• Open source
• Presence of mind
• Jobs
• Better understanding
5. Introduction
• Monolithic Kernel
• bash, sh, ksh, csh - CLI
• X Windows + Gnome, KDE
• Ext2, ext3, ext4 File System
• Everything is a file
• Multi-user – Built to last
5
6. Linux Kernel
• Monolithic Kernel – Resource Manager
for process, memory or hardware.
• Process – Threads, POSIX
• Memory – page size, swapping
• Virtual file system
• Every major protocols supported in
Linux – SCTP, TCP, VPN, IP Tunnel etc
Anatomy of Linux Kernel: http://www.ibm.com/developerworks/linux/library/l-linux-kernel/?
S_TACT=105AGX59&S_CMP=GR&ca=dgr-lnxw07LKernalAnatomy
6
7. Bourne-again shell
There are 10 types of people in this world, who understand binary and
those who don’t.
• Macro processor for commands– The main port of entry
• Default on Linux and Mac OS X
• Interactive and Shell scripting
• Shell script == .bat files (but way more powerful and easier!)
• It’s interpreted - shell reads each line and acts on it immediately
• Automate task, create own command, play with your box!
7
8. Distro & Installation
Packages: for example to each Distro
debian: dist
mandrake: Mandrake
redhat: RedHat
suse: suse
fedora: Fedora
images: image of Linux (Kernel modules, installation process/boot,
system recovery
dosutils: some tools for the installation from DOS
8
11. File System & Partitioning
A Sample of Paritioning:
/boot 100M
SWAP 512M
/ 2000M
/usr 6000M
/home 1000M
/tmp 2000M
/var remain space
Moreover, Multiple OS/Boot Supported by Linux (LILO – LInux boot
LOader, ...)
11
12. File System & Devices
hda1: first partition of first IDE drive
hda2: second partition of first IDE drive
sdc3: third partition of the third SCSI drive
IDE: 4 main partitions & 1 of them could be extended one (allow sub-par).
In Linux: max 64 IDE partitions & 16 SCSI
12
18. YP New System
MS Servers
(DB servers, …)
Ext: 190.60.21.91
172.17.17.96
Ext: 190.60.21.89
172.17.17.98 Yepex ME
Production 1
172.17.17.92
Yepex ME
Production 2
172.17.17.102 172.17.17.97
Ext: 190.60.21.92
Ext: 190.60.21.93
172.17.17.95
172.17.17.99
Ext: 190.60.21.90
Yepex ME Staging
Ext: 190.60.21.88
18
Linux supports numerous file system types Ext2: This is like UNIX file system. It has the concepts of blocks, inodes and directories. Ext3: It is ext2 filesystem enhanced with journalling capabilities. Journalling allows fast file system recovery. Supports POSIX ACL (Access Control Lists). (POSIX: Portable OS Interface) Isofs (iso9660): Used by CDROM file system. Sysfs: It is a ram-based filesystem initially based on ramfs. It is use to exporting kernel objects so that end user can use it easily. Procfs: The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change certain kernel parameters at runtime using sysctl command. For example you can find out cpuinfo with following command “cat /proc/cpuinfo” NFS: Network file system allows many users or systems to share the same files by using a client/server methodology. NFS allows sharing all of the above file system. Linux also supports Microsoft NTFS, vfat, and many other file systems. See Linux kernel source tree Documentation/filesystem directory for list of all supported filesystem.
/bin và /sbin Chứa những file cần thiết cho quá trình khởi động và những lệnh thiết yếu để duy trì hệ thống. /dev Chứa các định danh ánh xạ của thiết bị hoặc những file đặc biệt. /etc Chứa các file cấu hình của hệ thống và nhiều chương trình tiện ích. /lib Chứa các thư viện dùng chung cho các lệnh nằm trong /bin và /sbin. Và thư mục này cũng chứa các module của nhân. /mnt hoặc /media Mount point mặc định cho những hệ thống file kết nối bên ngoài. /proc Lưu các thông tin của nhân, chỉ có thể ghi được nội dung trong thư mục /proc/sys . /boot Chứa nhân Linux để khởi động và các file system maps cũng như các file khởi động giai đoạn hai. /home ( tùy chọn ) Thư mục dành cho người dùng khác root. Thông tin khởi tạo thư mục mặc định của người dùng được đặt trong /etc/skel/ /root ( tùy chọn ) Thư mục mặc định của người dùng root. /tmp Thư mục chứa các file tạm thời. /usr Thư mục chứa những file cố định hoặc quan trọng để phục vụ tất cả người dùng. /usr/local hoặc /opt (tùy chọn) Thư mục chứa các phần mềm cài thêm. /var/www , /var/ftp/ hoặc /srv (Suse) Thư mục chứa thông tin của các dịnh vụ WEB hay FTP. /var Thư mục chứa các thông tin hay thay đổi như: spool và log