1. volname 설정할 디스크 확인
[root@rinodb1:~:#] format < /dev/null | grep FUJITSU
2. 디스크 리스트 생성
[root@rinodb1:~:#] format < /dev/null | grep FUJITSU | grep 1278 | awk '{print $2}' > disk_list
[root@rinodb1:~:#] cat disk_list
[root@rinodb1:~:#] cat disk_list
3. volname 적용 스크립트 생성
[root@rinodb1:~:#] vi disk_volname.sh
#!/bin/bash
index=0
for disk in `cat /root/disk_list`;do
if [ "$index" == "0" ]; then
volname="CRS00`expr $index + 1`"
else
volname="ACFS00${index}"
fi
fmthard -n ${volname} /dev/rdsk/${disk}s2
if [ $? = '0' ]; then
echo "Changed volname : ${disk} ${volname}"
else
echo "Failed change volname : ${disk}"
fi
index=`expr ${index} + 1`
done
- 스크립트는 원하는 내용으로 변경
4. 스크립트 실행
[root@rinodb1:~:#] sh disk_volname.sh
fmthard: New volume table of contents now in place.
volname c1d4 CRS001
fmthard: New volume table of contents now in place.
volname c1d5 ACFS001
fmthard: New volume table of contents now in place.
volname c1d6 ACFS002
fmthard: New volume table of contents now in place.
volname c1d7 ACFS003
fmthard: New volume table of contents now in place.
volname c1d8 ACFS004
fmthard: New volume table of contents now in place.
volname c1d9 ACFS005
fmthard: New volume table of contents now in place.
volname c1d10 ACFS006
fmthard: New volume table of contents now in place.
volname c1d11 ACFS007
fmthard: New volume table of contents now in place.
volname c1d12 ACFS008
fmthard: New volume table of contents now in place.
volname c1d13 ACFS009
volname c1d4 CRS001
fmthard: New volume table of contents now in place.
volname c1d5 ACFS001
fmthard: New volume table of contents now in place.
volname c1d6 ACFS002
fmthard: New volume table of contents now in place.
volname c1d7 ACFS003
fmthard: New volume table of contents now in place.
volname c1d8 ACFS004
fmthard: New volume table of contents now in place.
volname c1d9 ACFS005
fmthard: New volume table of contents now in place.
volname c1d10 ACFS006
fmthard: New volume table of contents now in place.
volname c1d11 ACFS007
fmthard: New volume table of contents now in place.
volname c1d12 ACFS008
fmthard: New volume table of contents now in place.
volname c1d13 ACFS009
5. 변경내용 확인
[root@rinodb1:~:#] format < /dev/null | grep FUJITSU
반응형
'OS > Solaris_관리' 카테고리의 다른 글
[solaris] 지정한 영역의 disk 추출 (16진수 -> 10진수 변환 비교 스크립트) (0) | 2020.06.02 |
---|---|
[Solaris] disk label 스크립트 (0) | 2020.04.22 |
[Solaris] hostname 변경 (0) | 2020.03.23 |
[Solaris] Be 관리 스크립트 (0) | 2020.03.23 |
[Solaris_설치] Install & Upgrade : AI Install 서버 구성 (0) | 2020.03.23 |