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
” margin_top=”50px” margin_bottom=”” animation_type=”slide” animation_direction=”left” animation_speed=”0.3″ class=”” id=””]
Leave A Comment
You must be logged in to post a comment.