Which of the following commands will copy one disk partition /dev/sda3 to /dev/sdb3?

A.

dd if=/dev/sdb3 of =/dev/sda3 bs=4096 conv=notrunc

B.

dd if=/dev/sda3 of=/dev/sdb3 bs=4096 conv=notrunc

C.

dd --input /dev/sda3 --output /dev/sdb3 bs=4096 conv=notrunc

D.

dd --input /dev/sdb3 --output /dev/sda3 bs=4096 conv=notrunc

題解

「dd」指令可以用來轉換或是複製檔案。「bs」參數為每次寫入的位元組數量。「if」參數為來源檔案,可以是裝置檔案。「of」參數為目的檔案,可以是裝置檔案。「conv」參數可以轉換編碼,「noerror」可以讓讀取出錯時不會停止,「notrunc」只對輸出的目標是檔案時才有效,可以讓 dd 不要先截斷(truncate)輸出檔案,而是從開頭(或「seek」指定的位置)直接覆寫資料,並保留後面沒有被覆寫到的內容。

所以正確答案是選項 B。