This a quick guide on how to mount different type of volumes or shares in Linux. We go through the most common scenarios: local volumes, NFS and SMB shares. For each we discuss the manual way to mount them, also how the automatic way works at boot, editing the /etc/fstab file.
1. Mount local (LVM) volume
Local LVM volume to mount: /dev/vg00/lvm
Automatically mount at boot in /mnt/lvm, editing the fstab file as follows
# # /etc/fstab # Created by anaconda on Tue Jun 23 12:09:56 2020 # ... # Mount LVM local volume /dev/vg00/lvm /mnt/lvm ext4 defaults 0 0 # or using the volume/s ID instead, see details below: UUID=7ee8732a-c054-4b72-be83-9cefffacc62e /mnt/lvm ext4 defaults 0 0
Manually
[root@localhost /]# mount /dev/vg00/lvm /mnt/lvm
NFS share to mount: 10.0.0.10:/nfs in /mnt/nfs
Prerequisites
# RHEL, CentOS:
yum install -y nfs-utils
#Debian, Ubuntu:
apt install -y nfs-utils
Auto-mount at boot in /mnt/nfs
# # /etc/fstab # Created by anaconda on Tue Jun 23 12:09:56 2020 # … # Mount nfs share 10.0.0.10:/nfs /mnt/nfs nfs rw,hard,async,nosuid,intr 0 0
Manually
[root@localhost /]# mount 10.0.0.10:/nfs /mnt/nfs
SMB share to mount: 10.0.0.10:/nfs /mnt/nfs
Prerequisites
# RHEL, CentOS:
yum install -y cifs-utils
#Debian, Ubuntu:
apt install -y cifs-utils
1. create /etc/smbcredential
2. Lock down the file from unathorized access:
[root@localhost /]# chmod 400 /etc/smbcredential
Auto-mount at boot in /mnt/smb
# # /etc/fstab # Created by anaconda on Tue Jun 23 12:09:56 2020 # … # Mount smb share //10.0.0.100/c$/smb /mnt/smb cifs uid=0,credentials=/etc/smbcredential,iocharset=utf8,vers=2.1,noperm 0 0
Manually
[root@localhost /]# mount -t cifs //10.0.0.100/c$/smb /mnt/smb -o domain=a.com,username=smbuser Password for smbuser@//10.0.0.100/c$/smb: ************* # or [root@localhost /]# mount -t cifs //10.0.0.100/c$/smb /mnt/smb -o credentials=/etc/smbcredential
mobile legends hacks says
For latest information you have to go to see world wide web and on the web I found this website as a best web page for latest
updates.
fill that seat says
Wow, this article is nice, my younger sister is analyzing
these things, therefore I am going to tell her.
Zsolt Agoston says
Great, let me know if you have any questions or if she needs any help with her work.
Rose says
It is my understanding that a java app running on a linux server can access the SMB share by putting credentials in the application. Is there an advantage to mounting it versus just letting the app handle it?