diff options
Diffstat (limited to 'experiment/scripts/database.sh')
-rwxr-xr-x | experiment/scripts/database.sh | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh index 47761fd..736efb9 100755 --- a/experiment/scripts/database.sh +++ b/experiment/scripts/database.sh @@ -17,17 +17,25 @@ cd /tmp # Don't use in combination with `setup_ram_storage` function setup_disks() { if [ -b /dev/disk1 ]; then - echo 'start=2048, type=83' | sfdisk /dev/disk1 || true - yes | mkfs.ext4 -m 0 /dev/disk1 || true - mkdir /mnt/disk || true - mount /dev/disk1 /mnt/disk || true - if [ ! -L /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal ]; then - rm -rf /mnt/disk/pg_wal || true - mv /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal/ /mnt/disk - ln -s /mnt/disk/pg_wal /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal - chown -R postgres:postgres /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal - fi + # Dahu ssd + DISK=/dev/disk1 + elif [ -b /dev/disk4 ]; then + # Yeti nvme + DISK=/dev/disk4 + else + return fi + echo 'start=2048, type=83' | sfdisk ${DISK} || true + yes | mkfs.ext4 -m 0 ${DISK} || true + mkdir /mnt/disk || true + mount ${DISK} /mnt/disk || true + if [ ! -L /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal ]; then + rm -rf /mnt/disk/pg_wal || true + mv /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal/ /mnt/disk + ln -s /mnt/disk/pg_wal /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal + chown -R postgres:postgres /tmp/postgresql/${POSTGRES_VERSION}/main/pg_wal + fi + } # Setup Postgres to use RAM instead of disks to store data |