(IMG)镜像文件在windows、Ubuntu、Mac 三种操作系统的烧录方法


Note: Ubuntu is primarily distributed over the Internet as CD/DVD image files, called ISOs. If you have downloaded an ISO image, please refer instead to ../FromUSBStick (to install an ISO image on a USB flash drive) or BurningIsoHowto (to burn an ISO image onto a CD-ROM).

The Ubuntu 9.04 netbook remix and some specialized machine images are distributed as disk image files, called IMGs. This page describes how to install from a .IMG file.

You need to write the downloaded IMG image to a device that your computer can boot from. For netbooks this is usually a flash memory device, such as a USB flash drive or SD memory card. You can also write the IMG file to an external USB hard drive, although these instructions use the term "flash media". The device must have sufficient capacity for the install (1 GB or larger is recommended), and you may need a USB adapter or SD card reader on your computer in order to write to it.

Warning: This will destroy all data on the destination device. Please backup all data to other media before proceeding.

Be sure to verify that your computer supports booting from the device you have selected for installation. Many computers can boot from a USB drive, and some from other sources. Check the documentation on your specific model of computer for the procedure to boot from the selected device.

The GettingUbuntu page has links to the IMG and ISO image files, as well as other methods of GettingUbuntu.

MD5 Sums

Before writing your flash, it is highly recommended that you verify the md5 sum (hash) of the .img file. For instructions, please see HowToMD5SUM. For the current list of Official Ubuntu MD5 hashes, see the MD5SUMS file for the release you're using under http://releases.ubuntu.com (and optionally the PGP signatures in the MD5SUMS.gpg file), or see UbuntuHashes. This ensures that the file was not damaged during the download process and is 100% intact.

Windows

Graphical Interface

win32imagewriter.jpg

  1. Visit the Ubuntu download site (for example, http://www.ubuntu.com/download/desktop ) and download the *.ISO file corresponding to the version of Ubuntu that you want (you probably want Ubuntu 12.04 for 64-bit PCs)

  2. Download Disk Imager from http://sourceforge.net/projects/win32diskimager/files/Archive/win32diskimager-v0.9-binary.zip/download and extract that ZIP file to a new folder. Open up that folder, then double-click Win32DiskImager in the folder. You should see a window like the screen shot above.

  3. Insert your flash media
  4. Note the drive letter assigned to your flash media
  5. Start Disk Imager
  6. Select the downloaded file and target device, and click "Write"
  7. Remove your flash media when the operation is complete

Command Line Interface

  1. Download the desired .img file
  2. Download flashnul from http://shounen.ru/soft/flashnul/index.html#download

  3. Attach your USB drive
  4. Run flashnul -p

  5. Note the physical device number for the USB drive
  6. Run flashnul <number obtained in prior step> -L \path\to\downloaded.img

  7. Answer "yes" if the selected destination device is correct
  8. Remove your USB drive when the command completes

Ubuntu

Graphical Interface (up to 12.10, for later versions use the commandline method below)

usb-imagewriter.png

  1. Download the desired .img file
  2. Install the usb-imagewriter package
    • If your release does not include this, download it from Oliver's PPA

    • If imagewriter fails to launch, you may need to install python glade2 support. Install the python-glade2 package or Run sudo apt-get install python-glade2

    • If your release does not include it and you are running 9.04 Jaunty Jackalope then run this command from the console:
      • sudo apt-get install usb-imagewriter

  3. Open Applications -> Accessories -> Image Writer

    • KDE users will find this in Applications -> Utilities -> Image Writer

    • from the command line, from the console:
      • sudo imagewriter

    • on some usb-imagewriter versions (console command: imagewriter) the application fails to write if the image path contains blank spaces, exiting with "IndexError: list index out of range".

  4. Insert your flash media
  5. Select the downloaded file and flash device, and click "Write to Device"
  6. Remove your device when the operation is complete

Command Line Interface

Be very careful about which /dev device you write to. If your machine is booted up off of disk /dev/sda, and your usb stick is on /dev/sdc, and you accidentally write to /dev/sda instead of /dev/sdc, your filesystem will be irreparably damaged and you will lose all of your files.

  1. Download the desired .img file
  2. Open a terminal and insert your flash media
  3. Look at the output of sudo dmesg | tail -20 to determine the device node assigned to your flash media (ignore the device number; e.g. /dev/sdc, not sdc1)

    • Example output of dmesg, where the device node is 'sdc':
    • [ 5046.396364] usb-storage: device scan complete

    • [ 5046.397075] scsi 10:0:0:0: Direct-Access USB Flash Memory 1.00 PQ: 0 ANSI: 0 CCS

    • [ 5047.068761] sd 10:0:0:0: [sdc] Mode Sense: 23 00 00 00

    • [ 5047.068769] sd 10:0:0:0: [sdc] Assuming drive cache: write through

    • [ 5047.075021]  sdc: sdc1

    • [ 5047.076459] sd 10:0:0:0: [sdc] Attached SCSI removable disk

  4. Run sudo umount /dev/devicenode

  5. Run sudo dd if=/path/to/downloaded.img of=/dev/devicenode bs=1M

  6. Remove your flash media when the command completes (you may need to wait a few extra seconds for it to finish)

Mac OS X

Command Line Interface

  1. Download the desired .img file
  2. Open a Terminal (in /Applications/Utilities/)
  3. Run diskutil list to get the current list of devices

  4. Insert your flash media
  5. Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)

  6. Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2)

  7. Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img, /dev/rdiskN is faster than /dev/diskN). If you see the error dd: Invalid number `1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M.

  8. Run diskutil eject /dev/diskN and remove your flash media when the command completes




CategoryLive CategoryLive「


文章摘自:https://help.ubuntu.com/community/Installation/FromImgFiles

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
制作Ubuntuimg镜像文件可以通过使用Ubuntu Live CD或者命令行来完成。下面是一个基本的步骤示例来制作Ubuntuimg镜像文件: 1. 首先,你需要一台运行着Ubuntu操作系统的电脑,可以是物理机或者虚拟机。 2. 使用Ubuntu Live CD引导电脑进入Ubuntu Live环境。确保您有足够的存储空间来创建和存放镜像文件。 3. 打开终端,使用命令行执行以下命令来创建一个img文件,其中“/path/to/your/folder”是你想要保存镜像文件的文件夹的路径,而“ubuntu.img”是你想要给镜像文件的名称: ``` sudo dd if=/dev/zero of=/path/to/your/folder/ubuntu.img bs=1M count=5000 ``` 这个命令将创建一个5000MB大小的img文件。你可以根据需要调整大小。 4. 创建文件系统并将其挂载到一个临时目录中。使用以下命令: ``` sudo mkfs.ext4 /path/to/your/folder/ubuntu.img sudo mkdir /tmp/img_mount sudo mount /path/to/your/folder/ubuntu.img /tmp/img_mount ``` 5. 下一步是从您的Ubuntu Live环境中复制文件系统。使用以下命令来复制系统文件: ``` sudo rsync --progress -aAXv --exclude="/tmp/*" --exclude="/var/tmp/*" --exclude="/proc/*" --exclude="/sys/*" --exclude="/mnt/*" --exclude="/media/*" --exclude="/dev/*" --exclude="/lost+found" --exclude="/home/*/.gvfs" --exclude="/home/*/.cache" --exclude="/home/*/.thumbnails" --exclude="/home/*/.config/chromium" --exclude="/home/*/.local/share/Trash" / /tmp/img_mount ``` 这个命令将复制整个文件系统到你的img镜像文件中。 6. 复制完成后,可能需要更新fstab文件,以确保镜像文件在启动时正确挂载。在终端中执行以下命令: ``` sudo nano /tmp/img_mount/etc/fstab ``` 检查fstab文件的内容并进行必要的更改。 7. 现在,卸载临时目录中的镜像文件系统并关闭终端。使用以下命令来卸载: ``` sudo umount /tmp/img_mount ``` 8. 至此,你已经成功制作了Ubuntuimg镜像文件。你可以将它转移到其他设备上并使用工具写入到USB驱动器或SD卡中进行引导。 请注意,在制作img镜像文件时需要小心,确保您选择了正确的目标设备,并备份重要数据,以防止意外数据丢失。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值