본문 바로가기
IT 지식정리/운영체제

[리눅스] Linux 에서 연결된 스토리지,scsi, tape 장비들 확인하기 2015. 3. 7.

by G. Hong 2017. 11. 4.
728x90
반응형

몇일 전에는 솔라리스에서 연결된 장비들을 확인하는 법을 올렸었습니다.

이번에는 리눅스에서 연결된 스토리지 장비들을 확인하는 법을 알아보겠습니다.


1. cat /proc/scsi/scsi 

/proc/scsi/scsi 을 통해서 연결되고 인식되는 장비들을 확인할 수 있습니다.

#cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: MATSHITA Model: CD-RW CW-8124 Rev: DZ13
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: Ultrium 3-SCSI Rev: M6BS
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi3 Channel: 00 Id: 01 Lun: 00
Vendor: HP Model: Ultrium 3-SCSI Rev: M6BS
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi4 Channel: 00 Id: 00 Lun: 00
Vendor: FUJITSU Model: MAV2073RCSUN72G Rev: 0301
Type: Direct-Access ANSI SCSI revision: 04

2. sg_map

sg_map에 관한 설명은 아래와 같습니다. 실행시에 아래처럼 scsi장비들의 맵핑정보를 볼 수 있습니다.
sg_map - displays mapping between linux sg and other SCSI devices
#sg_map -x
/dev/sg0 0 0 0 0 5 /dev/scd0
/dev/sg1 3 0 0 0 1 /dev/nst0
/dev/sg2 3 0 1 0 1 /dev/nst1
/dev/sg3 4 0 0 0 0 /dev/sda

3. lsmod
lsmod - program to show the status of modules in the Linux Kernel
#lsmod | egrep -i "st|sg"
stp 2256 1 garp
llc 5608 2 garp,stp
osst 55434 0
st 38894 0
sg 30441 0

4. mt

mt 커맨드를 통해서 tape장비의 상태를 확인할 수 있습니다..mt를 실행하기 위해서는 mt-st 패키지설치가 필요합니다.
#mt -f /dev/sg1 status
-bash: mt: command not found
#mt
-bash: mt: command not found

#yum install mt-st
Loaded plugins: refresh-packagekit, security
public_ol6_UEKR3_latest | 1.2 kB 00:00
...생략...
Installed:
mt-st.x86_64 0:1.1-5.el6

Complete!

mt커맨드는 tape drive를 사용하기 위한 커맨드입니다.
mt - control magnetic tape drive operation


먼저 상태확인을 하기전에 drive를 사용하려 했는데, 실패하였습니다.
#tar -czf /dev/nst0 /test/gh
tar: Removing leading `/' from member names
tar (child): /dev/nst0: Cannot open: No medium found
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now


status 확인을 하면 아래와 같이 나옵니다.
#mt -f /dev/st0 status
SCSI 2 tape drive:
File number=-1, block number=-1, partition=0.
Tape block size 0 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (50000):
DR_OPEN IM_REP_EN
#mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=-1, block number=-1, partition=0.
Tape block size 0 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (50000):
DR_OPEN IM_REP_EN

5. mtx

mtx역시 mtx패키지가 설치가 되어야 사용할 수 있는 커맨드입니다. mtx는 라이브러리(changer)를 컨트롤하기 위한 커맨드입니다.
#mtx
-bash: mtx: command not found
#yum install mtx
Loaded plugins: refresh-packagekit, security
Setting up Install Process
...생략...
Installed:
mtx.x86_64 0:1.3.12-5.el6

Complete!

설치를 하여도 서버에 연결된 라이브러리(changer)가 없어서 아래와 같이 나옵니다.

#mtx inquiry
cannot open SCSI device '/dev/changer' - No such file or directory
#mtx status
cannot open SCSI device '/dev/changer' - No such file or directory

다른 서버에서 시도를 해봅니다. /proc/scsi/scsi 를 통해 L180이 changer로 잡혀있는 것을 확인합니다.
#cat /proc/scsi/scsi
Attached devices:
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: Ultrium 3-SCSI Rev: M66S
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi6 Channel: 00 Id: 00 Lun: 00
Vendor: SEAGATE Model: ST973401LSUN72G Rev: 0556
Type: Direct-Access ANSI SCSI revision: 03
Host: scsi3 Channel: 00 Id: 07 Lun: 00
Vendor: STK Model: L180 Rev: 0318
Type: Medium Changer ANSI SCSI revision: 03

mtx를 통해 상태를 확인합니다.
#mtx inquiry
Product Type: Medium Changer
Vendor ID: 'STK '
Product ID: 'L180 '
Revision: '0318'
Attached Changer API: No

#mtx status
Storage Changer /dev/changer:3 Drives, 94 Slots ( 10 Import/Export )
Data Transfer Element 0:Empty
Data Transfer Element 1:Empty
Data Transfer Element 2:Empty
Storage Element 1:Empty
...생략...
Storage Element 91 IMPORT/EXPORT:Empty
Storage Element 92 IMPORT/EXPORT:Empty
Storage Element 93 IMPORT/EXPORT:Empty
Storage Element 94 IMPORT/EXPORT:Empty 

728x90
반응형