File size: 980 Bytes
85df18f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Go to home dir
cd ~/

# Format nvme0n1  (cpu only machines use nvme0n1 instead of 1)
sudo mkfs -t xfs /dev/nvme0n1 

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

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

# Fetch UUID of nvme0n1 and make the /data mount permanent
UUID=$(sudo blkid -s UUID -o value /dev/nvme0n1)
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

# Other settings
git config --global credential.helper store