gpu_server_setup/setup_drives.sh

31 lines
957 B
Bash
Raw Normal View History

#!/bin/bash
#https://stackoverflow.com/questions/20797819/command-to-change-the-default-home-directory-of-a-user
#move user with files:
#usermod -m -d /newhome/username username
#Simply open this file using a text editor, type:
#vi /etc/default/useradd
#The default home directory defined by HOME variable, find line that read as follows:
#HOME=/home
#Replace with:
#HOME=/iscsi/user
#Save and close the file. Now you can add user using regular useradd command:
# useradd vivek
# passwd vivek
#Verify user information:
# finger vivek
apt-get update && \
apt-get install -y bcache-tools && \
sudo dd if=/dev/zero if=/dev/sdb bs=512 count=8 && \
sudo dd if=/dev/zero if=/dev/sdd bs=512 count=8 && \
wipefs -a /dev/sdb && \
wipefs -a /dev/sdd && \
make-bcache -C /dev/sdd -B /dev/sdb --discard --writeback && \
mkfs.ext4 /dev/bcache0 && \
mkdir /mnt/bcache && \
mount /dev/bcache0 /mnt/bcache && \
echo "/dev/bcache0 /mnt/bcache ext4 rw 0 0" >> /etc/fstab