Solved

Reading floppy and cdrom in linux?

Posted on 1998-12-15
2
337 Views
Last Modified: 2013-12-15
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.
fugitive_2
0
Comment
Question by:fugitive_2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
jconde earned 30 total points
ID: 1631924
usually redhat creates the following directories:

/mnt/cdrom
/mnt/floppy

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

NOTE:

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.

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


bye

Jorge


0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631925
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.

 similarly

$ 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.

--Talwyn

   


0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question