-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmountcontainer
44 lines (30 loc) · 1.52 KB
/
mountcontainer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#Storage account must be created according to https://learn.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support-how-to
#VM IP should be added to Storage account Networking
#use the AZ Mount helper package
https://learn.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support-how-to#step-5-install-the-aznfs-mount-helper-package
#install as root user
sudo -su root
wget -O - -q https://github.com/Azure/AZNFS-mount/releases/latest/download/aznfs_install.sh | bash
##mount container
#create directory
mkdir -p /nfsdata
#create an entry in /etc/fstab
sudo nano /etc/fstab
#add following line to fstab
<storage-account-name>.blob.core.windows.net:/<storage-account-name>/<container-name> /nfsdata aznfs defaults,sec=sys,vers=3,nolock,proto=tcp,nofail,_netdev 0 0
#run to process fstab entries
sudo mount /nfsdata
#switch to user profile and give permissions
# This will correct a Permission denied error
# The default mode of a newly created NFS 3.0 container is 0750. Non-root users don't have access to the volume. If access from non-root users is required, root users must change the mode to 0755.
sudo chmod 0755 /nfsdata
#make sure user has adequate permissions
sudo visudo
#Append the following entry so you can run all commands without a password.
#<Your_Account_Name> ALL = (ALL) NOPASSWD: ALL
#Add user to Sudoers group
usermod -aG sudo newuser
#give write and read permissions
sudo chown -R newuser: /nfsdata
# need to use sudo when accessing /nfsdata
sudo cp -f sourcedir targetdir.