Introduction
The use of GNU/Linux (here called only Linux) is growing every day. Many users, when they visit sites on the the operating system or to hear the report of the colleagues who already use the Linux, feel encouraged to experiment with the system. The vast majority you already have the Windows operating system installed and you decide to share the computer is also running Linux. But almost always, the user need to access files present in the Windows partition. This is perfectly possible, through a process known as mounting of the partition. Some distributions Linux mount the Windows partitions automatically, but in other, it is necessary that the user do this manually. This process is simple and will be explained here. The following procedures should be performed as the root user or another that has administrator permissions.
Disks
The first step is to know how to identify the disks (HD’s, CD-ROM, floppy disk) in Linux. Such devices, in addition to of others (such as the LPT1 port) are taken as existing in the directory /dev/. The HD is identified as the device hda0 (hdb to another HD on the same computer and so on). The number 0 indicates the partition in HD. With this, the second partition must be identified as hda1, the third ashda2 finally. In the case of hard Drives SCSI, the letters hd must be exchanged for sd getting the following way: sda0, sda1, sda2, etc.
In the case of the floppy disk drive, the acronym for your id is fd0. If there is another drive, this should be identified as fd1. In the case of CD-ROMS, they are identified as HDs. Thus, if, for example, in your computer there is a HD and a CD-ROM, the HD may be recognized as hda and the CD as hdb.
Mounting the partition
For the Windows partition, you you should know which of the existing she is. In our example, we will suppose that the Windows is on the partition hda0 and the Linux on the partition hda1. Having aware of this, now it is necessary that you create a directory in Linux where the partition Windows should be accessed, that is, the mounting point. Usually, this directory is created within the folder /mnt/ but it can be created in another. For our example, let’s call this directory of win. So, your path is /mnt/win.
The next step is to mount command:
mount – t [type] [partition path] [point mount]
In our example, the command above would look like this:
mount-t vfat /dev/hda1 /mnt/win
The type indicates the file system used in the partition. Partitions fat and fa32 are identified as vfat. In the case of the CD-ROM drive, the type must be specified as iso9660. For example: mount-t iso9660 /dev/hdb /mnt/cdrom. The NTFS partitions can, teriocamente, be mounted on the the same way. However, there are problems of compatibility between the Linux kernel and the NTFS file system, for which reason, the mount this partition type must follow procedures the special, which will not be explained here. If the partition that you want to mount is ext2 or ext3, you can simply specify these names as type.
Mounting automatically
The steps explained previously must be repeated every time that you use Linux. To avoid this, it is possible to mount the partition automatically, during the initialization process. To do this, simply findthe file fstab. Usually it is within the directory /etc/. Open the file and add the seguine line at the end (for our example):
/dev/hda1 /mnt/win vfat defaults 0 0
Now let’s understand it. The syntax of the line is:
[partition path] [point mount] [type] [options] [order]
The options field has the following possibidades:
defaults – uses the default values of the assembly;
noauto – do not mount the devices during the boot. Indicated for floppy drives and CDs;
ro – mount as read-only;
user – gives permission to mount to other users of the system;
sync – adds attributes for the perfect operation mobile devices, such as floppy disks and zip drives.
It is possible to use more than one option at the same time, just separate them by comma. For example:
/dev/hda1 /mnt/win vfat ro,user 0 0
The order field indicates in what sequence the file systems will be checked. If you leave the field in 0 (zero), this procedure will not be executed. Being thus, in most cases you can just leave this value.
After the fstab file has been changed, on the next boot, the mount will occur automatically, except if some step has been run the wrong way.
Unmounting partitions
To unmount a partition, just type the command umount more the way of the partition. For example:
umount /dev/hda1
In some cases, it may be necessary to enter the mount point instead of the path of the partition:
umount /mnt/win
Ending
This article showed the basic procedures to mount the partitions in Linux. The command mount and umount, as well as the fstab file, have other features, which may be verified through the help of the same in your Linux.