Add nfs_client.sh
This commit is contained in:
parent
1043045cbc
commit
dc66949f18
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Variables
|
||||
SERVER_IP="192.168.1.2"
|
||||
NFS_SHARE="/mnt/arkdisk"
|
||||
MOUNT_POINT="/mnt/arkdisk"
|
||||
|
||||
# Step 1: Install NFS Client
|
||||
echo "Installing NFS client..."
|
||||
sudo apt update
|
||||
sudo apt install -y nfs-common
|
||||
|
||||
# Step 2: Create a Mount Point
|
||||
echo "Creating mount point..."
|
||||
sudo mkdir -p $MOUNT_POINT
|
||||
|
||||
# Step 3: Mount the NFS Share
|
||||
echo "Mounting NFS share..."
|
||||
sudo mount $SERVER_IP:$NFS_SHARE $MOUNT_POINT
|
||||
|
||||
# Step 4: Add Entry to /etc/fstab for Automatic Mounting
|
||||
echo "Adding entry to /etc/fstab..."
|
||||
echo "$SERVER_IP:$NFS_SHARE $MOUNT_POINT nfs defaults 0 0" | sudo tee -a /etc/fstab
|
||||
|
||||
echo "NFS client setup completed."
|
Loading…
Reference in New Issue