File size: 1,044 Bytes
5af3c27
 
2707470
 
 
 
 
5af3c27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Remove junk files
cd ~/
rm BUILD_FROM_SOURCE_PACKAGES_LICENCES LINUX_PACKAGES_LICENSES LINUX_PACKAGES_LIST PYTHON_PACKAGES_LICENSES THIRD_PARTY_SOURCE_CODE_URLS 
rm -rf nvidia-acknowledgements

# Format nvme1n1
sudo mkfs -t xfs /dev/nvme1n1 

# Create and mount /data directory
sudo mkdir -p /data 
sudo mount /dev/nvme1n1 /data

# Set appropriate permissions for /data (consider more restrictive permissions)
sudo chmod 777 /data

# Fetch UUID of nvme1n1 and make the /data mount permanent
UUID=$(sudo blkid -s UUID -o value /dev/nvme1n1)
echo "UUID=$UUID /data xfs defaults 0 2" | sudo tee -a /etc/fstab

# Link webui directory to nvme
mkdir -p ~/webui
mkdir -p /data/webui
ln -s /data/webui/ ~/webui/

# Setup swap
sudo swapoff -a # Turn off all swap spaces
sudo mkdir -p /data/.swap/
if [ ! -f "/data/.swap/swapfile" ]; then
    sudo dd if=/dev/zero of=/data/.swap/swapfile bs=1G count=16
    sudo chmod 600 /data/.swap/swapfile
    sudo mkswap /data/.swap/swapfile
    sudo swapon /data/.swap/swapfile
fi
sudo swapon --show