Reading floppy and cdrom in linux?

I have Red Hat 4.2 installed on my machine.  How do I access the floppy drive and the cdrom to read files and save files. What are the command line commands.  I have to big Unix and Linux books and neither of them tell me how to do such a simple thing as accessing the floppy drive or the cdrom drive.  Thanks for your help.
Who is Participating?
jcondeConnect With a Mentor Commented:
usually redhat creates the following directories:


The floppy disk, cdrom, and all other storage devices work as if they where directories.

for example
if you want to copy /etc/passwd to the floppy drive all you do is
cp /etc/passwd /mnt/floppy

if you want to see the contents of a cd what you do is:
ls -laF /mnt/cdrom

if by any chance that fails, you will need to mount devices.
to mount the devices do the following
mount /dev/fd0 /mnt/floppy      //For the floppy
mount /dev/scd0 /mnt/cdrom   //CD-ROM


in the last case /mnt/floppy and /mnt/cdrom are simple directories....if you don't have them created you can create them or mount your device to any other directory.

mount /dev/fd0 /my/floppy/directory.



ok  ,

    Here goes... Unix uses a single filesystem.  That is You don't have multiple Disks accessesed seperately like in Win/dos (A: C: D:) etc.  

 The process you need to follow is called mounting a file system.
the command relevant to this is 'mount'  for example :

$ mount /dev/fd0 /flop -tmsdos

  Will  mount the floppy disk in a directory called mount.


$ mount /dev/cdrom  /mnt -tiso9660

 will mount a cdrom on a directory named mnt.

Generally mount can only be executed by root.  You can read the details in the man page.  This can be gotten around by changing permission of the mount program (this may be a security concern) or using sudo or other software allowing this sort of access.

Once mounted you can copy files to or from the device (assuming it is set with proper access rights ... see man page on fstab)

 Once you are done with a particular cd or floppy you can unmount the directory with:
   $ umount /flop
or $ umount /mnt

You cannot umount if the device is in use (i.e. you are in the directory representing the device) and again this command is generally only available to the root user.

 As a backup device you can access the floppy directly and read and write raw disk images by using the cp command.

  cp afile.txt /dev/fd0
copies an image of afile.txt onto the disk.
this method can only write a single file to a disk or copy a single file back from the disk.

for this reason the tar , and the cpio commands are used to archive multiple files.



All Courses

From novice to tech pro — start learning today.