![how to create softraid raid10 how to create softraid raid10](https://www.lifewire.com/thmb/g1lrQAyHXheuz7zSVUXLrTdP_Jo=/768x0/filters:no_upscale():max_bytes(150000):strip_icc()/SoftRAIDLite-57c439945f9b5855e58b06e9.jpg)
Sector size (logical/physical ): 512 bytes / 512 bytes If you notice any errors, please contact us.Disk /dev/sda: 120.0 GB, 120034123776 bytesĢ55 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors This entry was posted in Linux and tagged LPIC-2, MySQL, RAID, Ubuntu. Reload apparmor daemon and start mysql server: # service apparmor reloadĬheck mysql logs in case you run into problems: # tail -f /var/log/mysql/error.log Open the configuration file and change datadir appropriatelly: # vim /etc/mysql/my.cnfĬreate an alias for the new path: # echo "alias /var/lib/mysql/ -> /sql_data/," > /etc/apparmor.d/tunables/aliasĬopy all content form the default directory to the new location and change ownership of the folder: # cp -Rp /var/lib/mysql/* /sql_data
![how to create softraid raid10 how to create softraid raid10](https://www.eventreporter.com/common/articles/software_raid_monitoring_windows_2003/software_raid_monitoring_windows_2003_1.png)
Stop the daemon first: # service mysql stop We want to change it to our newly created raid drive. # echo "MAILFROM " > /etc/mdadm/nf Configure MySQLīy default, MySQL stores its data files and databases under /var/lib/mysql on Ubuntu. Optionally, configure email alerts for daily checks to ensure that any degraded MD devices don’t go unnoticed: # echo "MAILADDR " > /etc/mdadm/nf Mount the raid drive: # mount /dev/md0 /sql_dataĬreate a lost+found directory: # cd /sql_data # mklost+foundĭon’t forget to add a record to fstab: # echo "/dev/md0 /sql_data ext4 defaults 0 0" > /etc/fstab To stop a currently running data scrub safely: # echo idle > /sys/block/md0/md/sync_actionĬreate an ext4 filesystem: # mkfs.ext4 /dev/md0 To initiate a data scrub manually: # echo check > /sys/block/md0/md/sync_action Note that it’s good practice to regularly run data scrubbing to check for and fix errors. Synchronisation is done: # cat /proc/mdstat Md0 : active raid10 xvdi1 xvdh1 xvdg1 xvdf1Ĥ189184 blocks super 1.2 512K chunks 2 near-copies Wait for the array to finish synchronising disks: # watch cat /proc/mdstat Scan and activate the array automatically on startup: # mdadm -detail -scan -verbose > /etc/mdadm/nf Mdadm: Defaulting to version 1.2 metadata dev/xvdi1 2048 4194303 2096128 fd Linux raid autodetectĬreate the RAID10 array: # mdadm -C /dev/md0 -l 10 -n 4 /dev/xvdf1 /dev/xvdg1 /dev/xvdh1 /dev/xvdi1 -v We have 4x2GB disks pre-configured for Linux raid: # fdisk -l | grep /dev/xvĭisk /dev/xvda1 doesn't contain a valid partition tableĭisk /dev/xvda1: 8589 MB, 8589934592 bytesĭisk /dev/xvdf: 2147 MB, 2147483648 bytes
How to create softraid raid10 install#
Install mdadm and mysql: # apt-get update & apt-get install mdadm mysql-server Create Software RAID10 We’re using Ubuntu 13.10 (Saucy Salamander): # uname -rvģ.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17: We’ll be setting up a Linux software RAID10 and re-configuring MySQL to use it for data files and databases.