1、solaris10常用命令实例分析2solaris10常用命令实例分析(2) 学习sa200的总结4)mount 和umount分区接上一个例子:#cd /#mkdir u01#mount /dev/dsk/c3t50060E8000542270d4s2 /u01#umount /u01要想在系统启动的时候自动mount分区,要把mount的文件路径添加到/etc/vfstabroots10one # vi vfstabvfstab 13 lines, 499 characters #device device mount FS fsck mount mount#to mount to fsc
2、k point type pass at boot options#fd - /dev/fd fd - no -/proc - /proc proc - no -/dev/dsk/c1t0d0s1 - - swap - no -/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no -/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /u0 ufs 2 yes -/dev/dsk/c3t50060E8000542270d4s2 /dev/rdsk/c3t50060E8000542270d4s2 /u01 ufs 3 yes -/d
3、evices - /devices devfs - no -ctfs - /system/contract ctfs - no -objfs - /system/object objfs - no -swap - /tmp tmpfs - yes -5)添加新的硬件时的几条常用命令 a)boot -r b)reboot - -r c)touch /reconfigure d)devfsadm6)其他常用的磁盘查看命令 a) df -h df -a df -k b)prtvtoc #prtvtoc /dev/rdsk/c1t0d0s3* /dev/rdsk/c1t0d0s3 partition
4、map* Dimensions:* 512 bytes/sector* 107 sectors/track* 27 tracks/cylinder* 2889 sectors/cylinder* 24622 cylinders* 24620 accessible cylinders* Flags:* 1: unmountable* 10: read-only* First Sector Last* Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 0 47105145 47105144 / 1 3 01 4710514
5、5 6341355 53446499 2 5 00 0 71127180 71127179 3 0 00 53446500 17409114 70855613 /u0 7 0 00 70855614 271566 71127179c)查看mnttab文件 和vfstab 文件roottestone # more /etc/mnttab/dev/dsk/c1t0d0s0 / ufs rw,intr,largefiles,logging,xattr,onerror=panic,dev=1d80008 1147717207/devices /devices devfs dev=4e00000 114
6、7717188ctfs /system/contract ctfs dev=4e40001 1147717188proc /proc proc dev=4e80000 1147717188mnttab /etc/mnttab mntfs dev=4ec0001 1147717188swap /etc/svc/volatile tmpfs xattr,dev=4f00001 1147717188objfs /system/object objfs dev=4f40001 1147717188fd /dev/fd fd rw,dev=50c0001 1147717208swap /tmp tmpf
7、s xattr,dev=4f00002 1147717208swap /var/run tmpfs xattr,dev=4f00003 1147717208/dev/dsk/c1t0d0s3 /u01 ufs rw,intr,largefiles,logging,xattr,onerror=panic,dev=1d8000b 1147717212-hosts /net autofs nosuid,indirect,ignore,nobrowse,dev=5180001 1147717218auto_home /home autofs indirect,ignore,nobrowse,dev=5
8、180002 1147717218s10one:vold(pid622) /vol nfs ignore,noquota,dev=5140001 1147717280四:系统的启动和关闭 1)系统的引导 引导系统的方法和windows 等一样:光盘,网络等2)系统的内核 有32位,64位等 3)修改内核a)参数#vi /etc/system set parameter=value修改/etc/system文件可修改内核配置参数。该文件通过vi修改和用more看。此文件可设置:利用moddir变量来修改在引导时被装入模块的查询路径。利用exclude变量来决定永不调入的模块,即使引用到此模块。利
9、用rootdev变量来决定可选root设备。利用set variable=value来替换缺省内核参数。注意:1、修改内核参数前最好做备份。2、修改内核参数后,需要重新启动系统。例如可以用forceload命令强制载入一些系统moduleforceload: drv/foo也可以设置一些系统变量例如pt_cnt定义可配置的pseudo-ttys (default is 48)的数目(系统的内核参数),如用户可以打开的最大文件句柄数。set pt_cnt=100set npty=100set sadcnt=200set nautopush=100b)设置模块变量#vi /etc/system s
10、et module_name:variable=value1、备份原/etc/system文件。#cp /etc/system /etc/system.gen2、修改/etc/system文件,增加内核变量。Set maxusers=483、重新引导系统。注意:修改此文件时必须小心,因为它改变了内核的操作maxusers内核变量确定系统上最多用户个数。 默认情况下,该值近似为系统物理内存的Mbyts数,我们可以根据 需要重新设置,以反映一个系统的实际负载。但maxusers的值不应 设置得太高,系统允许的最大值为2048,可以通过修改/etc/system 实现。下面有有一个实例:它参照set
11、 msgsys:msginfo_msgmax=4096set msgsys:msginfo_msgmnb=360000set msgsys:msginfo_msgmni=3774set msgsys:msginfo_msgtql=2500set semsys:seminfo_semaem=16384set semsys:seminfo_semmni=554set semsys:seminfo_semmnu=1042set semsys:seminfo_semmns=1024set semsys:seminfo_semopm=12set semsys:seminfo_semmsl=256set
12、semsys:seminfo_semume=42set semsys:seminfo_semvmx=32767set shmsys:shminfo_shmmax=4294967295set shmsys:shminfo_shmmin=1set rlim_fd_max=4117set rlim_fd_cur=1024set noexec_user_stack=118set shmsys:shminfo_shmseg=19set shmsys:shminfo_shmmni=2004)查看内核参数的命令a)sysdefroots10one # sysedf* Hostid* 8308d98e* su
13、n4u Configuration* Devices*scsi_vhci, instance #0packages (driver not attached) SUNW,builtin-drivers (driver not attached) deblocker (driver not attached) disk-label (driver not attached) terminal-emulator (driver not attached) SUNW,debug (driver not attached) dropins (driver not attached) kbd-trans
14、lator (driver not attached) obp-tftp (driver not attached) SUNW,i2c-ram-device (driver not attached) SUNW,fru-device (driver not attached) ufs-file-system (driver not attached)chosen (driver not attached)openprom (driver not attached) client-services (driver not attached)options, instance #0aliases
15、(driver not attached)memory (driver not attached)virtual-memory (driver not attached)SUNW,UltraSPARC-III, instance #0 (driver not attached)memory-controller, instance #0SUNW,UltraSPARC-III, instance #1 (driver not attached)memory-controller, instance #1pci, instance #0 scsi, instance #0 disk (driver
16、 not attached) tape (driver not attached) sd, instance #0 (driver not attached) sd, instance #1 (driver not attached) sd, instance #2 (driver not attached) sd, instance #3 (driver not attached) sd, instance #4 (driver not attached) sd, instance #5 (driver not attached) sd, instance #6 sd, instance #
17、7 (driver not attached) sd, instance #8 (driver not attached) sd, instance #9 (driver not attached) sd, instance #10 (driver not attached) sd, instance #11 (driver not attached) sd, instance #12 (driver not attached) sd, instance #13 (driver not attached) sd, instance #14 (driver not attached) st, i
18、nstance #0 (driver not attached) st, instance #1 (driver not attached) st, instance #2 (driver not attached) st, instance #3 (driver not attached) st, instance #4 (driver not attached) st, instance #5 (driver not attached) st, instance #6 (driver not attached) ses, instance #0 (driver not attached)
19、ses, instance #1 (driver not attached) ses, instance #2 (driver not attached) ses, instance #3 (driver not attached) ses, instance #4 (driver not attached) ses, instance #5 (driver not attached) ses, instance #6 (driver not attached) ses, instance #7 (driver not attached) ses, instance #8 (driver no
20、t attached) ses, instance #9 (driver not attached) ses, instance #10 (driver not attached) ses, instance #11 (driver not attached) ses, instance #12 (driver not attached) ses, instance #13 (driver not attached) ses, instance #14 (driver not attached) ses, instance #15 (driver not attached) scsi (dri
21、ver not attached) disk (driver not attached) tape (driver not attached) scsi (driver not attached) disk (driver not attached) tape (driver not attached) TSI,gfxp, instance #0 (driver not attached)pci, instance #1 network (driver not attached) SUNW,qlc, instance #0 fp (driver not attached) disk (driv
22、er not attached) fp, instance #1 ssd, instance #1 ssd, instance #0 ssd, instance #5 ses (driver not attached)pci, instance #2 ebus, instance #0 flashprom (driver not attached) bbc (driver not attached) power (driver not attached) i2c, instance #0 fru, instance #0 (driver not attached) fru, instance
23、#1 (driver not attached) fru, instance #2 (driver not attached) fru, instance #3 (driver not attached) fru, instance #4 (driver not attached) fru, instance #5 (driver not attached) fru, instance #6 (driver not attached) fru, instance #7 (driver not attached) fru, instance #8 (driver not attached) fru, instance #9 (driver not attached) fru, instance #10 (driver not attached) fru, instance #11 (driver not attached) fru, instance #12 (driver not attached) fru, instance #13 (driver not attached) fru, instance #14 (driver not attached) temperature (driver not attached)