Learn basics of Linux hacking for hacking aspirants Part 13

Here I am going to tell you about mount drive & devices. A feature which windows does it automatically but in the Linux environment you need to do this manually.

Commands to mount drive & devices

The process of mounting is old when the computer were giant size , every time when you insert a hardware you need to tell the system & know about them. Windows assign the Drive letter automatically like C, D, E and so on. The device unplug is also simple in windows.
To mount or unmount a device in the computer is a very basic thing for a system admin. There are many devices which not auto-mounted by themselves. These devices are mounted by admin.

File Structure

As I have told you in the previous articles about the Linux file structure. A device must be mounted in a empty directory that is made for the devices. If you will mount a device in some other directory then it will be unusable for same time.

mount drive & devices
mount drive & devices

The file structure has a directory for every case. The directory are to be used for the appropriate method.
Also Read : Learn basics of Linux hacking for hacking aspirants Part 12

Mount Command

To know everything about mount type

mount -h

All the help for the command will be shown.
The basic syntax for the command is

mount -t filesystemtype location

This command will install a filesystem of type t in the location specified. for example

mount -t /dev/cdrom /media

This command will install a cdrom in the location /media.
The option used in the command are

  • rw – read/write
  • ro – read only
  • user – permit any user to mount
  • auto/noauto – no automatic mount
  • exec/noexec – control the execution of binaries on the mounted device

There are still many options with mount , you can check then by

man mount

Automount with Fstab

Fstab stands for File system table.  A configuration file is checked before mounting a device.  All the options for mounting are defined in the config file.
You can see the contents of fstab command by this

cat fstab

The filesystem table has 6 columns

  • Device – UUID
  • Mount point – directory to attach device
  • Type – type of filesystem
  • Options – rw (read/write), auto,  async, suid, etc
  • Dump – options for backup
  • Pass – When should fsck should check the filesystem.

Umount

Umount command is to unmount a device.
To unmount a device type the command like this

umount <Drive location>

Note : A device will be unmounted if it is not in use otherwise an error message is displayed.
Also Read Learn basics of Linux hacking for hacking aspirants Part 11
Thanks for the support you have shown us. Follow us on Facebook & comment to provide the feedback to us. Thank You.

Leave a Comment