Mount Lab

Accessing Floppy Disks - using msdos and ext2 filesystems

Goals

In the diagram below, /dev/hda2 is the second primary partition on our classroom hard drives. Note that the /var directory is a mount point for another partition on our hard drives. In this example it is /dev/hda5 which is the first logical drive in the extended partition.
In this lab we will be building a filesystem on /dev/fd0, the first floppy device. Then we will mount /dev/fd0 on the directory /mnt/floppy. This directory is called the mount point. This will make the small filesystem living on the floppy part of the overall Linux filesystem tree. You will be able to access the data on the floppy without being concerned on which partition or device the data lives.


Lab: Accessing Floppy Disks - DOS and ext2 Filesystems

Purpose:

Syntax:

# fdformat <device>
# mkfs -t <filesystem type> <device>
# mount -t <filesystem type> <device> <mount-point>
# ls -la <mount-point>
# umount <device or mount-point>

Procedure:

     Format the floppy

# fdformat /dev/fd0H1440

     NOTE: You may have umount the device first!

# umount /mnt/floppy

    Create the msdos filesystem on the floppy
# /sbin/mkfs -t msdos /dev/fd0

    Mount the device in the linux filesystem

# mount -t msdos /dev/fd0 /mnt/floppy

    Do a long listing of the /mnt/floppy filesystem
# ls -la /mnt/floppy
    Write a file to the directory
# cp /etc/redhat-release /mnt/floppy

    Do another listing

# ls -la /mnt/floppy

    Remove the device from the Linux filesystem

# umount /mnt/floppy

Create an /ext2 filesystem on the floppy and mount it

# umount /mnt/floppy
# mkfs -t ext2 /dev/fd0
# mount -t ext2 /dev/fd0 /mnt/floppy
# ls -la /mnt/floppy
total 17
drwxr-xr-x    3 root  root  1024 Sep 17 12:53 .
drwxr-xr-x   12 root  root  4096 Sep  4 20:11 ..
drwx------    2 root  root 12288 Sep 17 12:53 lost+found
# cp /etc/redhat-release /mnt/floppy
# cat redhat-release
Red Hat Linux release 7.3 (Valhalla)
When you are done, you must turn your floppy back into a boot floppy for your machine!
# umount /mnt/floppy
# mkbootdisk --device /dev/fd0 `uname -r`

Automatically mounting filesystems at boot time

$ cat /etc/fstab