LVM HOWTO
Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux – PART 1
How to Extend/Reduce LVM’s (Logical Volume Management) in Linux – Part II
How to Take ‘Snapshot of Logical Volume and Restore’ in LVM – Part III
Создание lvm snapshot и восстановление из него
13.4. Taking a Backup Using Snapshots
Создание lvm снапшота и восстановление из него.
Стенд pg 9.6.15 pg_probackup
$ sudo su postgres -c "createdb --username postgres -T template0 demo"
$ time sudo su postgres -c "pg_restore -d demo -j 4 /home/user/demo.dump"
$ df -h
$ sudo pg_ctlcluster 9.6 main stop
$ sudo lvs
$ sudo lvcreate --size 500G --snapshot --name lv_snap /dev/vg/lv
$ sudo pg_ctlcluster 9.6 main start
$ sudo lvs
$ sudo mkdir /lv_snap
$ sudo lvscan
ACTIVE Original '/dev/vg/lv' [953,67 GiB] inherit
ACTIVE Snapshot '/dev/vg/lv_snap' [500,00 GiB] inherit
$ sudo mount /dev/vg/lv_snap /lv_snap
$ sudo mkdir -p /backup/main
$ sudo chown -R postgres:postgres /backup/main
$ sudo su postgres -c "cd /lv_snap/9.6/main ; cp -r * /backup/main"
$ sudo umount /lv_snap
$ sudo lvremove /dev/vg/lv_snap
Do you really want to remove and DISCARD active logical volume vg/lv_snap? [y/n]: y
Logical volume "lv_snap" successfully removed
Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux – PART 1
How to Extend/Reduce LVM’s (Logical Volume Management) in Linux – Part II
How to Take ‘Snapshot of Logical Volume and Restore’ in LVM – Part III
Создание lvm snapshot и восстановление из него
13.4. Taking a Backup Using Snapshots
Создание lvm снапшота и восстановление из него.
Стенд pg 9.6.15 pg_probackup
$ sudo su postgres -c "createdb --username postgres -T template0 demo"
$ time sudo su postgres -c "pg_restore -d demo -j 4 /home/user/demo.dump"
$ df -h
$ sudo pg_ctlcluster 9.6 main stop
$ sudo lvs
$ sudo lvcreate --size 500G --snapshot --name lv_snap /dev/vg/lv
$ sudo pg_ctlcluster 9.6 main start
$ sudo lvs
$ sudo mkdir /lv_snap
$ sudo lvscan
ACTIVE Original '/dev/vg/lv' [953,67 GiB] inherit
ACTIVE Snapshot '/dev/vg/lv_snap' [500,00 GiB] inherit
$ sudo mount /dev/vg/lv_snap /lv_snap
$ sudo mkdir -p /backup/main
$ sudo chown -R postgres:postgres /backup/main
$ sudo su postgres -c "cd /lv_snap/9.6/main ; cp -r * /backup/main"
$ sudo umount /lv_snap
$ sudo lvremove /dev/vg/lv_snap
Do you really want to remove and DISCARD active logical volume vg/lv_snap? [y/n]: y
Logical volume "lv_snap" successfully removed
Комментариев нет:
Отправить комментарий