# 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 | |