리눅스 dd 명령어로 파일 쓰기 속도 측정하기
리눅스 dd 명령어로 파일 쓰기 속도 측정하기
리눅스 명령어 중에 dd 라는 명령어가 있다.
여러가지 용도 사용이 되지만 그중에 리눅스를 백업하는 기능도 있고, 하드 쓰기 속도를 테스트 할 수도 있다.
▶ 1기가 파일 생성
# dd if=/dev/zero of=/1G.tmp bs=100M count=10
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB) copied, 1.12745 s, 930 MB/s
속도가 930MB/s 가 나오고 있다. 테스트한 하드는 코노하 VPS의 SSD 이다.
# dd --help 보기
Usage: dd [OPERAND]...
or: dd OPTION
Copy a file, converting and formatting according to the operands.
bs=BYTES read and write up to BYTES bytes at a time
cbs=BYTES convert BYTES bytes at a time
conv=CONVS convert the file as per the comma separated symbol list
count=N copy only N input blocks
ibs=BYTES read up to BYTES bytes at a time (default: 512)
if=FILE read from FILE instead of stdin
iflag=FLAGS read as per the comma separated symbol list
obs=BYTES write BYTES bytes at a time (default: 512)
of=FILE write to FILE instead of stdout
oflag=FLAGS write as per the comma separated symbol list
seek=N skip N obs-sized blocks at start of output
skip=N skip N ibs-sized blocks at start of input
status=LEVEL The LEVEL of information to print to stderr;
'none' suppresses everything but error messages,
'noxfer' suppresses the final transfer statistics,
'progress' shows periodic transfer statistics
N and BYTES may be followed by the following multiplicative suffixes:
c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M
GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.
# dd if=/dev/zero of=/1G.tmp bs=100M count=10
100메가씩 열번해서 1기가로 생성한다는 의미이다.
bs에 한번에 기가로는 속도가 느려진다. 아무래도 메모리가 딸려서 그런가보다.