免费注册 查看新帖 |

Chinaunix

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

第二章 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-05 16:51 |只看该作者 |倒序浏览
Controller number Identifies the host bus adapter (HBA), which
           controls communications between the system and
           disk unit. The HBA takes care of sending and
           receiving both commands and data to the device.
           The controller number is assigned in sequential
           order, such as c0, c1, c2, and so on.
Target     number Target numbers, such as t0, t1, t2, and t3,
           correspond to a unique hardware address that is
           assigned to each disk, tape, or CD-ROM. Some
           external disk drives have an address switch
           located on the rear panel. Some internal disks have
           address pins that are jumpered to assign that
           disk’s target number.
Disk       number The disk number is also known as the logical unit
           number (LUN). This number reflects the number
           of disks at the target location.
Slice      number A slice number ranging from 0 to 7.




sdn
where sd is the disk name and n is the number, such as sd0 for the
first SCSI disk device.
dadn
where dad (direct access device) is the disk name and n is the
number, such as dad0 for the first IDE disk device.




The prtconf command lists all possible instances of devices, whether the
device is attached or not attached to the system. To view a list of only
attached devices on the system, perform the command:
# prtconf | grep -v not
System Configuration: Sun Microsystems sun4u
Memory size: 128 Megabytes
System Peripherals (Software Nodes):
SUNW,Ultra-5_10
options, instance #0
pci, instance #0
pci, instance #0
ebus, instance #0
power, instance #0
se, instance #0
su, instance #0
su, instance #1
fdthree, instance #0
network, instance #0
SUNW,m64B, instance #0
ide, instance #0
dad, instance #0
sd, instance #0
pci, instance #1
scsi, instance #0
scsi, instance #1
pseudo, instance #0
#
Note – The grep -v not command is used to omit all lines containing
the word “not” from the output (such as driver not attached).



For example, you can use a boot process to add a new device to a newly
generated /etc/path_to_inst file and to the /dev and /devices
directories.
The following steps reconfigure a system to recognize a newly attached
disk.
1. Create the /reconfigure file. This file causes the system to check for
the presence of any newly installed devices the next time it is
powered on or booted.
# touch /reconfigure
2. Shut down the system by using the init 5 command. This
command safely powers off the system, allowing for addition or
removal of devices. (If the device is already attached to your system,
you can shut down to the ok prompt with the command init 0.)
# init 5
3. Turn off the power to all external devices.
4. Install the peripheral device. Make sure that the address of the
device being added does not conflict with the address of other
devices on the system.
5. Turn on the power to all external devices.
6. Turn on the power to the system. The system boots to the login
window.
7. Verify that the peripheral device has been added by issuing either
the prtconf or format command.
After the disk is recognized by the system, begin the process of defining
disk slices.




devfsadm -c device_class
# devfsadm -c disk -c tape -c audio

devfsadm -i driver_name
# devfsadm -i dad
# devfsadm -i sd
# devfsadm -i st

To print the changes made by the devfsadm command to the /dev and
/devices directories, perform the command:
# devfsadm -v
To invoke cleanup routines that remove unreferenced symbolic links for
devices, perform the command:
# devfsadm -C




#ls -l /dev/dsk/c0t0d0s0
lrwxrwxrwx   1 root     root          46  5月 24日 10:55 c0t0d0s0 ->
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a[/email]


Systems that use PCI bus architectures list path names similar to the
following:
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a[/email]
Systems that use SBus architectures list path names similar to the
following:
[email=../../devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f]../../devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f[/email]
,
[email=800000/sd@3,0:a]800000/sd@3,0:a[/email]



bash-3.00# cd /dev/dsk
bash-3.00# ls
c0t0d0s0  c0t0d0s2  c0t0d0s4  c0t0d0s6  c0t2d0s0  c0t2d0s2  c0t2d0s4  c0t2d0s6
c0t0d0s1  c0t0d0s3  c0t0d0s5  c0t0d0s7  c0t2d0s1  c0t2d0s3  c0t2d0s5  c0t2d0s7
bash-3.00# ls -l c0t0d0s0
lrwxrwxrwx   1 root     root          46  5月 24日 10:55 c0t0d0s0 ->
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a[/email]
bash-3.00# ls -l
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a[/email]
brw-r-----   1 root     sys      136,  8  6月  5日 08:38
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a[/email]
bash-3.00# ls -lL c0t0d0s0
brw-r-----   1 root     sys      136,  8  6月  5日 08:38 c0t0d0s0

Files in this directory are device files. The b character in the left-most
column identifies a block-special device file.
The command ls -lL c0t0d0s0 displays the same information but
shows only the link file name, not the real device file name.


# cd /dev/rdsk
# ls -l c0t0d0s0
lrwxrwxrwx   1 root     root          50  5月 24日 10:55 c0t0d0s0 ->
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw[/email]
bash-3.00# ls -l  
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw[/email]
crw-r-----   1 root     sys      136,  8  6月  5日 13:05
[email=../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw]../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw[/email]
bash-3.00# ls -lL c0t0d0s0
crw-r-----   1 root     sys      136,  8  6月  5日 13:05 c0t0d0s0

Files in this directory are device files. The c character in the left-most
column identifies a character-special device file.
The ls -lL c0t0d0s0 command displays the same information but
shows only the link file name, not the real device file name.


volume table of contents (VTOC)



Figure 2-13 shows the relationship among the label on the disk, the
current label in memory, and the predefined label in the
/etc/format.dat file



To save a disk’s VTOC to a file, perform the command:
# prtvtoc /dev/rdsk/c1t0d0s2 > /vtoc/c1t0d0


Use the following dd command to destroy the disk label. Be certain
to specify the correct disk device name for the of= argument. Enter
all other arguments exactly as listed.
# dd if=/dev/zero of=/dev/rdsk/c1t0d0s2 bs=512 count=1
1+0 records in
1+0 records out



fmthard -s datafile /dev/rdsk/c#t#d#s2
Use the fmthard command to write the desired label information,
previously saved to a datafile back to the disk.
# fmthard -s /vtoc/c1t0d0 /dev/rdsk/c1t0d0s2



13. Modify the partition table. Select Item 1 to use the All Free Hog
option.
partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
14. The partition table appears. Observe the Cylinders and Size columns,
and notice that they are all zero; for example:
Part Tag Flag Cylinders Size Blocks
0 root wm 0 0 (0/0/0) 0
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 1964 1.27GB (1965/0/0) 2672400
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
15. Respond to the prompts to continue the process. Select Slice 4 as the
All Free Hog partition. Use the size listed in Step 6 for Slices 0, 1,
and 3. Set the other slices to Size 0.
Do you wish to continue creating a new partition
table based on above table[yes]? yes
Free Hog partition[6]? 4
Enter size of partition ’0’ [0b, 0c, 0.00mb, 0.00gb]: 300mb
Enter size of partition ’1’ [0b, 0c, 0.00mb, 0.00gb]: 300mb
Enter size of partition ’3’ [0b, 0c, 0.00mb, 0.00gb]: 300mb
Enter size of partition ’5’ [0b, 0c, 0.00mb, 0.00gb]: 0
Enter size of partition ’6’ [0b, 0c, 0.00mb, 0.00gb]: 0
Enter size of partition ’7’ [0b, 0c, 0.00mb, 0.00gb]: 0
At the end of this process, you should have three slices of equal size,
where Slice 4 takes up any extra room if it exists.
指定0 1 3的大小后,将所有剩余空间分给4







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

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP