> ## Content Index
> Fetch the complete content index at: https://www.albert-yu.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# EC2 初始化EBS (使用 dd)
- URL: https://www.albert-yu.com/blog/ec2-initialize-ebs-with-dd/
- Published: 2016-12-29T02:26:28.000Z
- Updated: 2026-10-30T03:43:28.000Z
- Author: Albert Yu
- Tags: AWS, Cloud, DD, EBS, EC2, Linux, OS, Ubuntu, Windows, 初始化

初始化EBS (dd)  
在創建主機時如果先進行初始化的動作

主機效能在實測上有10%到30%的提高

Windows

1. 安裝dd到windows上  
下載點：[http://www.chrysocome.net/dd](http://www.chrysocome.net/dd?ref=albert-yu.com)
2. 解壓縮安裝檔
3. 開啟命令提示字元（CMD）
4. 移動到解壓縮的資料夾下 C:\\> cd /d 目錄
5. 列出磁碟  
C:\\>wmic diskdrive get size,deviceid  
如：  
C:\\>wmic diskdrive get size deviceid  
DeviceID Size  
\\.\\PHYSICALDRIVE2 80517265920  
\\.\\PHYSICALDRIVE1 80517265920  
\\.\\PHYSICALDRIVE0 128849011200  
\\.\\PHYSICALDRIVE3 107372805120
6. 還原指定磁碟  
C:\\>dd if=\\.\\PHYSICALDRIVEn of=/dev/null bs=1M --progress --size

LINUX

1.lsblk顯示磁碟區  
\[ec2-user \~\]$ lsblk  
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT  
xvdf 202:80 0 30G 0 disk  
xvda1 202:1 0 8G 0 disk /

1. sudo dd if=/dev/xvdf of=/dev/null bs=1M