-
-
Notifications
You must be signed in to change notification settings - Fork 267
/
createPartitions.sh
58 lines (47 loc) · 939 Bytes
/
createPartitions.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
if lsblk | grep '^sdc.*5G'; then
mv /home/vagrant/.ssh /root/vagrant-ssh
fdisk -u /dev/sdc <<EOF
n
p
1
+500M
n
p
2
+500M
n
p
3
+500M
n
p
4
+500M
w
EOF
mkfs.xfs /dev/sdc1
mkfs.xfs /dev/sdc2
mkfs.xfs /dev/sdc3
mkfs.xfs /dev/sdc4
mkdir -p /var/log/audit
mkdir -p /var/lib/docker
{
echo '/dev/sdc1 /var/log xfs defaults 0 0'
echo '/dev/sdc2 /var/log/audit xfs defaults 0 0'
echo '/dev/sdc3 /home xfs defaults 0 0'
echo '/dev/sdc4 /var/lib/docker xfs defaults 0 0'
} >> /etc/fstab
mount -t xfs /dev/sdc1 /var/log
mount -t xfs /dev/sdc2 /var/log/audit
mount -t xfs /dev/sdc3 /home
mount -t xfs /dev/sdc4 /var/lib/docker
if grep '^vagrant' /etc/passwd; then
mkdir -p /home/vagrant
mv /root/vagrant-ssh /home/vagrant/.ssh
chown -R vagrant:vagrant /home/vagrant
chmod 0750 /home/vagrant
chmod 0700 /home/vagrant/.ssh
chmod 0600 /home/vagrant/.ssh/*
fi
fi