From 7aedffeb9404e1802b087d8fc9a91a554aa3a1e9 Mon Sep 17 00:00:00 2001 From: ianmdlvl Date: Tue, 5 Apr 2005 19:06:25 +0000 Subject: [PATCH] @@ -1,3 +1,11 @@ +chiark-utils (4.0.99.0.14) unstable; urgency=low + + * /etc/chiark-backup/snap/lvm (backup/lvm in the source tree) now uses + the free extents on the vg as the default size for the snapshot. This + is somewhat better although still not ideal in some cases, obviously. + + -- + chiark-utils (4.0.99.0.13) unstable; urgency=low * Fix usage message for cvs-repomove to be accurate. --- backup/examples/chiark/settings.sh | 2 +- backup/lvm | 10 ++++++---- debian/changelog | 8 ++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/backup/examples/chiark/settings.sh b/backup/examples/chiark/settings.sh index 06d5a97..9544a2d 100755 --- a/backup/examples/chiark/settings.sh +++ b/backup/examples/chiark/settings.sh @@ -1,7 +1,7 @@ # shell script fragment setting options # defaults for currently implemented parameters are #lvm_lv=chiark_backup -#lvm_lvsize_opts=-L +#lvm_lvsize_opts=-l #lvm_lvtools_opts='-A n' #lvm_lvcreate_opts= #lvm_lvcreate_args= diff --git a/backup/lvm b/backup/lvm index 09bda9e..4d897e7 100755 --- a/backup/lvm +++ b/backup/lvm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # invoked by backup scripts as # lvm snap $vardir $device $mountpoint # creates and mounts on $vardir/snap-mount @@ -63,9 +63,11 @@ fstype="$(mount | sed -n \ "s,^$device on $mountpoint type \([a-z0-9][a-z0-9]*\) .*,-t \1 ,p")" if [ -z "$lvm_lvsize_opts" ]; then - df="$(df -P -k $device)" - blocks="$(printf "%s" "$df" | sed -n '2,$s,^/dev/[^ ]*[ ][ ]*[0-9][0-9]*[ ][ ]*\([0-9][0-9]*\)[ ].*,\1,p')" - lvm_lvsize_opts="-L $blocks"K + vggroup="${device#/dev/}" + vggroup="${vggroup%/*}" + vgdisplay_out="$(really vgdisplay -c "$vggroup")" + extents="$(printf "%s" "$vgdisplay_out" | awk -F: '{print $16}')" + lvm_lvsize_opts="-l $extents" fi lvpath="$(dirname "$device")/$lvm_lv" diff --git a/debian/changelog b/debian/changelog index 1a99bed..7701824 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +chiark-utils (4.0.99.0.14) unstable; urgency=low + + * /etc/chiark-backup/snap/lvm (backup/lvm in the source tree) now uses + the free extents on the vg as the default size for the snapshot. This + is somewhat better although still not ideal in some cases, obviously. + + -- + chiark-utils (4.0.99.0.13) unstable; urgency=low * Fix usage message for cvs-repomove to be accurate. -- 2.30.2