Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> How to mount a drive or partition
post Jul 9 2003, 09:06 AM
Post #1

Its GNU/

Group: Admin
Posts: 1,254
Joined: 21-September 02
From: St John's, Newfoundland, Canada
Member No.: 3

When coming from the Windows world, the idea of "mounting" a drive seems a bit strange, afterall, your used to popping in a cd and clicking on the icon in My Computer to open it up. You're used to Windows "just doing it" when it came to showing new partitions in the My Computer tab.

Think of "mounting" as inserting a filesystem into your current system. The beauty of mounting is that everything is in a nice neat structure, everything is a part of the filesystem and makes it easier to maintain.

You can mount anything from a cdrom to a hard drive. I will cover these 2 different mediums.

First thing, we need a mount point. Historically, Linux users (and distributions) use the directory /mnt to hold all the mount points. Mount points like /mnt/cdrom and /mnt/floppy were common. However, recently, different distributions are changing this "assumed" standard. SuSE puts cdroms and floppys in /media and windows partitions in /windows. While Debian uses /floppy and /cdrom . While all of these are fine for their uses, i'm still a fan of /mnt . So, here we go:

Mounting a CD-Rom

First off, create your mount point (note, your distribution may already have a mount point, this is just an example):
[quote]$ mkdir /mnt/cdrom[/quote]

Make sure you have a cd in the drive, and it is a Data cd (you cannot mount audio cds). And mount it with the following:
[quote]$ mount -t iso9660 /dev/cdrom /mnt/cdrom[/quote]

The above is a little tricky, especially the "/dev/cdrom" part. /dev/cdrom is usually a symlink to the appropriate cdrom device. If your system has more then one cdroms or a scsi device, this could varry. This goes beyond the scope of this PAQ, so you will have to determine which cdrom device is correct.

When you are finished with the CD, be sure to Un-Mount it because you cannot eject the cd until it's un-mounted.

[quote]$ umount /mnt/cdrom[/quote]

Hard Drive (Partition)

Hard drives and partitions can be a little more trickier then cdroms due to the many many different types of filesystems they could contain. Notice above in the mounting of the cdrom, I have one paramater "-t iso9660"? What this is doign is stating the filesystem of what is being mounted. This almost always needs to be stated so mount can mount it properly. The man page for mount (man mount) gives a list of every filesystem it supports as well as additional options to pass to mount. Some basic filesystems are:

ext2 - The Linux ext2 filesystem, which is currently the standard
ext3 - The Linux journalled filesystem
reiserfs - A fast journalled filesystem for linux
ntfs - The Windows NT filesystem
vfat - The Windows FAT16/FAT32 filesystems.

So, say you're dual-booting your linux system with Windows 98 and you want to have access to your files on that partition. First off, you would make the mount point:

[quote]$ mkdir /mnt/win98[/quote]

Now, mount the partition to that mountpoint:

[quote]$ mount -t vfat /dev/hda1 /mnt/win98[/quote]

This assumes that your Windows partition is located in /dev/hda1 , this can be easily figured out with the "fdisk -l" command to show you which one is the Windows system. Now, you are able to browse to that directory, read and write to the windows directory.

Note: The NTFS filesystem can only be mounted as read-only. So, if you mount this, you will only be able to read from it and not write any data. There are ways to mount it as read/write, but it is very dangerous and should not be done by anyone.

There is also a file located in /etc/fstab which automatically mounts your partitions on bootup. So, if you wanted your Windows partition to automatically be mounted on bootup, you would need to add it to this file. Please refer to the man page for instructions on how to do this.

Corey Quilliam
(former) Administrator

Want to help out Check out our Linuxhelp Wiki and see if there are some articles you would like to submit!!

Ubuntu 8.04 64-bit - Work Laptop (HP-Compaq NC6400 Core2)
Kubuntu 8.04 64-bit - Desktop (HP m8120n QuadCore)
Ubuntu 6.04 - Server (I'm not upgrading this baby until support runs out in 2012) (Some old POS dell)
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 21st July 2018 - 12:38 PM