Five methods for creating IMG image files

Source: Internet
Author: User

I usually use the DD command. Today I'm curious. I 've searched some methods to find out how to do this in win ....
1. Use debug in DOS

Write floppy. IMG to disk
Debug floppy. img
-W 100 0 0 1
-Q

Write floppy. IMG to disk B
Debug floppy. img
-W 100 1 0 1
-Q
Here we will floppy. change IMG to boot. bin 2. use winhex to enable boot with winhex. BIN file, press Ctrl + A to select all content, right click-> edit-> copy all-> hex values, and use winhex to create a new file, in the displayed window, select 1.44 MB. Paste the copied hexadecimal value to the new file. Save as boot. IMG. 3. Use this Python script
# Make floppy img
Import sys
If Len (SYS. argv )! = 3:
Print 'usage: ', SYS. argv [0], 'binfilename imgfilename'
SYS. Exit ()
Fin = file (SYS. argv [1], 'rb ')
Bufbin = fin. Read (512)
Fin. Close ()
Bufbin + = ('/0' * (1474560-512 ))
Fout = file (SYS. argv [2], 'wb ')
Fout. Write (bufbin)
Fout. Close ()

4. I use the ultraedit32 and winimage tools to complete this task. Of course, you can use other similar tools in the same way.
  1. First, use winimage to create a m floppy disk imgfile.
  2. Use ultraedit32 to open the imgfile you just created, place the cursor on the first line of the file, and use ctrl-D to delete 512 bytes.
  3. In the [advanced]-[configuration]-[general] dialog box in ultraedit32, select "allow Edit Hex 00 text files without converting them to spaces.
  4. Use ultraedit32 to open the boot. binfile in the <write your own operating system> book. Copy all of its content and insert it into the beginning of the imgfile. Save it.

5.Dd commands in Linux, my favorite

1. Create a disk image file diska. img
Command: dd If =/dev/Zero of = diska. img bs = 512 COUNT = 2880
2. Copy boot. bin to boot. IMG.
Command: dd If = boot. bin of = boot. img bs = 512 COUNT = 1
3. Copy the content in diska. IMG from 512nd bytes to boot. IMG (this is the most brilliant part of DD)
Command: dd If = diska. IMG of = boot. IMG skip = 1 seek = 1 bs = 512 COUNT = 2879

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.