mount SMB storage to Linux as CIFS

mount SMB storage to Linux as CIFS

yum install cifs-utils

sudo mount -t cifs -o username=smb_user,file_mode=0777,dir_mode=0777,uid=54321,gid=54321 \\\\191.168.1.122\\shared /u01

[root@linuxvm01 ~]# more /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Jul 28 20:19:48 2019
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=3e40212c-6386-47e6-b6bd-4ccdf31ba007 /boot xfs defaults 0 0
/dev/mapper/rhel-home /home xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
//191.168.1.122/shared /u01 cifs file_mode=0777,dir_mode=0777,uid=54321,gid=54321,credentials=/root/smb.cred,noperm 0 0
[root@linuxvm01 ~]# mount
\\191.168.1.122\shared on /u01 type cifs (rw,relatime,vers=default,cache=strict,username=smb_user,domain=,uid=54321,forceuid,gid=54321,forcegid,addr=191.168.1.122,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)
[root@linuxvm01 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 50G 7.4G 43G 15% /
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 13M 3.8G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 230M 785M 23% /boot
/dev/mapper/rhel-home 42G 2.0G 40G 5% /home
tmpfs 781M 4.0K 781M 1% /run/user/42
tmpfs 781M 48K 781M 1% /run/user/1000
\\191.168.1.122\shared 2.0T 185M 2.0T 1% /u01

[root@linuxvm01 u01]$ cd /u01/dirdat/
[root@linuxvm01 u01]$ ls -lrt
total 12544
-rwxr-xr-x. 1 root root 12746435 Aug 14 09:26 RP000000000
[root@linuxvm01 u01]$

[root@linuxvm01 ~]$ sudo umount /u01
sudo mount -t cifs -o username=smb_user,file_mode=0777,dir_mode=0777,noperm,uid=54321,gid=54321,forceuid,forcegid, \\\\191.168.1.122\\shared /u01
mount
\\191.168.1.122\shared on /u01 type cifs (rw,relatime,vers=default,cache=strict,username=smb_user,domain=,uid=54321,forceuid,gid=54321,forcegid,addr=191.168.1.122,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

sudo mount -t cifs -o username=smb_user,file_mode=0777,dir_mode=0777,noperm,uid=54321,gid=54321,forceuid,forcegid,rw \\\\191.168.1.122\\shared /u01
\\191.168.1.122\shared on /u01 type cifs (rw,relatime,vers=default,cache=strict,username=smb_user,domain=,uid=54321,forceuid,gid=54321,forcegid,addr=191.168.1.122,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

sudo mount -t cifs -o username=smb_user,file_mode=0777,dir_mode=0777,noperm,uid=54321,gid=54321,forceuid,forcegid,rw,context=system_u:object_r:svirt_sandbox_file_t:s0 \\\\191.168.1.122\\shared /u01
\\191.168.1.122\shared on /u01 type cifs (rw,relatime,context=system_u:object_r:container_file_t:s0,vers=default,cache=strict,username=smb_user,domain=,uid=54321,forceuid,gid=54321,forcegid,addr=191.168.1.122,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

sudo mount -t cifs -o username=smb_user,file_mode=0777,dir_mode=0777,noperm,uid=54321,gid=54321,forceuid,forcegid,rw,context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 \\\\191.168.1.122\\shared /u01

Leave a Reply

Your email address will not be published. Required fields are marked *