1.RHEL4安装
1.1)四种安装方式:floppy,hard disk, cd-rom,PXE
上课时采用PXE安装方式.
进BIOS--->高级设置--->第一个引导选NEWWORK
有三种方式支持NETWORK安装:NFS,FTP,HTTP
NFS SITE NAME: 192.168.0.254
FTP SITE NAME: 192.168.0.254
NFS DIR : /var/ftp/pub/RHEL4
FTP DIR : /pub/RHEL4
采用定制安装方式,在安装过程中,注意要求,合理分区大小,
/ 500M
/usr 2G
/var 2G
/boot 100M
/swap 2xMEMORY
(在安装过程中,可按CTRL+ALT+F2到字符模式下查内存,CTRL+ALT+F7则返回)
2.分区 fdisk (n,p,l,d,q,w,m)
[root@clone root]# fdisk /dev/sdb
The number of cylinders for this disk is set to 17816.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
新建3个分区
----------------------------------------------------------------------------
n 回车 +100M
n 回车 +100M
n 回车 +100M
t t参数,就是修改分区系统ID(有如下支持的ID)
----------------------------------------------------------------------------
Command (m for help): l
0 Empty 1b Hidden Win95 FA 64 Novell Netware bb Boot Wizard hid
1 FAT12 1c Hidden Win95 FA 65 Novell Netware c1 DRDOS/sec (FAT-
2 XENIX root 1e Hidden Win95 FA 70 DiskSecure Mult c4 DRDOS/sec (FAT-
3 XENIX usr 24 NEC DOS 75 PC/IX c6 DRDOS/sec (FAT-
4 FAT16 <32M 39 Plan 9 80 Old Minix c7 Syrinx
5 Extended 3c PartitionMagic 81 Minix / old Lin da Non-FS data
6 FAT16 40 Venix 80286 82 Linux swap db CP/M / CTOS / .
7 HPFS/NTFS 41 PPC PReP Boot 83 Linux de Dell Utility
8 AIX 42 SFS 84 OS/2 hidden C: df BootIt
9 AIX bootable 4d QNX4.x 85 Linux extended e1 DOS access
a OS/2 Boot Manag 4e QNX4.x 2nd part 86 NTFS volume set e3 DOS R/O
b Win95 FAT32 4f QNX4.x 3rd part 87 NTFS volume set e4 SpeedStor
c Win95 FAT32 (LB 50 OnTrack DM 8e Linux LVM eb BeOS fs
e Win95 FAT16 (LB 51 OnTrack DM6 Aux 93 Amoeba ee EFI GPT
f Win95 Ext'd (LB 52 CP/M 94 Amoeba BBT ef EFI (FAT-12/16/
10 OPUS 53 OnTrack DM6 Aux 9f BSD/OS f1 SpeedStor
11 Hidden FAT12 54 OnTrackDM6 a0 IBM Thinkpad hi f4 SpeedStor
12 Compaq diagnost 55 EZ-Drive a5 BSD/386 f2 DOS secondary
14 Hidden FAT16 <3 56 Golden Bow a6 OpenBSD fd Linux raid auto
16 Hidden FAT16 5c Priam Edisk a7 NeXTSTEP fe LANstep
17 Hidden HPFS/NTF 61 SpeedStor b7 BSDI fs ff BBT
18 AST SmartSleep 63 GNU HURD or Sys b8 BSDI swap
---------------------------------------------------------------------------
3.格式化 mkfs.ext3 (mkfs -t ext3)
3.1)mkfs可以格式化不同类型的文件系统.
[root@clone root]# mkfs.
mkfs.bfs mkfs.minix mkfs.reiserfs
mkfs.ext2 mkfs.msdos mkfs.vfat
3.2)在格式化时,注意inode与block的关系,一般情况下,inode是大于block;如果小于的话会导致很多block无法使用,有时候会有这种现象:
如果inode:block=1:2 ,那么一个40G的硬盘,现在上新建20G的小文件(比如:1k),当文件容量超过20G时,提示空间不够,.也就是说有很多(50%)block浪费. tune2fs -l /dev/sdb3查看相关inode与block信息.
3.3)在这种情况下,我们可指定为1:1
[root@clone root]# mkfs -t ext3 -b 1024 -i 1024 /dev/sdb3
4.挂载(另外也讲述 /etc/fstab中的相关列的含义)
设备必须挂载才能访问.
4.1) mount device dir
mount /dev/sdb3 /mp3 -o ro,noexec
4.2) mount label dir
先建卷标,然后挂载
e2label /dev/sdb3 /MP3
(参见:mke2fs -L /MP3 /dev/sdb3
tune2fs -L /MP3 /dev/sdb3 )
mount /MP3 /mp3
4.3) 在不umount的前提下挂载
mount /mp3 -o remount,ro,noexec
5.创建卷标
见4.2)
6.软RAID配置(此处用三个分区模拟三个硬盘)
6.1)创建三个相同的分区
6.2)修改分区system ID (t参数)
6.3)配置RAIDCREATE MODE
Usage: mdadm --create device --chunk=X --level=Y --raid-devices=Z devices
RAID 0 :
mdadm --create /dev/md0 --levle=0 --raid-devices=2 /dev/sdb[3-4]
RAID 1 :(利用率为1/2)
mdadm --create /dev/md0 --levle=1 --raid-devices=2 /dev/sdb[3-4]
RAID 5 :(利用率为[n-1]/n)
mdadm --create /dev/md0 --levle=5 --raid-devices=3 /dev/sdb[3-5]
若在配置过程中出现错误,则可用 mdadm --stop /dev/md0 停用此设备
more /proc/mdstat 显示RAID信息
7.X-windows相关知识点
>当x-client中某个窗口死掉,则可用xkill杀掉;
>当x-server死掉,则用ctrl+alt+backspace重建;
>alt+mouse(左键)移动窗口;
>DISPLAY是X的环境变量,若在文本方式下使用x-client,则必须导入 export DISPLAY
先在X下查DISPLAY的值,然后在文本方式下 export DISPLAY=:1.0
>xhost + 允许任何终端访问服务器;>xhost - 不允许任何终端访问服务器;
>凡远程访问时,tty均是 /dev/pts/x (x是随机生成的);
>/etc/X11/xinit/xinitrc.d/ 下可用户自定义运行xclient (要加"&")
>.xinitrc若存在(脚本后不能加"&"),则etc/X11/xinit/xinitrc.d/脚本不执行.
X无法启动可能的原因:
1>X没有配置
system-config-display
2>xfs没有配置
安装了,但没启用服务, service xfs start
没有安装, rpm -Uvh packages,并启用服务
3>/tmp目录权限问题
4>磁盘空间问题
-"/"100%,(/tmp没有单独分区)
-/home 100%
-用户配额满