Search Results for '디스크'

1 POSTS

  1. 2009.03.19 [스크랩] Disk sector error(soft or hard) 복구 방법

출처 : http://cafe.naver.com/solatech/174



** 하우투 솔라리스에서 퍼온 글 입니다. 
 
 
 
솔라리스의 1 sector 는 1 block 이고 512 bytes 입니다.  
 
가끔 fsck 를 시도시 다음과 같이 cannot read 라는 메세지와 함께 fsck 상태가  
멈추어 버리는 경우가 있습니다.  
이경우는 전혀 mount를 할수 없습니다.  
여러번 fsck를 시도해 보아도 같은 현상이 나오곤 합니다.  
 
다음은 fsck 시도시 위와 같은 현상이 나오는 예제 입니다.  
 
# fsck /dev/rdsk/c0t1d0s0  
** /dev/rdsk/c0t1d0s0  
** Last Mounted on /  
** Phase 1 - Check Blocks and Size  
 
CANNOT READ: BLK 2036256  
CONTINUE? y  
 
** Phase 2 - Check Pathnames  
** Phase 3 - Check Connectivity  
** Phase 4 - Check Reference Counts  
** Phase 5 - Check Cyl groups  
 
FREE BLK COUNT(S) WRONG IN SUPERBLK  
SALVAGE? y  
 
THE FOLLOWING SECTORS COULD NOT BE READ: 2036256 2036257 2036258 2036259  
 
fsck is incapable of fixing sector errors.  
 
fsck is incapable of of fixing sector erros 라는 메시지를 뿌리고 작업이 중단 되거나  
/var/adm/messages 파일에 다음과 같이 뿌려주는 경우도 있습니다.  
 
 
Error for command 'read(10)' Error Level: Retryable  
Requested Block 2422272, Error Block: 2422283  
Sense Key: Media Error  
Vendor 'SEAGATE':  
ASC = 0x11 (unrecovered read error), ASCQ = 0x0, FRU = 0x0  
 
 
위와 같은 현상이 나타나는 이유는 sector의 formating 정보의 손실이나 전기적  
현상에 의한 sector의 문제인 경우가 많습니다.  
 
 
대부분의 경우 이런 현상이 나오게 되면 newfs 하거나 format하여 사용하면 정상적으로 사용 할수 잇습니다.  
그러나 중요한 정보나 데이타가 있다면 newfs 나 format의 경우 모두 없어지게 됩니다.  
그래서 평소에 백업을 충실히 해두라는 말입니다...  
나중에 후회 하지 말구여...  
 
희망이 없는것은 아닙니다... 한번 해보자구여...  
 
 
에러현상은 다음과 같이 크게 SOFT ERROR과 HARD ERROR로 들수 있습니다.  
 
SOFT ERROR  
----------  
soft에러 발생시 데이타는 영향을 받는 블럭(Affacted block)은 영향을 받지않는(alternate block)으로  
이동하게 됩니다. 그리고 이 불안정한 블럭은 repaired되거나 flawed sector(손상된섹터)  
라는 꼬리표를 달게 됩니다.  
 
 
HARD ERROR  
----------  
하드웨어적인 에러는 디스크의 I/O나 SCSI의 문제일수도 있다..  
물리적 전기적 충격을 가하지 않았다면 디스크는 왠만해선 고장 나지 않는다.  
위의 soft error일 경우가 많은데 Hard error로 간주한다면  
여러분의 귀중한 데이타는 없어질지도 모릅니다.  
정말루 확실한 Hard error라고 판명이 되면 수리센타에 의뢰하는 것이 좋습니다.  
format명령어를 실행했을 경우 Hard error은 디스크타잎을 모르거나 인식이 되지 않는  
경우 입니다.  
 
그런데 디스크타잎과 정보는 정상적인데 fsck시 나타나는 현상이 생기면  
일단은 다음과 같이 해 봅시다...정말 몇천만원 짜리 데이타라면 중요하므로  
전문 복구센타에 의뢰하셔야지 제가 하는데로 하시다간 저만 나쁜놈 됩니다.  
그래도 밑져야 본전 중요한 데이타가 아니라면 일단 한번 해보시죠...  
혹시 압니까.. 제덕에 돈벌런지....ㅋㅋ  
 
 
자그럼 지금 부터 하는 내용을 잘 따라 하시면됩니다.  
 
 
format 명령어를 칩니다.  
 
증상이 나타나는 디스크의 번호를 선택 합니다.  
 
블럭에러가 하나인 것은 다음과 같은 예로 하시면 됩니다.  
 
일단은 error bolck number를 아셔야 합니다.  
 
예)  
 
# format  
AVAILABLE DISK SELECTIONS:  
0. c0t0d0 <IBM-DDYS-T18350M-SA2A cyl 14970 alt 2 hd 6 sec 399>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@0,0  
1. c0t1d0 <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@1,0  
2. c0t2d0 <IBM-DCAS-34330-S65A cyl 8203 alt 2 hd 6 sec 171>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@2,0  
3. c0t4d0 <IBM-DORS-32160-WA6A cyl 6701 alt 2 hd 5 sec 125>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@4,0  
Specify disk (enter its number)[3]: 3 ----> block error가 난 디스크선택  
selecting c0t4d0  
[disk formatted]  
format> repair  
Enter absolute block number of defect: 4080544 ---> 에러 block number  
Ready to repair defect, continue? y  
(at this point, format will indicate how and if the block was repaired)  
format> q  
 
이런식으로 하시면 됩니다. 에러 블럭이 하나라면 위와 같은 식으로 하시면 되겠죠..  
그다음 raw device를 fsck 시켜 줍니다. 그럼 아무문제 없이 fsck될 것입니다.  
그담엔 mount 하시면 됩니다.... 성공하면 방명록에 고맙다는 리플 다시는거  
잊지마셈...  
 
 
자 그럼 두개 이상의 block error 을 reoair하려면 어떻게 하는지  
 
다음 예를 들어 봅니다.  
 
예)  
AVAILABLE DISK SELECTIONS:  
0. c0t0d0 <IBM-DDYS-T18350M-SA2A cyl 14970 alt 2 hd 6 sec 399>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@0,0  
1. c0t1d0 <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@1,0  
2. c0t2d0 <IBM-DCAS-34330-S65A cyl 8203 alt 2 hd 6 sec 171>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@2,0  
3. c0t4d0 <IBM-DORS-32160-WA6A cyl 6701 alt 2 hd 5 sec 125>  
/sbus@1f,0/SUNW,fas@e,8800000/sd@4,0  
Specify disk (enter its number)[3]: 3  
selecting c0t4d0  
[disk formatted]  
 
format> analyze  
 
analyze> setup  
analyze> setup  
Analyze entire disk[yes]? no  
Enter starting block number[0, 0/0/0]: 2036240  
Enter ending block number[2052287, 2035/13/7]: 2036270  
Loop continuously[no]? no  
Enter number of passes[2]: 1  
Repair defective blocks[yes]? yes  
Stop after first error[no]? no  
Use random bit patterns[no]? no  
Enter number of blocks per transfer[126, 0/2/0]: 1  
Verify media after formatting[yes]? yes  
Enable extended messages[no]? no  
Restore defect list[yes]? yes  
Restore disk label[yes]? yes  
 
analyze> read  
Ready to analyze (won't harm SunOS). This takes a long time,  
but is interruptible with CTRL-C. Continue? y  
 
pass 0  
 
Error during read: block 2036256 (0x5da1c0) (2003/5/3)  
Repairing soft error on 2036256 (2003/5/3)...ok.  
 
Error during read: block 2036257 (0x5da1c1) (2003/5/4)  
Repairing soft error on 2036257 (2003/5/3)...ok.  
 
Error during read: block 2036258 (0x5da1c2) (2003/5/5)  
Repairing soft error on 2036258 (2003/5/3)...ok.  
Error during read: block 2036259 (0x5da1c3) (2003/5/6)  
Repairing soft error on 2036259 (2003/5/3)...ok.  
 
2035/13/7  
 
Total of 4 defective blocks repaired.  
(0x5da1c0) (2003/5/3)  
(0x5da1c1) (2003/5/4)  
(0x5da1c2) (2003/5/5)  
(0x5da1c3) (2003/5/6)  
 
analyze> quit  
format> quit