FreeOS.com logo

FreeOS Most Popular
* Most Read stories
* Commented Stories
* Active Categories
* Non Linux Section
* User Submitters
* Top Polls
* Top Authors
* Top Reviews
* Top Rated
* Top Search Terms

Top Articles
* Writing a Linux device driver
* The Linux filesystem explained
* Samba NT Domain Controller
* Setting up Squid as your caching HTTP/FTP proxy
* Web server tutorial - Part 1

FreeOS Highlights
* Howtos (72)
* Reviews (20)
* Opinions (18)
* Interviews (8)
* News (3)

My FreeOS

Nick:
Pass:
Register

Forgot your password?

Contact Us
Contact Us

       

Project: Linux triangle Howtos triangle

Maximum Mount

By Aarjav Trivedi <aarjavtNOSPAM@yahoo.com>
Posted: ( 2002-04-05 16:31:41 EST by prakash )

Accessing you Windows Drives on Linux and other Horseback Tales.

Surely I have gone mad ! You might think, what has Linux to do with horses ? Well Linux might not yet be running a robotic horse, though that too is not far, but Linux surely has got a lot to do with mounting. You see, mounting is the Linux phrase for getting the operating system to access your disks. This disk can be a floppy, a cdrom or a hard disk partition.

To mount a disk , there are two necessary conditions

  1. The disk ( device ) must be one of the files in the /dev directory.
  2. The disk must be listed in the /etc/fstab ( or /etc/mtab sometimes ) file along with some extra information.

By default when you install Linux, it is automatically configured to be able to access your floppy disks, cdrom and atleast one hard disk.

Also every time you boot into linux, your swap (refer installation guide to know what swap is) and your root directory , the \'/\' directory are mounted.

However there are times when you have stored some songs on your windows partition and you want to listen to them while running Linux, or maybe read some web-pages you saved on Windows while running Linux. For this you might have to configure your system to read the Windows drives or as we say, mount them.

Mounting is done using the mount command but before using that command we must actually edit the configuration file for it in the /etc folder.

NOTE : Almost all configuration files in Linux are stored in the /etc directory and its subdirectories.

The file to look for now is the /etc/fstab file. Open this file in your favourite text editor.

( If you are using KDE, you can do this by typing \" kwrite /etc/fstab \" in the console. )

What you see now is something similar to this :

/dev/hdc5       /              ext2      defaults              1   1
/dev/fd0        /mnt/floppy    auto      noauto,owner          0   0
none            /proc          proc      defaults              0   0
none            /dev/pts       devpts    gid=5,mode=620        0   0
/dev/hdc6       swap           swap      defaults              0   0
/dev/cdrom      mnt/cdrom      iso9660   noauto,owner,kudzu,ro 0   0


The dashes here are replaced by blank spaces in the file The first column lists the device which can be mounted from the /dev directory. The second column lists the mount point or the directory in which this device can be opened once mounted. The third column lists the format in which data is stored on this disk. The fourth column lists some parameters used for mounting the disk. The last two columns are 0 0 unless the disk to be mounted is your \'/\' partition.

Now first we must find which file in /dev denotes our windows hard disk. Generally this is /dev/hda1 if the Windows Hard Disk is your primary master disk. It is /dev/hdc1 if the Windows Hard Disk is your primary slave disk We must now create a mount point , or a directory in which the drive will be opened when mounted. Open the console.

Type :

mkdir /mnt/hda1 (For most users)

OR

mkdir /mnt/hdc1 (For those rare few who have a windows as primary slave disk)

Data on a windows hard disk is stored in fat32 or fat format which is denoted by \'vfat\' in linux. So now lets edit the /etc/fstab file which we have opened in the text editor. Make a new entry which should look like this :

/dev/hda1---- /mnt/hda1---- vfat---- sw---- 0 0

OR

/dev/hdc1---- /mnt/hdc1---- vfat---- sw---- 0 0

so that the above values are in line with the other columns Depending upon whether you have selected /dev/hda1 or /dev/hdc1 ( If you went wrong in this selection, it would not harm your hard disk so if u dont succeed, try using the other one. Try to keep the columns formatted i.e. Perfectly one below the other just as shown abov. Now save the /etc/fstab file.

Open the console and type :

mount /dev/hda1

OR

mount /dev/hdc1

Now do

cd /mnt/hda1

or

cd /mnt/hdc1

then do

ls

This should give you a list of the files in your Windows drive. Now you can create a shortcut to the windows disk on your desktop using

cp -l /mnt/hda1 /home/aarjav/Desktop

And thus you have mounted your Windows drive.So friends, Happy Riding till we meet again. Bye !

The author grants you express permission to copy, store and republish this document in electronic or hard-copy format as long as its contents including this instruction are not changed.

This document was born in StarOffice 5.1 (Linux) on a lazy Wednesday Afternoon during my monsoon leave.

File Permissions and the chmod/chgrp/chown commands Linux Basics : First Steps Into Linux

Linux demystified

Other articles by Aarjav Trivedi

Current Rating: [ 7.1 / 10 ] Number of Times Rated: [ 61 ]

More Howtos
* Kernel Compilation & Avoiding ‘Unresolved Symbol’
* Configuring CVS and CVSUP on Linux
* Knoppix installation tips
* Maximum Mount
* A WebServer Guide -- Help Using Apache

Contents
Articles
  Howtos
  Interviews
  News
  Opinions
  Reviews
Comparison
Links
  Articles
  Howtos
  Interviews
  Opinions
  Reviews
  Websites
News

Linux
About Linux

Print It!
Printer Friendly Version