NOTE: dd command?
dd command當中的"dd",是什麼意思,有以下說法:
- "Data Duplicator"(數據複製器)
- "Disk Dump"(磁碟轉儲)
- "Destroy Disk"(摧毀磁碟,因為錯誤使用可能會導致數據丟失)
由上可知,dd command可以用在:
- 備份資料
- 還原資料至目標儲存空間(轉儲)
- 透過將每個位元寫入空值的方式,將資料損毀
以下就是針對不同需求所製作的筆記
Create OS image
透過lsblk找到目標硬碟,在將內部資料(作業系統)做成映像(image)備份
Command: lsblk
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
先使用fdisk指令,計算製作image file的大小
Command: fdisk -l
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
存入空間由start起始,終於End,所以輸入大小為23175167使用dd command + time製作image並計算時間
Command: time if=/dev/sdX of=example.img bs=512 status=progress count=23175167
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Result:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Restore OS image to Disk
將image還原至USB
command: time dd if=<image_file> of=/dev/sdX status=progress
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Wipe all data in Disk
(將整顆硬碟的資料透過寫入zero抹除,時間會偏久)
Command: time dd if=/dev/zero of=/dev/sdX bs=512 status=progress
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Ref.
dd command info
Securely Wipe Disks and Delete Files