chiark / gitweb /
@@ -1,3 +1,11 @@
authorianmdlvl <ianmdlvl>
Tue, 5 Apr 2005 19:06:25 +0000 (19:06 +0000)
committerianmdlvl <ianmdlvl>
Tue, 5 Apr 2005 19:06:25 +0000 (19:06 +0000)
+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
backup/lvm
debian/changelog

index 06d5a97361db13232f44ec72f4330e22d80b4c03..9544a2ded5a6fc2f92ec7fdc847319102904982c 100755 (executable)
@@ -1,7 +1,7 @@
 # shell script fragment setting options
 # defaults for currently implemented parameters are
 #lvm_lv=chiark_backup
 # shell script fragment setting options
 # defaults for currently implemented parameters are
 #lvm_lv=chiark_backup
-#lvm_lvsize_opts=-L <size of space currently used on fs>
+#lvm_lvsize_opts=-l <no. of free extents in vg>
 #lvm_lvtools_opts='-A n'
 #lvm_lvcreate_opts=
 #lvm_lvcreate_args=
 #lvm_lvtools_opts='-A n'
 #lvm_lvcreate_opts=
 #lvm_lvcreate_args=
index 09bda9e811a84fc59b897f560272c559a0bba0a5..4d897e71ae77a2bc00cd477a212bf44ee6bd4eb5 100755 (executable)
@@ -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
 # 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
  "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"
 fi
 
 lvpath="$(dirname "$device")/$lvm_lv"
index 1a99bed363f5320879af2a16a1f73fb9148095df..77018245b1629c7a57ed9eea40f12d5ffb3326bb 100644 (file)
@@ -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.
 chiark-utils (4.0.99.0.13) unstable; urgency=low
 
   * Fix usage message for cvs-repomove to be accurate.