I am running Ubuntu 16.04 on a HP laptop with a core I3 processor. I am trying to run mariaDB and do hot backups to disk. In order to do that I wanted to create an LVM snapshot and backup the snapshot for a point in time backup, possibly using tar. I included a snapshot of the gparted app showing the volumes that I created.
Here is the OS info:
$: cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
Here is the output of pvdisplay:
$: /dev/mapper# pvdisplay
--- Physical volume ---
PV Name /dev/sda5
VG Name mysql_backup
PV Size 97.79 GiB / not usable 0
Allocatable yes
PE Size 4.00 MiB
Total PE 25033
Free PE 25033
Allocated PE 0
PV UUID pYsATM-Sa7g-DHXL-YsxY-u773-eeuK-O2AmEd
--- Physical volume ---
PV Name /dev/sda4
VG Name mysql_data
PV Size 97.79 GiB / not usable 2.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 25033
Free PE 0
Allocated PE 25033
PV UUID UzE6c9-JhGh-nthP-9qvd-0Oi1-GMdy-ifwo3c
--- Physical volume ---
PV Name /dev/mapper/sda3_crypt
VG Name ubuntu-vg
PV Size 500.10 GiB / not usable 1.40 MiB
Allocatable NO
PE Size 4.00 MiB
Total PE 128025
Free PE 9
Allocated PE 128016
PV UUID 6b62NM-FzeS-kOsG-utXD-ysci-NRMJ-Xgw0cw
Here is the output of the lvdisplay:
:/dev/mapper# lvdisplay
--- Logical volume ---
LV Path /dev/mysql_data/lvroot
LV Name lvroot
VG Name mysql_data
LV UUID ta5S3W-GLh2-FI6q-Ofhd-Pz8k-yvIe-RLR6xj
LV Write Access read/write
LV Creation host, time Buck, 2016-08-31 22:43:59 -0400
LV Status available
# open 1
LV Size 97.79 GiB
Current LE 25033
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
--- Logical volume ---
LV Path /dev/ubuntu-vg/root
LV Name root
VG Name ubuntu-vg
LV UUID c9xNwX-ucFB-VL29-h0E1-99oa-pcdx-d6pHVV
LV Write Access read/write
LV Creation host, time ubuntu, 2016-06-24 23:16:33 -0400
LV Status available
# open 1
LV Size 500.00 GiB
Current LE 128000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:3
--- Logical volume ---
LV Path /dev/ubuntu-vg/swap_1
LV Name swap_1
VG Name ubuntu-vg
LV UUID yJwGxd-GNbd-YhXg-24sS-4GR9-T258-HfJ5RH
LV Write Access read/write
LV Creation host, time ubuntu, 2016-08-06 23:24:33 -0400
LV Status available
# open 0
LV Size 64.00 MiB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:4
My intent was that the volume /mysql_backup is the snapshot. I would like to make this into a backup script that I could run on demand and practice backup and recovery so that I could hopefully support mariaDB databases as a DBA. I just need to know how to setup the snapshot. I have looked through numerous websites trying to get it set up and I seem to be going in circles. Please let me know if there is something I did not explain properly. Thanks.