
디스크 굽기를 피하기 위해 Windows 설치 프로그램의 ISO를 하드 드라이브에 복사하려고 했습니다. 처음으로 디스크 유틸리티의 복원 기능을 사용해 보았지만 어떤 이유로 ISO가 마음에 들지 않았습니다. 그런 다음 dd를 사용해 보았습니다.
dd if=/path/to/image.iso of=/dev/disk3
나는 그것이 약 160KB/초의 달팽이 속도로 파일을 복사하고 있다는 것을 깨달았습니다. Linux 설치로 재부팅하고 거의 그대로 명령을 다시 실행했습니다.
dd if=/path/to/image.iso of=/dev/sdc
이번에는 명령이 57MB/초의 평균 속도로 1분 이내에 실행되었습니다. 두 경우 모두 원본과 대상은 동일한 물리적 하드 드라이브였습니다. 무슨 일이야?
저는 OSX 10.7.3과 Linux 2.6.38-13을 실행하고 있습니다.
답변1
OS X의 경우 /dev/rdisk3
.
rdisk
어떤 이유로 disk
. 나는 그것이 버퍼와 관련이 있다고 생각합니다.
또한 일반적으로 bs
플래그를 사용하면 dd
속도가 향상됩니다.
dd if=/path/to/image.iso of=/dev/sdc bs=1M
바이트 크기는 1M로 더 빠르게 전송됩니다. OS X에서는 1m
대신 (소문자)를 사용해야 합니다 1M
.
답변2
BSD 원시 디스크
일반적으로 BSD에는 버퍼링된 디스크 장치와 버퍼링되지 않은(원시) 디스크 장치 유형이 있습니다. 매뉴얼 페이지 에서 hdutil(1)
:
DEVICE SPECIAL FILES
Since any /dev entry can be treated as a raw disk image, it is worth
noting which devices can be accessed when and how. /dev/rdisk nodes
are character-special devices, but are "raw" in the BSD sense and
force block-aligned I/O. They are closer to the physical disk than
the buffer cache. /dev/disk nodes, on the other hand, are buffered
block-special devices and are used primarily by the kernel's
filesystem code.
It is not possible to read from a /dev/disk node while a filesystem
is mounted from it, ...
두 번째 단락으로 인해 디스크는말 타지 않은dd
"원시 모드"에서 사용할 수 있습니다 .
dd 블록 크기
dd(1)
매뉴얼 페이지 에서 :
Where sizes are specified, a decimal, octal, or hexadecimal number of bytes
is expected. If the number ends with a ``b'', ``k'', ``m'', ``g'', or ``w'',
the number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G) or
the number of bytes in an integer, respectively. Two or more numbers may be
separated by an ``x'' to indicate a product.
기본 블록 크기는 512바이트입니다.