[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#515607: marked as done (partman-auto-lvm: ask how much VG space to use)



Your message dated Tue, 21 Aug 2018 16:19:29 +0000
with message-id <E1fs9NR-0002z6-3a@fasolo.debian.org>
and subject line Bug#515607: fixed in partman-auto-lvm 70
has caused the Debian Bug report #515607,
regarding partman-auto-lvm: ask how much VG space to use
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
515607: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=515607
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: partman-auto-lvm
Version: 32
Severity: wishlist
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch jaunty

Something I've consistently heard from users of guided LVM partitioning
in Ubuntu is that they don't want to go through the full manual
partitioning palaver, but nevertheless they don't want to use up all the
space in the volume group right away. Growing filesystems online is
typically easier than shrinking them, and growing the volume is of
course particularly easy with LVM, but I've come to believe that just
using up all the space at installation time is a bit too crude. I think
we should offer a level of control in between "just use it all
automatically" and "full manual partitioning", namely "how much of this
VG would you like to use?".

The attached patch (against the Ubuntu package, but it doesn't make much
difference) implements this. I've tested it and it seems to be working
rather well. However, I'm interested in other people's thoughts before
going ahead and committing it to d-i proper.

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]
=== modified file 'debian/partman-auto-lvm.templates'
--- debian/partman-auto-lvm.templates	2008-11-15 00:18:10 +0000
+++ debian/partman-auto-lvm.templates	2009-02-13 10:13:18 +0000
@@ -73,3 +73,41 @@ _Description: No physical volume defined
  volume group that does not contain any physical volume.
  .
  Please check the automatic partitioning recipe.
+
+Template: partman-auto-lvm/guided_size
+Type: string
+Default: some number
+# :sl3:
+_Description: Amount of disk space to use for guided partitioning:
+ You may use the whole disk for guided partitioning, or part of it. If you
+ use only part of it, or if you add more disks later, then you will be able
+ to grow logical volumes later using the LVM tools, so using a smaller
+ amount of disk at installation time may offer more flexibility.
+ .
+ The minimum size of the selected partitioning recipe is ${MINSIZE} (or
+ ${PERCENT}); please note that the packages you choose to install may
+ require more space than this. The maximum available size is ${MAXSIZE}.
+ .
+ Hint: "max" can be used as a shortcut to specify the maximum size, or
+ enter a percentage (e.g. "20%") to use that percentage of the maximum size.
+
+Template: partman-auto-lvm/bad_guided_size
+Type: error
+# :sl3:
+_Description: Invalid input
+ You entered "${INPUT}", which was not recognized as a valid size. Please
+ try again.
+
+Template: partman-auto-lvm/big_guided_size
+Type: error
+# :sl3:
+_Description: ${SIZE} is too big
+ You asked for ${SIZE} to be used for guided partitioning, but the available
+ space is only ${MAXSIZE}. Please try again.
+
+Template: partman-auto-lvm/small_guided_size
+Type: error
+# :sl3:
+_Description: ${SIZE} is too small
+ You asked for ${SIZE} to be used for guided partitioning, but the selected
+ partitioning recipe requires at least ${MINSIZE}. Please try again.

=== modified file 'perform_recipe_by_lvm'
--- perform_recipe_by_lvm	2009-02-11 13:39:31 +0000
+++ perform_recipe_by_lvm	2009-02-13 10:13:18 +0000
@@ -52,6 +52,75 @@ scheme="$newscheme"
 
 db_progress STEP 1
 
+# free_size and everything in the scheme are now in (decimal) kilobytes. For
+# conversion to human numbers, we need another multiple of 1000.
+minsize="$(min_size)"
+hminsize="$(longint2human "$minsize"000)"
+hmaxsize="$(longint2human "$free_size"000)"
+minpercent="$(expr 100 \* "$minsize" / "$free_size")"
+
+guided_size=
+while [ -z "$guided_size" ]; do
+	db_set partman-auto-lvm/guided_size "$hmaxsize"
+	db_subst partman-auto-lvm/guided_size MINSIZE "$hminsize"
+	db_subst partman-auto-lvm/guided_size MAXSIZE "$hmaxsize"
+	db_subst partman-auto-lvm/guided_size PERCENT "$minpercent%"
+	db_input high partman-auto-lvm/guided_size || true
+	db_go || return 255
+
+	db_get partman-auto-lvm/guided_size
+	case $RET in
+	    max)
+		guided_size="$free_size"000
+		;;
+	    *%)
+		digits="$(expr "$RET" : '\([1-9][0-9]*\) *%$')"
+		if [ "$digits" ]; then
+			maxmb="$(convert_to_megabytes "$free_size"000)"
+			guided_size="$(($digits * $maxmb / 100))000000"
+		fi
+		;;
+	    *)
+		if valid_human "$RET"; then
+			guided_size="$(human2longint "$RET")"
+		fi
+		;;
+	esac
+
+	if [ -z "$guided_size" ]; then
+		db_subst partman-auto-lvm/bad_guided_size INPUT "$RET"
+		db_input high partman-auto-lvm/bad_guided_size || true
+		db_go || true
+	elif ! longint_le "$guided_size" "$free_size"000; then
+		db_subst partman-auto-lvm/big_guided_size SIZE \
+			"$(longint2human "$guided_size")"
+		db_subst partman-auto-lvm/big_guided_size MAXSIZE "$hmaxsize"
+		db_input high partman-auto-lvm/big_guided_size || true
+		db_go || true
+		guided_size=
+	elif ! longint_le "$minsize"000 "$guided_size"; then
+		db_subst partman-auto-lvm/small_guided_size SIZE \
+			"$(longint2human "$guided_size")"
+		db_subst partman-auto-lvm/small_guided_size MINSIZE "$hminsize"
+		db_input high partman-auto-lvm/small_guided_size || true
+		db_go || true
+		guided_size=
+	fi
+
+	if [ "$guided_size" ]; then
+		# We have a figure in (decimal) megabytes. Convert back to
+		# (decimal) kilobytes, which is what the rest of this is
+		# expecting.
+		guided_size="$(expr 0000"$guided_size" : '0*\(..*\)...$')"
+	fi
+done
+
+use_all=
+if [ "$guided_size" -ge "$free_size" ]; then
+	use_all=1
+fi
+free_size="$guided_size"
+
 expand_scheme
 
 db_progress STEP 1
@@ -86,7 +155,7 @@ foreach_partition '
 		name_number=$(($name_number + 1))
 	fi
 
-	if [ "$last" = yes ]; then
+	if [ "$last" = yes ] && [ "$use_all" ]; then
 		vg_get_info "$VG_name"
 		lv_create $VG_name "$lvname" $FREEPE || autopartitioning_failed
 	else


--- End Message ---
--- Begin Message ---
Source: partman-auto-lvm
Source-Version: 70

We believe that the bug you reported is fixed in the latest version of
partman-auto-lvm, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 515607@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Philipp Kern <pkern@debian.org> (supplier of updated partman-auto-lvm package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 21 Aug 2018 17:50:31 +0200
Source: partman-auto-lvm
Binary: partman-auto-lvm
Architecture: source
Version: 70
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Philipp Kern <pkern@debian.org>
Description:
 partman-auto-lvm - Automatically partition storage devices using LVM (udeb)
Closes: 515607 904184
Changes:
 partman-auto-lvm (70) unstable; urgency=medium
 .
   [ Sven Mueller ]
   * Add ability to limit space used within LVM VG. Originally by
     Colin Watson <cjwatson@ubuntu.com> (Closes: #515607, #904184)
   * Use LC_ALL=C when asking vgs for information
Checksums-Sha1:
 e7f378cd09cd3253f498f9fb045c0cbe57cb9438 1393 partman-auto-lvm_70.dsc
 8104ab8f4519418e0bef84ba878eda45f65f62d2 115788 partman-auto-lvm_70.tar.xz
 3c73c4de66cf3154f1409396ce0c13df0c4d161b 5079 partman-auto-lvm_70_amd64.buildinfo
Checksums-Sha256:
 cc46c650c0af36c353c8419ecde9e241afa0de016e3c9786ef5bc0e77bd75789 1393 partman-auto-lvm_70.dsc
 23b555ee58a8e6bd04837fa9165c07c73f443566e7243d78b1f559014aaf87b1 115788 partman-auto-lvm_70.tar.xz
 5ade8daa6789944dc32128a22d1773ac96f32cf92fcd6d6481745c9c9ddb0d82 5079 partman-auto-lvm_70_amd64.buildinfo
Files:
 520d27756187e092e11bac24745968df 1393 debian-installer optional partman-auto-lvm_70.dsc
 95fb547ef0b31ece7774d27fa203a6f1 115788 debian-installer optional partman-auto-lvm_70.tar.xz
 d917fb29f3916dccb6bfa9e0bd1b9ce3 5079 debian-installer optional partman-auto-lvm_70_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQFFBAEBCgAvFiEEPzuChCNsw7gPxr3/RG4lRTXQVuwFAlt8OFkRHHBrZXJuQGRl
Ymlhbi5vcmcACgkQRG4lRTXQVuzXuQf/QsOhaXGG/tp7NmhZQ/gh/T1BWKahrDEz
De8aUqotRw2ylnqkb3iEGD4YGpWD8XvkXoXD76/S3TGVTQ9coBwmCzw+6eNOgaM2
aXI/VHz49XSld7oqEpAxoKOI2LbcauUyY1JUu7E2DDrz2CFcJPMaqHE6mWITEWQ5
nRrmnziYd+OGWcL/O5AMkhe+pV4jQKTBogo9D7ulRVJd+2r521Ki/z0s3g1V6TAV
2Y9wPGAyUEjTQnfQdNp489owg/+fAUIO/4MnlOYeT4lY/gyhgIfJ8RJKS31F1m3V
CBGfEu5gN7fMyjtMELiuNYxfhev8Tmnwwx7QsE6dK0hDWPlAcXArtg==
=pgS2
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: