|
Re: introduce a backup solution
Use LVM and lvcreate snapshot on free VG space, mount snampshots on /mnt/mountpoint,
mount a storage device and cd /mnt/storagemountpoint/path/to/dir/archives.
Use tar to backup.
Piece of cake, easy as pie.
[root@Ruthie-07 ~]#
[root@Ruthie-07 ~]# uptime
23:29:02 up 1:30, 2 users, load average: 0.02, 0.04, 0.05
[root@Ruthie-07 ~]#
[root@Ruthie-07 ~]#
[root@Ruthie-07 ~]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
home VolGroup71 -wi-ao--- 410.00g
root VolGroup71 -wi-ao--- 31.62g
swap VolGroup71 -wi-ao--- 4.00g
LogVol72Storage VolGroup72 -wi-a---- 600.00g
LogVol73Storage VolGroup72 -wi-a---- 331.00g
[root@Ruthie-07 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.5G 0 1.5G 0% /dev
tmpfs 1.5G 112K 1.5G 1% /dev/shm
tmpfs 1.5G 2.8M 1.5G 1% /run
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/mapper/VolGroup71-root 32G 5.3G 25G 18% /
tmpfs 1.5G 16K 1.5G 1% /tmp
/dev/sda1 504M 130M 350M 27% /boot
/dev/mapper/VolGroup71-home 404G 2.7G 381G 1% /home
[root@Ruthie-07 ~]# mount /dev/mapper/VolGroup72-LogVol72Storage /mnt/storage72
[root@Ruthie-07 ~]# lvcreate --size 4G --snapshot --name /dev/VolGroup71/snaproot /dev/VolGroup71/root
Logical volume "snaproot" created
[root@Ruthie-07 ~]# lvcreate --size 4G --snapshot --name /dev/VolGroup71/snaphome /dev/VolGroup71/home
Logical volume "snaphome" created
[root@Ruthie-07 ~]# mount /dev/VolGroup71/snaproot /mnt/snaproot
[root@Ruthie-07 ~]# mount /dev/VolGroup71/snaphome /mnt/snaphome
[root@Ruthie-07 ~]# cd /mnt/storage72/BKUPS/tararchives
[root@Ruthie-07 tararchives]# ls -l *1214*.tar
-rw-r--r--. 1 root root 117981184 Dec 14 16:40 bkupboot12142012fc18.tar
-rw-r--r--. 1 root root 956153856 Dec 14 16:42 bkuphome12142012fc18.tar
-rw-r--r--. 1 root root 5516017664 Dec 14 16:54 bkuproot12142012fc18.tar
[root@Ruthie-07 tararchives]# tar -c -f bkupboot12152012fc18.tar /boot --preserve-permissions --preserve-order --xattrs --totals -b32
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
Total bytes written: 117981184 (113MiB, 37MiB/s)
[root@Ruthie-07 tararchives]# tar -c -f bkuphome12152012fc18.tar /mnt/snaphome --preserve-permissions --preserve-order --xattrs --totals -b32 --exclude=*.iso --exclude=*.vdi
tar: Removing leading `/' from member names
Total bytes written: 969850880 (925MiB, 26MiB/s)
[root@Ruthie-07 tararchives]# tar -c -f bkuproot12152012fc18.tar /mnt/snaproot --preserve-permissions --preserve-order --xattrs --one-file-system --totals -b32
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
Total bytes written: 5508612096 (5.2GiB, 8.9MiB/s)
[root@Ruthie-07 tararchives]# uptime
23:48:17 up 1:49, 2 users, load average: 0.97, 0.95, 0.56
[root@Ruthie-07 tararchives]# ls -l *1215*.tar
-rw-r--r--. 1 root root 117981184 Dec 14 23:36 bkupboot12152012fc18.tar
-rw-r--r--. 1 root root 969850880 Dec 14 23:37 bkuphome12152012fc18.tar
-rw-r--r--. 1 root root 5508612096 Dec 14 23:48 bkuproot12152012fc18.tar
[root@Ruthie-07 tararchives]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
home VolGroup71 owi-aos-- 410.00g
root VolGroup71 owi-aos-- 31.62g
snaphome VolGroup71 swi-aos-- 4.00g home 0.05
snaproot VolGroup71 swi-aos-- 4.00g root 3.92
swap VolGroup71 -wi-ao--- 4.00g
LogVol72Storage VolGroup72 -wi-ao--- 600.00g
LogVol73Storage VolGroup72 -wi-a---- 331.00g
[root@Ruthie-07 tararchives]# umount /mnt/snaphome /mnt/snaproot
[root@Ruthie-07 tararchives]# lvremove /dev/VolGroup71/snaphome
Do you really want to remove active logical volume snaphome? [y/n]: y
Logical volume "snaphome" successfully removed
[root@Ruthie-07 tararchives]# lvremove /dev/VolGroup71/snaproot
Do you really want to remove active logical volume snaproot? [y/n]: y
Logical volume "snaproot" successfully removed
[root@Ruthie-07 tararchives]# cd /home/darwinhwebb/Downloads
[root@Ruthie-07 Downloads]# cp -a -n -t /mnt/storage72/BKUPS/YR2013 usb-*
[root@Ruthie-07 Downloads]# cd /
(reverse-i-search)`umount': umount /mnt/storage72
SJ
__________________
Do the Math
|