在Ubuntu Linux下製作Windows 啟動安裝 USB盤

來源:互聯網
上載者:User

在Ubuntu Linux下製作Windows 啟動安裝 USB盤

最近想 ,在Ubuntu上燒錄個Windows的安裝隨身碟,在網上看了些資料,不過好多都說的很模糊,於是乎,我走了不少彎路。這裡記錄下來,希望了幫到大家。

首先你的有個USB吧,這裡我們假定USB在ubuntu中為/dev/sdb

1. 給USB裝置 /dev/sdb 分區,注意,要是主要磁碟分割,

sudo fdisk /dev/sdb
Command (m for help): n
Partition type:
  p  primary (0 primary, 0 extended, 4 free)
  e  extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-15564799, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15564799, default 15564799):
Using default value 15564799

Command (m for help): p


Disk /dev/sdb: 7969 MB, 7969177600 bytes
246 heads, 62 sectors/track, 1020 cylinders, total 15564800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8d55b9cb


  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048    15564799    7781376  83  Linux

上面/dev/sdb1就分出來了,全部的空間都給了sdb1

2. 然後把/dev/sdb1設定為開機磁碟分割

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p


Disk /dev/sdb: 7969 MB, 7969177600 bytes
126 heads, 10 sectors/track, 12353 cylinders, total 15564800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8d55b9cb

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *        2048    15564799    7781376  83  Linux

我們可以看到,sdb1後面,多了個*

3. 接下來,把上面做的所有改動寫入USB

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

然後就是q退出

4. 將分區格式化為ntfs的

sudo mkfs -t ntfs /dev/sdb1

這個過程中,會把分區中寫入全0,大概會等幾分鐘

5. 接下來就是把下載好的iso檔案dd到這個開機磁碟分割了

# 把下載的iso檔案燒錄到usb的分區中(及得,一定是分區,否則下次用這個usb是會出現 Operating not found的問題
sudo dd if=/home/peter/Downloads/WindowsTechnicalPreview-x64-ZH-CN.iso of=/dev/sdb1 bs=4M iflag=direct

看到了吧,我在安裝win10

6. 現在還不可以從usb盤啟動,還要在usb盤MBR區資訊寫入,這需要一個工具LILO

sudo apt-get install lilo
sudo lilo -M /dev/sdb mbr

下次啟動的時候,選擇這個USB啟動就會出現windows的安裝介面了!

另外,我自己也試了unetbootin,不過沒有成功,選擇從隨身碟啟動後,一直卡在一個選擇介面。大家有試成功的麻煩推薦下

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.