如何查找与挂载点关联的 HD

Abh*_*nav 8 solaris hard-disk

我在 Sun Solaris 系统上运行。

我想知道以下内容

  1. 如何找到与挂载点关联的 HD?
  2. 如何找到所有可用的 HD(挂载点已使用和未使用的 HD)?
  3. 如何找到与挂载点关联的 HD 的 IO 控制器使用情况?我试图找出与挂载点关联的 HD 的 IO 控制器是否正在处理过多的请求,从而迫使其他一些请求等待。
  4. 如何找到每个可用磁盘上的可用空间?

Tim*_*edy 10

查找挂载点列表,以及每个挂载点使用的磁盘:

查看/etc/vfstab- 该文件显示系统上配置了哪些文件系统,包括在哪些挂载点使用哪些磁盘。此文件不用于 ZFS 文件系统。

# cat /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         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/c1t1d0s0       /dev/rdsk/c1t1d0s0      /jumpserver     ufs     1       yes     -
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -
#/jumpserver/install/SunOS/5.10/i386/u4/boot - /tftpboot/I86PC.Solaris_10-4 lofs - yes ro
#/jumpserver/install/SunOS/5.10/i386/u7/boot - /tftpboot/I86PC.Solaris_10-7 lofs - yes ro
/jumpserver/install/SunOS/5.10/i386/u9/boot - /tftpboot/I86PC.Solaris_10-9 lofs - yes ro
/jumpserver/install/SunOS/5.10/i386/u7/boot - /tftpboot/I86PC.Solaris_10-10 lofs - yes ro
Run Code Online (Sandbox Code Playgroud)

运行命令zpool status- 此命令将打印系统上配置和导入的任何 zpool 的列表,并列出每个池中使用的磁盘,以及池的配置是什么,就被镜像而言,或 raidz 等。

# zpool status
  pool: rpool
 state: ONLINE
 scrub: none requested
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c0t0d0s0  ONLINE       0     0     0
            c0t1d0s0  ONLINE       0     0     0

errors: No known data errors
Run Code Online (Sandbox Code Playgroud)

运行该命令mount -p- 这将显示安装在服务器上的任何文件系统的vfstab 样式列表。这样做的重要性在于,它可以识别已挂载但从未添加到 /etc/vfstab 的文件系统,或对未持久化的挂载的更改。

# mount -p
/dev/dsk/c1t0d0s0 - / ufs - no rw,intr,largefiles,logging,xattr,onerror=panic
/devices - /devices devfs - no 
ctfs - /system/contract ctfs - no 
proc - /proc proc - no 
mnttab - /etc/mnttab mntfs - no 
swap - /etc/svc/volatile tmpfs - no xattr
objfs - /system/object objfs - no 
/usr/lib/libc/libc_hwcap1.so.1 - /lib/libc.so.1 lofs - no 
fd - /dev/fd fd - no rw
swap - /tmp tmpfs - no xattr
swap - /var/run tmpfs - no xattr
/dev/dsk/c1t1d0s0 - /jumpserver ufs - no rw,intr,largefiles,logging,xattr,onerror=panic
/hgfs - /hgfs vmhgfs - no 
/dev/lofi/1 - /mnt/s10u9x86 hsfs - no ro,noglobal,maplcase,rr,traildot
/dev/lofi/2 - /mnt/s10u9x86ccd hsfs - no ro,noglobal,maplcase,rr,traildot
/dev/lofi/3 - /mnt/s10u9 hsfs - no ro,noglobal,maplcase,rr,traildot
/jumpserver/install/SunOS/5.10/i386/u7/boot - /tftpboot/I86PC.Solaris_10-10 lofs - no ro
Run Code Online (Sandbox Code Playgroud)

运行命令cfgadm -al- 这将为您提供系统上所有控制器的列表,以及连接到这些控制器的所有设备。

# cfgadm -al
Ap_Id                          Type         Receptacle   Occupant     Condition
c1                             scsi-bus     connected    configured   unknown
c1::dsk/c1t0d0                 disk         connected    configured   unknown
c1::dsk/c1t1d0                 disk         connected    configured   unknown
Run Code Online (Sandbox Code Playgroud)

运行命令format- 查看系统中安装的所有磁盘的详细信息,这些磁盘不是由cfgadm -al. 特别是,您需要注意子命令verifyinquiry.

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <DEFAULT cyl 60797 alt 2 hd 255 sec 252>
          /pci@0,0/pci8086,340b@4/pci1028,1f10@0/sd@0,0
       1. c0t1d0 <DEFAULT cyl 60797 alt 2 hd 255 sec 252>
          /pci@0,0/pci8086,340b@4/pci1028,1f10@0/sd@1,0
       2. c0t2d0 <DEFAULT cyl 60797 alt 2 hd 255 sec 252>
          /pci@0,0/pci8086,340b@4/pci1028,1f10@0/sd@2,0
       3. c0t3d0 <DEFAULT cyl 60478 alt 2 hd 255 sec 252>
          /pci@0,0/pci8086,340b@4/pci1028,1f10@0/sd@3,0
Specify disk (enter its number): 
Run Code Online (Sandbox Code Playgroud)

例如,0在上面的菜单中选择磁盘,然后运行inquiry

format> inquiry
Vendor:   ATA     
Product:  Hitachi HUA72202
Revision: A3HA
Run Code Online (Sandbox Code Playgroud)

verify

format> verify

Primary label contents:

Volume name = <        >
ascii name  = <DEFAULT cyl 60797 alt 2 hd 255 sec 252>
pcyl        = 60799
ncyl        = 60797
acyl        =    2
bcyl        =    0
nhead       =  255
nsect       =  252
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 - 60796        1.82TB    (60796/0/0) 3906750960
  1 unassigned    wm       0                0         (0/0/0)              0
  2     backup    wm       0 - 60796        1.82TB    (60797/0/0) 3906815220
  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 unassigned    wm       0                0         (0/0/0)              0
  7 unassigned    wm       0                0         (0/0/0)              0
  8       boot    wu       0 -     0       31.38MB    (1/0/0)          64260
  9 unassigned    wm       0                0         (0/0/0)              0
Run Code Online (Sandbox Code Playgroud)

现在您有了品牌和型号以及分区表。据此,结合先前命令中收集的信息,您可以将可用磁盘/分区(在 solaris 中称为切片)及其相应文件系统(如果有)的映射放在一起。您还将知道哪些切片未使用(可用空间)。

至于哪些磁盘忙,这就是命令iostat的用途:

# iostat -zxnM 5
                extended device statistics              
r/s    w/s   Mr/s   Mw/s wait actv wsvc_t asvc_t  %w  %b device
0.0   29.3    0.0    0.5  0.0  2.2    0.0   76.7   0  33 c8t0d0
0.0   29.3    0.0    0.5  0.0  2.2    0.0   73.9   0  32 c8t1d0
Run Code Online (Sandbox Code Playgroud)

在哪里:

r/s - Reads per second
w/s - Writes per second
Mr/s - Mbytes read per second
Mw/s - Mbytes written per second
wait - Average number of transactions that are waiting for service (queue length)
actv - Average number of transactions that are actively being serviced
svc_t - Average service time, in milliseconds
%w - Percentage of time that the queue is not empty
Run Code Online (Sandbox Code Playgroud)

一旦您知道哪些磁盘存在于哪些磁盘上,您就可以开始确定导致 I/O 的应用程序,并从那里深入挖掘原因。

在 Google 上搜索solaris iostat brendan gregg,您会找到一些关于调查 I/O 问题的好信息,包括指向K9ToolkitDTraceToolkit 的链接,它们分别适用于 Solaris < 10 和 Solaris 10+,它们可以真正简化调查输入/输出问题。


Nik*_*ley 0

是否iostat -En为您提供了哪些可用的硬盘以及正在使用的硬盘?

df -h /path/to/mountpoint/.通常会打印您正在寻找的所有内容,它会打印挂载点下正在使用的硬盘/设备,并给出幕后可用的可用空间/可用块的数量。