Mounting of a disk/storage gadget is important to make it available and connecting it to a current directory structure. In Linux, we can mount the disk/storage device mainly in two ways, either permanently or temporarily.

Temporary Mounting

The temporary mounting means that the disk/storage will automatically unmount after the reboot. So, to mount the disk partition we need to create a directory first.

root@server[#]mkdir mydata # Create a Directory

Let’s mount the disk partition using “mount” command.

root@server[#]sudo mount /dev/sda1 mydata/ # Mount a File System {here sda1 is disk partition to mount}

Here we have successfully mounted the file system using the mount command. We can confirm it by using “df -h” command.

root@server[#]df -h | grep mydata # Confirm the mounted file system

The temporary mounting will automatically unmount after reboot. We can also unmount it using the command umount.

root@server[#]umount mydata/ # Unmount the File System

Permanent Mounting

The permanent mounting can be done by modifying “fstab” entries. For permanent mounting, we need to edit /etc/fstab file. fstab record figures out what document frameworks are mounted and when it boots, and in addition, it supplies default esteems for other document frameworks that might be mounted physically now and again.

root@server[#] vi /etc/fstab # Edit the /etc/fstab file
the fstab entries be like,

/dev/sda1 /data ext4 defaults 0 0

* /dev/sda1 : Partition Name

* /data : Mount Directory

* ext4: File System type

* defaults: Permission

[tagline_box backgroundcolor=”description=” shadow=”no” shadowopacity=”0.7″ border=”1px” bordercolor=”” highlightposition=”top” content_alignment=”left” link=”” linktarget=”_self” modal=”” button_size=”” button_shape=”” button_type=”” buttoncolor=”” button=”” title=”” description=”If you have any queries on how perform disk mounting in linux feel free to leave us a message and our representative will get back to you.

” margin_top=”50px” margin_bottom=”” animation_type=”slide” animation_direction=”left” animation_speed=”0.3″ class=”” id=””]

    [/tagline_box]