Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Piotr Gawron
minerva-scripts
Commits
e6d9609f
Commit
e6d9609f
authored
Jun 25, 2018
by
Piotr Gawron
Browse files
script for creating partition that should be used by postgres
parent
7f661b63
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/create-partition.sh
0 → 100755
View file @
e6d9609f
#!/bin/bash
db_disk
=
"/dev/vdb"
db_location
=
"/var/lib/postgresql"
#check if disk is available
if
[
-e
$db_disk
]
then
file_system_ok
=
`
sudo
fsck
-N
/dev/vdb |grep ext4 |wc
-l
`
if
[
"
$file_system_ok
"
=
"0"
]
then
echo
"Initializing file system"
sudo
mkfs.ext4
$db_disk
echo
"Mounting file system"
sudo mkdir
-p
$db_location
sudo echo
"
$db_disk
$db_location
ext4 defaults 0 0"
>>
/etc/fstab
sudo
mount
$db_disk
else
echo
"File system alredy exists. Aborting"
exit
1
fi
else
echo
"Disk for database not found:
$db_disk
"
fi
exit
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment