免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1224 | 回复: 0
打印 上一主题 下一主题

第三章至第八章 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-08 11:24 |只看该作者 |倒序浏览

l ufs – The UNIX file system in the Solaris OE is based on the
Berkeley fast file system.
l hsfs – The High Sierra file system is a special-purpose file system
developed for use on CD-ROM media.
l pcfs – The PC file system is a UNIX implementation of the disk
operating system (DOS) file allocation table (FAT32) file system. The
pcfs file system allows the Solaris OE to access PC-DOS formatted
file systems. Users can use UNIX commands for direct read and
write access to PC-DOS files.
l udfs – The Universal Disk Format file system is used for optical
storage targeted at DVD and CD-ROM media. The UDF file system
allows universal data exchange and supports read and write
operations.




Distributed File Systems

Distributed file systems provide network access to file system resources.
l NFS – The network file system allows users to share files among
many types of systems on the network. The NFS file system makes
part of a file system on one system appear as though it were part of
the local directory tree.


Pseudo File Systems
Pseudo file systems are memory based. These file systems provide for
better system performance, in addition to providing access to kernel
information and facilities. Pseudo file systems include:
l tmpfs – The temporary file system stores files in memory, which
avoids the overhead of writing to a disk-based file system. The tmpfs
file system is created and destroyed every time the system is
rebooted.
l swapfs – The swap file system is used by the kernel to manage
swap space on disks.
l fdfs – The file descriptor file system provides explicit names for
opening files by using file descriptors (for example, /dev/fd/0,
/dev/fd/1, /dev/fd/2) in the /dev/fd directory.
l procfs – The process file system contains a list of active processes in
the /proc directory. The processes are listed by process number.
Information in this directory is used by commands, such as the ps
command.
l mntfs – The mount file system provides read-only information from
the kernel about locally mounted file systems.




The disk label (VTOC) contains the partition table for the disk. The VTOC
resides in the first disk sector (512-byte blocks).


The bootstrap program (bootblk) resides in the 15 disk sectors
(Sectors 1–15) that follow the VTOC. Only the / (root) file system has an
active boot block.



The superblock resides in the 16 disk sectors (Sectors 16–31) that follow
the boot block. The superblock is a table of information that describes the
file system, including:
l The number of data blocks
l The number of cylinder groups
l The size of a data block and fragment
l A description of the hardware, derived from the label
l The name of the mount point
l File system state flag: clean, stable, active, logging, or unknown

When the file system is created, each cylinder group replicates the
superblock beginning at Sector 32. This replication protects the critical
data in the superblock against catastrophic loss.

Fragmentation is the method used by the ufs file system to allocate disk
space efficiently. Files less than 96 Kbytes in size are stored using
fragmentation.
By default, data blocks can be divided into eight fragments of 1024 bytes
each. Fragments store files and pieces of files smaller than 8192 bytes. For
files larger than 96 Kbytes, fragments are never allocated and full blocks
are exclusively used.


维护文件系统时newfs命令存储1-10%的文件系统空间
The newfs command reserves between 1 and 10 percent of the file system
space for maintenance of the file system. This free space, referred to as
minfree, specifies the amount of space on the slice that is reserved or
held back from regular users. You can use the newfs -m %free
command to preset the percentage of free space when you create a new
file system.


使用fstyp -v查看minfree的空间大小
# fstyp -v /dev/rdsk/c0t0d0s0 | head -10
ufs
magic 11954 format dynamic time Fri Mar 15 07:53:40 2002
sblkno 16 cblkno 24 iblkno 32 dblkno 480
sbsize 3072 cgsize 2048 cgoffset 32 cgmask 0xfffffff0
ncg 17 size 121905 blocks 114000
bsize 8192 shift 13 mask 0xffffe000
fsize 1024 shift 10 mask 0xfffffc00
frag 8 shift 3 fsbtodb 1
minfree 10% maxbpg 2048 optim time
maxcontig 16 rotdelay 0ms rps 90

使用fstyp -m 更改minfree空间的大小
To change the minimum percentage value of free space on an existing file
system, you can use the tunefs -m %free command.

# tunefs -m 1 /dev/rdsk/c1t3d0s0
minimum percentage of free space changes from 10% to 1%

The default local file system type is specified in the /etc/default/fs file
by the line entry LOCAL=fstype.

The first line entry in the /etc/dfs/fstypes file determines the default
remote file system type.
nfs NFS Utilities
autofs AUTOFS Utilities
cachefs CACHEFS Utilities

# mkdir /pcfs
# mount -F pcfs /dev/diskette /pcfs

单用户下
# TERM=sun


# export TERM
fsck检测如下项目
Superblock Consistency
Cylinder Group Block Consistency
Inode Consistency
Data Block Consistency
The lost+found Directory

Reconnecting an Allocated Unreferenced File
** Phase 3 - Check Connectivity
Adjusting a Link Counter
** Phase 4 - Check Reference Counts
Salvaging the Free List
** Phase 5 - Check Cyl groups
CG 0: BAD MAGIC NUMBER
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? y



In the following example, the fsck command checks and repairs the file
system with the force (f) and preen (p) options.
# fsck -o f,p /dev/rdsk/c0t0d0s5
/dev/rdsk/c0t0d0s5: 77 files, 9621 used, 46089 free
/dev/rdsk/c0t0d0s5: (4 frags, 57 blocks, 0.0% fragmentation)
The f option of the fsck command forces a file system check, regardless
of the state of the file system’s superblock state flag.
The p option checks and fixes the file system noninteractively (preen). The
program exits immediately if a problem requiring intervention is found.


** Phase 3 - Check Connectivity
UNREF FILE I=788 OWNER=root MODE=100644
SIZE=19994 MTIME=Jan 18 10:49 1999
RECONNECT? y
A yes response causes the fsck command to save the file to the
lost+found directory. The fsck command references the inode number.
To determine the type of file moved to the lost+found directory by the
fsck command, perform the following steps:
1. List the contents of the file system’s lost+found directory.
# ls /export/home/lost+found
#788
# file /export/home/lost+found/#788
/export/home/lost+found/#788: ascii text
4. If the file is intact and you know where it belongs, you can copy the
file back to its original location in the file system.
# cp /export/home/lost+found/#788 /export/home/user1/report



The following command uses a backup superblock.
# fsck -o b=32 /dev/rdsk/c1t3d0s0
Alternate super block location: 32.
** /dev/rdsk/c1t3d0s0
** Currently Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
171 files, 3762 used, 5984 free (79 frags, 748 blocks, 0.1% fragmentation)
*****FILE SYSTEM WAS MODIFIED*****


To display only a summary of disk usage, perform the command:
# du -sk /opt
550 /opt

The columns represent kilobytes used, number of files, and owner,
respectively.
To display a count of the number of files and space owned by each user
for a specific file system, enter the following:
# quot -f /dev/dsk/c1t0d0s5
/dev/dsk/c1t0d0s5:
134 62 root
103 84 user1
140 32 user9



To stop Volume Management from running on a system temporarily, as
the root user perform the command:
# /etc/init.d/volmgt stop
To restart the Volume Management service, as the root user perform the
command:
# /etc/init.d/volmgt start



The /var/sadm/install/contents file is a complete record of all the
software packages installed on the local system disk


The /var/sadm/pkg
directory maintains a record of all installed packages.



查所有包
# pkginfo -l | more

查包的总数
# pkginfo | wc -l
657

To view information about packages that are located on Solaris 9 Software
2 of 2 CD-ROM, perform the command:
pkginfo -d /cdrom/cdrom0/Solaris_9/Product |more

安装包
# pkgadd -d . SUNWns6m


list the files in the SUNWcarx software package, perform
the command:
# pkgchk -v SUNWcarx
(some output omitted)
/kernel
/kernel/drv
/kernel/drv/sparcv9
/kernel/drv/sparcv9/arp
/var

删除包
# pkgrm SUNWapchr


To verify that the package exists in the spool directory, perform the
command:
# ls -al /var/spool/pkg








# patchadd -p
# showrev -p
查看打过的patch
# ls /var/sadm/patch







# cd /var/tmp
# ftp sunsolve.sun.com
220 sunsolve.Sun.COM FTP server (Version wu-2.6.0(3) Wed Jan 5 15:02:27
MST 2000) ready.
Name (sunsolve:usera): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:yourpassword
230 Guest login ok, access restrictions apply.
ftp> cd /pub/patches
ftp> get Solaris9.PatchReport

# /usr/bin/zcat 105050-01.tar.Z | tar xvf -

# cd /var/tmp
# patchadd 105050-01
# patchrm 105050-01

ok banner
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz), Keyboard Present
OpenBoot 3.31, 128 MB (50 ns) memory installed, Serial #11888271.
Ethernet address 8:0:20:b5:66:8f, Host ID: 80b5668f.

ok help boot
ok help nvramrc
ok help diag
ok help misc


The reset-all command halts the system, clears all buffers and registers,
and performs a software simulated power-off/power-on of the system.



set-default后面加选项,指定哪一项重置
ok set-default parameter-name
For example, to reset the diag-level parameter, perform the command:
ok set-default diag-level
To restore the default NVRAM parameters when you are starting the
system, hold down the Stop-N key sequence while the system power is
turned on.


sifting后面加选项,列出它的命令
ok sifting probe
(f006c954) probe-all (f006c5a0) probe-all (f006c378) probe-ide
(f006c1e8) probe-pci-slot (f006bc8c) probe-scsi
(f006bd78) probe-scsi-all (f0060fe8) probe-pci


ok probe-fcal-all
ok show-devs
/SUNW,UltraSPARC-IIi@0,0
/pci@1f,0
/virtual-memory
/memory@0,10000000
/pci@1f,0/pci@1
/pci@1f,0/pci@1,1
/pci@1f,0/pci@1,1/ide@3
/pci@1f,0/pci@1,1/SUNW,m64B@2
/pci@1f,0/pci@1,1/network@1,1
/pci@1f,0/pci@1,1/ebus@1
/pci@1f,0/pci@1,1/ide@3/cdrom
/pci@1f,0/pci@1,1/ide@3/disk
/pci@1f,0/pci@1,1/ebus@1/SUNW,CS4231@14,200000
/pci@1f,0/pci@1,1/ebus@1/flashprom@10,0
/pci@1f,0/pci@1,1/ebus@1/eeprom@14,0
/pci@1f,0/pci@1/pci@1
/pci@1f,0/pci@1/pci@1/SUNW,isptwo@4
(output truncated)
ok
Root device node
Bus devices and controllers
Device type (SCSI type)
Disk number (logical unit number or LUN)
SCSI target address
/pci@1f,0/pci@1/pci@1/SUNW,isptwo@4/sd@3,0


显示别名
ok devalias
screen /pci@1f,0/pci@1,1/SUNW,m64B@2
net /pci@1f,0/pci@1,1/network@1,1
cdrom /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f
disk /pci@1f,0/pci@1,1/ide@3/disk@0,0
disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0
disk2 /pci@1f,0/pci@1,1/ide@3/disk@2,0
disk1 /pci@1f,0/pci@1,1/ide@3/disk@1,0
disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0
ide /pci@1f,0/pci@1,1/ide@3
floppy /pci@1f,0/pci@1,1/ebus@1/fdthree
ttyb /pci@1f,0/pci@1,1/ebus@1/se:b
ttya /pci@1f,0/pci@1,1/ebus@1/se:a
keyboard! /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8:forcemode
keyboard /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8
mouse /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8
name aliases


先用show-disks显示设备路径,再指定路径起别名
ok show-disks
a) /pci@1f,0/pci@1/scsi@1,1/disk
b) /pci@1f,0/pci@1/scsi@1/disk
c) /pci@1f,0/pci@1,1/ide@3/cdrom
d) /pci@1f,0/pci@1,1/ide@3/disk
e) /pci@1f,0/pci@1,1/ebus@1/fdthree@14,3023f0
q) NO SELECTION
Enter Selection, q to quit: d
/pci@1f,0/pci@1,1/ide@3/disk has been selected.
Type ^Y (Control-Y) to insert it in the command line.
e.g. ok nvalias mydev ^Y
for creating devalias mydev for
/pci@1f,0/pci@1,1/ide@3/disk
ok nvalias mydisk ^y
To paste the device path for the selected disk, press Control-Y on the
command line.
ok nvalias mydisk /pci@1f,0/pci@1,1/ide@3/disk@0,0

(output truncated)


ok setenv boot-device mydisk
boot-device = mydisk
ok boot

取消别名
ok nvunalias mydisk
ok setenv boot-device disk
boot-device = disk
ok reset-all
Resetting ...



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40476/showart_317391.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP