How to build a floppy disk image file?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 5
  • Red Hat Enterprise Linux (RHEL) 6

Issue

How to build a floppy driver disk?
How to build a floppy disk image share ks.cfg via HP iLO.
How to build a floppy disk image share ks.cfg via IBM IMM.
How to build a floppy disk image share ks.cfg via Dell DRAC.

Resolution

1. Build an empty floppy image file using dd command:

[root]# dd if=/dev/zero of=./floppy.img bs=512 count=2880
2880+0 records in
2880+0 records out
1474560 bytes (1.5 MB) copied, 0.00821857 s, 179 MB/s

2. Set up a loop device with the image file:

[root]# losetup /dev/loop0 ./floppy.img

3. Create the file system with the loop device:

[root]# mkfs.msdos /dev/loop0
mkfs.msdos 3.0.16 (01 Mar 2013)

4. Check the filesystem:

[root]# fsck.msdos /dev/loop0
dosfsck 3.0.16, 01 Mar 2013, FAT32, LFN
Logical sector size is zero.

5. Clean up and delete the loop device:

[root]# losetup -d /dev/loop0 

6. Mount the loop device:

[root]# mount -o loop -t auto floppy.img /mnt/floppy/

Files such as ks.cfg can now be written to the directory mounted.

This floppy.img file can now be shared via a Lights Out device such as HP iLO, IBM IMM, or Dell DRAC. It can also be copied to a physical media using the dd command.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments