Store Database Data and Emails on Raid configuration and not on the OS Drive

Discussion in 'Installation/Configuration' started by AndreasZA, Jun 8, 2018.

  1. AndreasZA

    AndreasZA New Member

    Good Day, I'm fairly new to this, so please don't kill me first time out.
    I have a small OS drive with Ubuntu Server 18.04.1 and ISPConfig 3.1.12 installed on it.
    Ok so lets get it out there, I'm surprised I got this going.
    I created a separate raid for the storage and was thinking that automatically this would be seen as the drive to use for databases etc by ISPConfig.
    Noob mistake, my drive is now full.
    So basically I have 2 questions;
    1. How do I get ISPConfig to use the other drive for my databases etc?
    2. Can I move the databases over that are filling up the tiny drive?
    Ok now you are allowed to laugh first and give advice after.
    Below is my configuration;
    OS Type: Linux 4.15.0-22-generic #24-Ubuntu SMP Wed May 16 12:15:17 UTC 2018 x86_64 (64 bit)Server Software: Apache/2.4.29 (Ubuntu)CPU Cores: 8 CoresLoad Average: 0.53, 0.49, 0.46IP (Hostname): ( Space: 0.00 KB (0%) used of 0.00 KB totalDatabase Size: 65.02 MBDatabase Name (Hostname): c1aps1 (localhost:3306)MySQL Version: 10.1.29-MariaDB-6Database Charset (Collate): utf8 (n/a)Document Root: /var/www/ Path: /var/www/clients/client1/web1/web/wp-content/themes/flatsomeWP Locale (Charset): en-US (UTF-8)Server Timezone (WP): UTC (UTC+2)PHP Version: 7.2.5-0ubuntu0.18.04.1PHP Extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, apcu, apc, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imagick, imap, intl, json, exif, memcache, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, pspell, readline, recode, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, Zend OPcacheMax Upload, Post Size (Input Vars): 1024M, 1024M (6000)Memory Usage: 4M (1%) of 600M (actual limit)WP Memory Limit: 40M (defined limit)WP Admin Memory Limit: 600M (defined limit)WP Debug: Disabled (no logging, display)Opcache Size (Max Files, Revalidate): 128M (10000, 2 secs)Page Cache (Plugin): EnabledObject Cache: Disabled
    Last edited: Jun 8, 2018
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    don't have the full instructions, or a link to an article, but I can point you in the direction, and google can do the rest.

    basically, you have the raid drive, I dunno if you have a partition or filesystem on it yet. but once you have. you can mount it onto your main system,
    mount -t <filesystem type> /dev/<partition> /some/mountpoint, eg, assuming ext4 filesystem, drive(partition) sdb(1) and mounting to /mnt/newraiddrive then its:
    mkdir -p /mnt/newraiddrive
    mount -t ext4 /dev/sdb1 /mnt/newraiddrive

    typing df -h will list all the partitions, used/free space etc, so you can see if it's successfully mounted.

    once it's mounted, cp -R /path/to/source /mnt/newraiddrive
    so for websites, cp -R /var/www/ /mnt/newraiddrive
    for databases, cp -R /var/lib/MySQL/ /mnt/newraiddrive

    remember to stop apache/MySQL/whatever before copying the files over.
    once the copy is complete, unmount /mnt/newraiddrive and remount it to the required location /var/www for apache, /var/lib/MySQL for MySQL etc. (move all the files in the original folder somewhere else to be safe before remounting the raid partion - makes sure your not still using the original files, but you still have them if something goes wrong)
    start the relevant service, and check everything is working. if it's all ok, edit /etc/fstab to make sure the raid partition gets mounted at boot time.

Share This Page