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

fdisk add LVM to CentOS

Linux Fdisk 磁碟分割及格式化

列出 partition table(s)
# fdisk -l

格式化 /dev/sdb
# fdisk /dev/sdb
# Command (m for help): n
# Command action
   e   extended
   p   primary partition (1-4)
p
# Partition number (1-4): 1
# First cylinder (1-2610, default 1): "enter"
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): "enter"
Using default value 2610
# Command (m for help): w

將新增實體給LVM使用
# pvcreate /dev/sdb1

查詢 VG Nname
# vgdisplay

掛載新磁區到 VG
# vgextend centos /dev/sdb1

掃描新磁區是否掛載到 VG
# pvscan

顯示目前的 LVM
# lvdisplay

選擇欲加大的 LVM 掛載新磁區
# lvextend /dev/centos/usr /dev/sdb1

重新整理 LMV 大小
# xfs_growfs /dev/centos/usr

檢查 LVM 是否已正常掛載
# df -h



ref:
https://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-adding-a-new-disk/