The Linux disk and CD image are created successfully.

Source: Internet
Author: User

Linux operating systems that haven't been around for too long have become more and more popular among many computer users, mainly because users like their powerful practicability. His rapid development surprised Microsoft. So many people started to learn about Linux. After learning about Linux, you may encounter the problem of how to create a floppy disk and a CD image in Linux. Here we will introduce how to solve the problem of creating a floppy disk and a CD image in Linux.

When sharing files with virtual machines in Linux, I found a problem. Not all virtual machines support (or support) file sharing between the host and the virtual machine operating system, this will cause many problems when file sharing is required. However, because almost all operating systems support read/write floppy disks and CDs, you can use a relatively roundabout solution to this problem: creating a floppy disk or a CD image file, the virtual machine uses the read/write soft/optical drive mode to open the file. The Linux host directly mounts the file so that the file can be used as a shared directory. However, when the virtual machine operating system is powerful enough, you can use the virtual network for transmission.

This involves how to create a data soft/CD image. The CD images we usually Mount are basically used for read-only purposes and are created by others. How can I use Linux commands to create a data soft/CD image?

Creating a CD image is simple. Use the following command:

Genisoimage-o data. iso/data/yourdir /*

In this way, all files under/data/yourdir/can be directly created into a CD image. However, the only drawback of using a CD image is that it is read-only, so file sharing can only be performed in one direction (if the system on the virtual machine does not support burning CD ).

Create a floppy image:

Previously, the Writing x86 PC Bootloader With Free Software mentioned how to create a boot floppy disk image. However, this floppy disk image can only be used to start a computer, not to store data. Because it is not formatted, it cannot be mounted. Therefore, the main task is to format it.

First, generate a blank floppy disk image:

Dd if =/dev/zero of = data. img bs = 512 count = 2880

Use the losetup command to use data. img as the loop device:

Sudo losetup/dev/loop0 data. img

Then, format the loop device:

Sudo mkfs. msdos/dev/loop0

Check the file system:

Sudo fsck. msdos/dev/loop0

Delete loop device:

Sudo losetup-d/dev/loop0

At this time, data. img has been formatted and can be used as a floppy disk image, for example, mounted to mountdir with sudo mount-o loop data. img mountdir. After certain permissions are set, you can use the virtual machine to open the disk image and use the image as a shared directory. Although this file is only 1.44 MB in size, however, in some cases, the requirements can be met.

In this way, you have successfully completed the Linux production of a floppy disk and a CD image.

  1. Analysis of Open-source Cisco router virtual machines in Linux
  2. 30 Linux releases
  3. Learning Experience: Linux File lock
  4. Linux Extension File System
  5. Easily create a file system in Linux

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.