"A little progress everyday adds up to big results"

Saturday, 28 July 2012

Mounting

What is mounting?

                       In modern computing, mounting plays an important role. In layman terms, mounting is making a drive/archive to act as a directory or making a directory to act as a drive, though that is not the exact/right definition.

Where is mounting used?

                             Mounting is used in several places like looking for the contents of an iso image without burning them to a CD, using Windows partitions from Linux OS, etc. Let's discuss a few applications of mounting and how to use the mounting facility.

Running Turbo C from Dosbox:

                               Many novice C programmers, especially those who use Windows 7 platform for programming, make use of a third party software called Dosbox. To run Turbo C from dosbox, the very first command is mounting, which goes as
mount c: <directory_path>
Here, the entire directory acts as the C: drive and for any action that is being performed within Turbo C, the <directory_path> has to be considered as C: drive. Here as you can see, the directory is treated as drive.

Mounting devices in Ubuntu:

                        Ubuntu, one of the famous operating systems of Linux, uses auto-mount concept. Once you click on a Windows drive icon, Ubuntu automatically mounts that drive in the /media/<directory_label>/ directory. If the directory already exists, then an '_' is added as a suffix to the <directory_label>. Even when you insert pen drive, it is auto-mounted in the /media/<pendrive_label>/ directory. Here, a drive is treated as a directory. Though Ubuntu supports auto-mounting, sometimes we might need manual mounting also.

Manual mounting in Ubuntu using Terminal:

                          To manually mount a device in Ubuntu, we first create an empty directory in the required directory, by using the command
mkdir <dir_name>
To know the list of available devices, run the command
sudo fdisk -l
Now, mount the required device, using the command
sudo mount <device_name> <dir_name>
Now, you can see the contents of the device, in the <dir_name> directory. To unmount, use the command
sudo umount <dir_name>
Note: The spelling is umount (no 'n') and not unmount.

Mounting with permissions:

                                 If we normally mount pen drives (either auto-mount or manual mount), then we won't be able to run any application from pen drive. To mount a device with permission to run applications, use the command.
sudo mount -o umask=0 <device_name> <dir_name>

"Mounting is a powerful feature, if you know how to use it"

No comments:

Post a Comment