顯示具有 mount 標籤的文章。 顯示所有文章
顯示具有 mount 標籤的文章。 顯示所有文章

Windows 10 共享資料夾 CentOS 7 掛載

PHPStrom 對 samba 分享的資料夾掛載不友善
External file changes sync may be slow: Project files cannot be watched (are they under network mount?)
所以要反過 windows 10 分享給 centos 掛載, 這樣 phpstorm 在讀取檔案時就不會慢

Windwos 10
open cmd with admin
Add Windows user for share
net user __USER__ __PASSWORD__ /add

Add user to admin(optional)
net localgroup administrators __USER__ /add

Share folder and add user
net share __SHARE_NAME__=D:\www /GRANT:__USER__,FULL

Centos 7
yum install -y cifs-utils

Create mount folder
/mnt/www

Mount Folder
要明確指定權限, 否則 nginx, php 無法執行及寫入動作
mount -t cifs -o username="__USER__",password="__PASSWORD__",uid=root,gid=root,dir_mode=0774,file_mode=0774,vers=2.0 //192.168.0.120/www /mnt/www

Unmount Folder
umount /mnt/www

Auto mount with startup
vi /etc/fstab
//192.168.0.120/www    /mnt/www    cifs    auto,username=__USER__,password=__PASSWORD__,uid=root,gid=root,dir_mode=0774,file_mode=0774,vers=2.0    0 0

Execute mount
mount -a

Check mount
mount

Check df
df -h


ref:
https://hk.saowen.com/a/f9bdf856dcdefe9ef9b81d80d03f3985b5033efd7e230e2cae7c126e04d67794

FreeBSD mount NAS


# vim /etc/fstab 
# add line
127.0.0.1:/folder /mnt/folder nfs rw 0 0

# mount -a

done~