디스크 단편화(disk fragmentation)에 대한 고찰 xcopy2
SDD가 아닌, 디스크방식의 HDD디스크의 경우, 파일단편화는 속도를 느리게한다.
1) 거의 가득찬 드라이브의 상태이다.
단편화가 심하여, 파일들이 심하게 조각나 있다.
2) 파일들을 몽땅, 다른 드라이브에 복사하고, 삭제했다. (포멧이 안되어)
3) 원래 드라이브로 xcopy로 복사해넣었다.
이론대로라면, 디스크단편화는 없어야하지만, 거의 그대로이다.
무엇이 문제일까?
아래 주소에서는 xcopy로 하면 된다고 되어 있다.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/diskcopy
Avoiding disk fragmentation
Fragmentation is the presence of small areas of unused disk space between existing files on a disk. A fragmented source disk can slow down the process of finding, reading, or writing files.
Because diskcopy makes an exact copy of the source disk on the destination disk, any fragmentation on the source disk is transferred to the destination disk. To avoid transferring fragmentation from one disk to another, use copy or xcopy to copy your disk. Because copyand xcopy copy files sequentially, the new disk is not fragmented.
그러나, 실제로는 되지 않았다....
가정1) xcopy도 여러개의 파일(섹터)을 한꺼번에 복사할까?
가정2) xcopy는 한쪽방향으로 이동하면서, 대충 비슷한곳에 파일조각을 쓴다.
가정3) xcopy 일부러 파일을 조각조각낸다.(왜?)
어쨌든, 디스크를 몽땅 비우고, 다시 복사하면, 디스크단편화가 사라질 줄 알았는데, 안되더라...
그래서, 디스크단편화를 줄여준다는 xcopy2를 사용해봤다.(버그가 좀 있다. xcopy한번도 해주면 될듯)
드라이브 포멧후, 원래 데이터를 xcopy2로 복사해넣었다.
앞쪽의 빈공간은 윈도우에서 관리하는듯하다.(휴지통)
전체적으로 xcopy보다 훨씬 매우 양호한 결과가 나오고있다.
완벽하게 단편화가 해결되지는 않았지만, 아주 좋은 상태이다.