This was so good I had to repost it here. It is about a useful utility called pv which shows a progress report of running processes:
http://www.dp.cx/blog/pv--one-of-the-most-useful-applications-around.html
This is a repository of all of my Linux/Unix writings as well as useful tips and tricks for systems administration, engineering, and programming.
Showing posts with label pv. Show all posts
Showing posts with label pv. Show all posts
Thursday, February 23, 2012
Wednesday, October 8, 2008
LVM snapshots
Here is a script to create LVM snapshots in Linux. It is a skeleton only provided for your modification and my reference, but I am using AoE storage as my PV.
#create PV
pvcreate /dev/etherd/e1.0
#create VG
vgcreate cascade /dev/etherd/e1.0
#create LV
lvcreate cascade -n original -L 500G
#make XFS filesystem
mkfs.xfs /dev/cascade/original
#mount (and use) LV
mount /dev/cascade/original /mnt
#freeze filesystem (will hang processes that are using IO on /mnt)
xfs_freeze -f /mnt
#create snapshot of original (works best if it is the same size)
lvcreate -s /dev/cascade/original -n backup -L 500G
#mount snapshot
mount -o nouuid,ro /dev/cascade/backup /mnt2
#backup directory with rsync or backup utility
#unmount LV
umount /mnt2
#remove snapshot
lvremove /dev/cascade/backup
#additional information is found here: http://arstechnica.com/articles/columns/linux/linux-20041013.ars and here: http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html
#create PV
pvcreate /dev/etherd/e1.0
#create VG
vgcreate cascade /dev/etherd/e1.0
#create LV
lvcreate cascade -n original -L 500G
#make XFS filesystem
mkfs.xfs /dev/cascade/original
#mount (and use) LV
mount /dev/cascade/original /mnt
#freeze filesystem (will hang processes that are using IO on /mnt)
xfs_freeze -f /mnt
#create snapshot of original (works best if it is the same size)
lvcreate -s /dev/cascade/original -n backup -L 500G
#mount snapshot
mount -o nouuid,ro /dev/cascade/backup /mnt2
#backup directory with rsync or backup utility
#unmount LV
umount /mnt2
#remove snapshot
lvremove /dev/cascade/backup
#additional information is found here: http://arstechnica.com/articles/columns/linux/linux-20041013.ars and here: http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html
Subscribe to:
Posts (Atom)