| Linux Newbie Guide V - Drives |
|
|
Page: 1/8 [Printable Version]
Accessing my drives
Where are my drives?
Linux shows all the directories in one directory tree, irrespectively of what
drives/hardware they are found on. Generally, this is a much better solution
than the traditional DOS/Windows model--it completely abstracts the file
system from the underlying hardware. You will appreciate this if you ever have
to re-arrange or expand your hardware or add network resources. But for the
users who are accustomed to the DOS way of dealing with drives, it adds some
extra complexity.
To be brief, don't search for drive letters. There are none under Linux; the
content of your disks appears as subdirectories on your single Linux
filesystem (directory tree). On default, the content of removable
media does not appear automatically in these subdirectories--you have to
"mount" your drives. See the next answers for details. You should
also unmount a drive before ejecting the media.
You can access (read and write) a variety of drives and file systems from
under Linux. This includes native Linux partitions, DOS and MS Windows
partitions (on hard drives or floppies), ZIP and Jazz drives, and CDROM disks.
Many less common file system types are also supported. This means that you can
download your Linux software using Netscape for Windows, save the downloaded
file on your MS Windows hard drive partition, and then boot Linux and copy the
downloaded software from the Windows partition on your harddrive to the Linux
partition, and finally install the software under Linux.
How can I access my CDROM?
Mount it. The mounting adds all the directories and files from your CD to your
Linux directory tree so you can easily access them without the drive letter.
As root, you can mount the CDROM with a command like this:
mount -t auto /dev/cdrom /mnt/cdrom
If this works, the contents of your CD appears in the directory /mnt/cdrom
Chances are this command will not work for you right away--you may have to
customize it. Here is how it works.
The command tells the operating system to mount a filesystem autodetecting the
filesystem type ("-t auto"). The device is /dev/cdrom. The
mountpoint (the directory where to which "mounting" takes place) is /mnt/cdrom.
This directory must exist and be empty. If it does not exist, create it with:
mkdir /mnt/cdrom
If the mounting command fails, make sure that the device /dev/cdrom exists. If
it doesn't, where is your CDROM? Chances are it is something like /dev/hdb if
you have an IDE CDROM. Try /dev/hdb instead of /dev/cdrom in
the mount example above. If this fails, you can try /dev/hdc
or /dev/hdd, if your cd is an IDE CDROM. If none of them is your
CDROM, maybe you don't have IDE but a SCSI CDROM? Then try /dev/sda1,
/dev/sda2, etc. ["hda" is the the primary IDE master drive,
"hdb" is the primary IDE slave drive, "hdc" is the
secondary IDE master (if you have two IDE interfaces on your computer), hdd is
the secondary IDE slave, "sda" is the first SCSI interface and the
number is the SCSI device id number.]
It is a good idea to have a device /dev/cdrom anyway because some
programs assume that it exists. If it does not exist on your system, you may
create it as a symbolic link using, for example:
ln -s /dev/hdb /dev/cdrom
if your cdrom is the /dev/hdb drive.
If you cannot mount because "the device is already mounted or directory
busy", perhaps the mountpoint /mnt/cdrom is your current
directory. You have to change the directory to somewhere else in order to be
able to mount to it; for example change the current directory to the root
directory by issuing this command:
cd /
To unmount a mounted CD, exit the directory /mnt/cdrom and type as
root:
umount /mnt/cdrom
Your CDROM may refuse to eject the media if it is not unmounted. Also, you may
have problems mounting the next CD if the previous one was not unmounted. If
you cannot unmount because "the device is busy", perhaps /mnt/cdrom
(or any subdirectory underneath) is your current directory? You need to change
your current directory to somewhere else out of the mountpoint in order to
unmount the device.
|