OS/Linux

RHEL4 에서 reboot하지않고 scsi 디스크인식하기 (VMWare)

에몽이ㅋ 2012. 3. 26. 00:32
검색경로 : google.com에서  rhel4 add hard without reboot  로 검색
참조사이트 http://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.html 

솔라리스: devfsadm -v 명령어와 같이
reboot 하지 않고도 디스크를 인식할 수 있는 방법이 RHEL4에서도 있습니다.!

대망의 명령어는
# echo "- - -" > /sys/class/scsi_host/host#/scan
입니다.
( host#의 부분은 SCSI host bus adapter번호입니다.(SCSI 0:x 은 host0, SCSI1:x는 host1 ...) )



실습:

하드 추가하기 이전
[root@server15 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         650     5116702+  83  Linux
/dev/sda3             651         911     2096482+  82  Linux swap
/dev/sda4             912        2610    13647217+   5  Extended
/dev/sda5             912        1038     1020096   83  Linux
/dev/sda6            1039        2610    12627058+  83  Linux

추가 후 위 명령어 실행 후 확인
[root@server15 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@server15 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         650     5116702+  83  Linux
/dev/sda3             651         911     2096482+  82  Linux swap
/dev/sda4             912        2610    13647217+   5  Extended
/dev/sda5             912        1038     1020096   83  Linux
/dev/sda6            1039        2610    12627058+  83  Linux

Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

/dev/sdb가 인식되었음을 확인하세요~