3.5 inch 1.44m floppy disk structure:
- 2-sided, 80-sided, 18-sector, 512-byte/sector
- Total number of sectors = 2x80/x 18 sectors/sectors = 2880 sectors
- Storage Capacity = 512 bytes/sector X 2880 sectors = 1440 kb = 1474560b
1. Create a virtual floppy disk image file
Any of the following three commands can create a virtual floppy disk image file with the same results:
- Dd If =/dev/Zero of = floppy. img bs = 1474560 COUNT = 1
- Dd If =/dev/Zero of = floppy. img bs = 512 COUNT = 2880
- Dd If =/dev/Zero of = floppy. img bs = 1024 COUNT = 1440
2. Create a file system on the disk image file
Any of the following two commands can create a file system on a floppy disk image. You can select a file system as needed:
- Mkfs. vfat floppy. img/* Create and format the file system as vfat */
- Mkfs. ext2 floppy. img/* Create and format the file system as ext2 */
When an ext2 file system is created, the following message is returned: floppy. IMG is not a block special device. Proceed anyway? (Y, n) y, select y, and press Enter.
3. Read and Write the created floppy disk image
First, mount the floppy disk image to a folder and run the following command to create a folder floppy:
Run the following command to mount a floppy image:
- Mount floppy. IMG floppy-o loop/* is-o loop, not-0 loop, and it must be loop */
If the system used does not automatically recognize the file system, add the-T option to the mount command:
- Mount floppy. IMG floppy-o loop-T vfat/* If the floppy image is a vfat File System */
- Mount floppy. IMG floppy-o loop-T ext2/* If the floppy image is an ext2 File System */
Then, you can perform operations on the floppy folder like a normal folder, such as copying the "kernel" file to it:
View the files:
- Ls floppy/* output "kernel "*/
After the operation, run the following command to uninstall it:
In this way, the previous operation is completely written into the virtual floppy disk image file.
If
Mount: Unknown filesystem type 'vfat'
You need to view and recreate
/Lib/modules/2.6.xxx/modules. Dep
Use depmod to regenerate modules. Dep and restart