- create a virtual floppy image without mount? [closed]
- 1 Answer 1
- Make floppy image linux
- 4.3.1. Writing Disk Images From a Linux or Unix System
- 4.3.2. Writing Disk Images From DOS, Windows, or OS/2
- 4.3.3. Writing Disk Images From MacOS
- 4.3.3.1. Writing Disk Images with Disk Copy
- 4.3.3.2. Writing Disk Images with suntar
- Make floppy image linux
- 4.3.1. Writing Disk Images From a Linux or Unix System
- 4.3.2. Writing Disk Images From DOS, Windows, or OS/2
- 4.3.3. Writing Disk Images From MacOS
- 4.3.3.1. Writing Disk Images with Disk Copy
- 4.3.3.2. Writing Disk Images with suntar
create a virtual floppy image without mount? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
- create empty 1.44MB image file by dd command
- format the image file by mkfs.msdos
- mount the image file to some mount point
- copy something to the mount point
- umount the virtual floppy image file
my question is, in case I am just a common user who cannot run sudo command, how can I follow above steps to create a virtual floppy image and write something in it?
1 Answer 1
Yes, of course you can do this. Use mtools for the FAT and e2tools or genext2fs for the ext2 filesystems.
$ dd if=/dev/zero of=/tmp/disk1.img count=1440 bs=1k 1440+0 records in 1440+0 records out 1474560 bytes (1.5 MB) copied, 0.00569719 s, 259 MB/s $ /sbin/mkfs.msdos /tmp/disk1.img mkfs.msdos 3.0.12 (29 Oct 2011) $ mdir -i /tmp/disk1.img Volume in drive : has no label Volume Serial Number is 9913-BFF6 Directory for ::/ No files 1 457 664 bytes free $ mcopy -i /tmp/disk1.img /etc/issue.net ::/ $ mdir -i /tmp/disk1.img Volume in drive : has no label Volume Serial Number is 9913-BFF6 Directory for ::/ issue net 28 2012-06-26 10:49 1 file 28 bytes 1 457 152 bytes free
And of course, I have no root rights.
Make floppy image linux
Bootable floppy disks are generally used as a last resort to boot the installer on hardware that cannot boot from CD or by other means.
Booting the installer from floppy disk reportedly fails on Mac USB floppy drives.
Disk images are files containing the complete contents of a floppy disk in raw form. Disk images, such as boot.img , cannot simply be copied to floppy drives. A special program is used to write the image files to floppy disk in raw mode. This is required because these images are raw representations of the disk; it is required to do a sector copy of the data from the file onto the floppy.
There are different techniques for creating floppies from disk images. This section describes how to create floppies from disk images on different platforms.
Before you can create the floppies, you will first need to download them from one of the Debian mirrors, as explained in Section 4.2, “Downloading Files from Debian Mirrors”.
No matter which method you use to create your floppies, you should remember to flip the write-protect tab on the floppies once you have written them, to ensure they are not damaged unintentionally.
4.3.1. Writing Disk Images From a Linux or Unix System
To write the floppy disk image files to the floppy disks, you will probably need root access to the system. Place a good, blank floppy in the floppy drive. Next, use the command
$ dd if=filename
of=/dev/fd0 bs=1024 conv=sync ; sync
where filename is one of the floppy disk image files. /dev/fd0 is a commonly used name of the floppy disk device, it may be different on your workstation. The command may return to the prompt before Unix has finished writing the floppy disk, so look for the disk-in-use light on the floppy drive and be sure that the light is out and the disk has stopped revolving before you remove it from the drive. On some systems, you’ll have to run a command to eject the floppy from the drive .
Some systems attempt to automatically mount a floppy disk when you place it in the drive. You might have to disable this feature before the workstation will allow you to write a floppy in raw mode . Unfortunately, how to accomplish this will vary based on your operating system.
If writing a floppy on powerpc Linux, you will need to eject it. The eject program handles this nicely; you might need to install it.
4.3.2. Writing Disk Images From DOS, Windows, or OS/2
If you have access to an i386 or amd64 machine, you can use one of the following programs to copy images to floppies.
The rawrite1 and rawrite2 programs can be used under MS-DOS. To use these programs, first make sure that you are booted into DOS. Trying to use these programs from within a DOS box in Windows, or double-clicking on these programs from the Windows Explorer is not expected to work.
The rwwrtwin program runs on Windows 95, NT, 98, 2000, ME, XP and probably later versions. To use it you will need to unpack diskio.dll in the same directory.
These tools can be found on the Official Debian CD-ROMs under the /tools directory.
4.3.3. Writing Disk Images From MacOS
An AppleScript, Make Debian Floppy , is available for burning floppies from the provided disk image files. It can be downloaded from ftp://ftp2.sourceforge.net/pub/sourceforge/d/de/debian-imac/MakeDebianFloppy.sit. To use it, just unstuff it on your desktop, and then drag any floppy image file to it. You must have Applescript installed and enabled in your extensions manager. Disk Copy will ask you to confirm that you wish to erase the floppy and proceed to write the file image to it.
You can also use the MacOS utility Disk Copy directly, or the freeware utility suntar . The root.bin file is an example of a floppy image. Use one of the following methods to create a floppy from the floppy image with these utilities.
4.3.3.1. Writing Disk Images with Disk Copy
If you are creating the floppy image from files which were originally on the official Debian GNU/Linux CD, then the Type and Creator are already set correctly. The following Creator-Changer steps are only necessary if you downloaded the image files from a Debian mirror.
- Obtain Creator-Changer and use it to open the root.bin file.
- Change the Creator to ddsk (Disk Copy), and the Type to DDim (binary floppy image). The case is sensitive for these fields.
- Important: In the Finder, use Get Info to display the Finder information about the floppy image, and “ X ” the File Locked check box so that MacOS will be unable to remove the boot blocks if the image is accidentally mounted.
- Obtain Disk Copy ; if you have a MacOS system or CD it will very likely be there already, otherwise try http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Utilities/Disk_Copy/Disk_Copy_6.3.3.smi.bin.
- Run Disk Copy , and select Utilities → Make a Floppy , then select the locked image file from the resulting dialog. It will ask you to insert a floppy, then ask if you really want to erase it. When done it should eject the floppy.
4.3.3.2. Writing Disk Images with suntar
- Obtain suntar from . Start the suntar program and select “ Overwrite Sectors. ” from the Special menu.
- Insert the floppy disk as requested, then hit Enter (start at sector 0).
- Select the root.bin file in the file-opening dialog.
- After the floppy has been created successfully, select File → Eject . If there are any errors writing the floppy, simply toss that floppy and try another.
Before using the floppy you created, set the write protect tab ! Otherwise if you accidentally mount it in MacOS, MacOS will helpfully ruin it.
Make floppy image linux
Bootable floppy disks are generally used as a last resort to boot the installer on hardware that cannot boot from CD or by other means.
Booting the installer from floppy disk reportedly fails on Mac USB floppy drives.
Disk images are files containing the complete contents of a floppy disk in raw form. Disk images, such as boot.img , cannot simply be copied to floppy drives. A special program is used to write the image files to floppy disk in raw mode. This is required because these images are raw representations of the disk; it is required to do a sector copy of the data from the file onto the floppy.
There are different techniques for creating floppies from disk images. This section describes how to create floppies from disk images on different platforms.
Before you can create the floppies, you will first need to download them from one of the Debian mirrors, as explained in Section 4.2, “Downloading Files from Debian Mirrors”.
No matter which method you use to create your floppies, you should remember to flip the write-protect tab on the floppies once you have written them, to ensure they are not damaged unintentionally.
4.3.1. Writing Disk Images From a Linux or Unix System
To write the floppy disk image files to the floppy disks, you will probably need root access to the system. Place a good, blank floppy in the floppy drive. Next, use the command
$ dd if=filename
of=/dev/fd0 bs=1024 conv=sync ; sync
where filename is one of the floppy disk image files. /dev/fd0 is a commonly used name of the floppy disk device, it may be different on your workstation. The command may return to the prompt before Unix has finished writing the floppy disk, so look for the disk-in-use light on the floppy drive and be sure that the light is out and the disk has stopped revolving before you remove it from the drive. On some systems, you’ll have to run a command to eject the floppy from the drive .
Some systems attempt to automatically mount a floppy disk when you place it in the drive. You might have to disable this feature before the workstation will allow you to write a floppy in raw mode . Unfortunately, how to accomplish this will vary based on your operating system.
If writing a floppy on powerpc Linux, you will need to eject it. The eject program handles this nicely; you might need to install it.
4.3.2. Writing Disk Images From DOS, Windows, or OS/2
If you have access to an i386 or amd64 machine, you can use one of the following programs to copy images to floppies.
The rawrite1 and rawrite2 programs can be used under MS-DOS. To use these programs, first make sure that you are booted into DOS. Trying to use these programs from within a DOS box in Windows, or double-clicking on these programs from the Windows Explorer is not expected to work.
The rwwrtwin program runs on Windows 95, NT, 98, 2000, ME, XP and probably later versions. To use it you will need to unpack diskio.dll in the same directory.
These tools can be found on the Official Debian CD-ROMs under the /tools directory.
4.3.3. Writing Disk Images From MacOS
An AppleScript, Make Debian Floppy , is available for burning floppies from the provided disk image files. It can be downloaded from ftp://ftp2.sourceforge.net/pub/sourceforge/d/de/debian-imac/MakeDebianFloppy.sit. To use it, just unstuff it on your desktop, and then drag any floppy image file to it. You must have Applescript installed and enabled in your extensions manager. Disk Copy will ask you to confirm that you wish to erase the floppy and proceed to write the file image to it.
You can also use the MacOS utility Disk Copy directly, or the freeware utility suntar . The root.bin file is an example of a floppy image. Use one of the following methods to create a floppy from the floppy image with these utilities.
4.3.3.1. Writing Disk Images with Disk Copy
If you are creating the floppy image from files which were originally on the official Debian GNU/Linux CD, then the Type and Creator are already set correctly. The following Creator-Changer steps are only necessary if you downloaded the image files from a Debian mirror.
- Obtain Creator-Changer and use it to open the root.bin file.
- Change the Creator to ddsk (Disk Copy), and the Type to DDim (binary floppy image). The case is sensitive for these fields.
- Important: In the Finder, use Get Info to display the Finder information about the floppy image, and “ X ” the File Locked check box so that MacOS will be unable to remove the boot blocks if the image is accidentally mounted.
- Obtain Disk Copy ; if you have a MacOS system or CD it will very likely be there already, otherwise try http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Utilities/Disk_Copy/Disk_Copy_6.3.3.smi.bin.
- Run Disk Copy , and select Utilities -> Make a Floppy , then select the locked image file from the resulting dialog. It will ask you to insert a floppy, then ask if you really want to erase it. When done it should eject the floppy.
4.3.3.2. Writing Disk Images with suntar
- Obtain suntar from . Start the suntar program and select “ Overwrite Sectors. ” from the Special menu.
- Insert the floppy disk as requested, then hit Enter (start at sector 0).
- Select the root.bin file in the file-opening dialog.
- After the floppy has been created successfully, select File -> Eject . If there are any errors writing the floppy, simply toss that floppy and try another.
Before using the floppy you created, set the write protect tab ! Otherwise if you accidentally mount it in MacOS, MacOS will helpfully ruin it.