0001-Revert-Use-sfdisk-instead-of-parted-to-resize-root-p.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From f372cd46df94d5a67286aee923b9908d1326e040 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
  3. <marmarek@invisiblethingslab.com>
  4. Date: Sun, 24 Feb 2019 03:58:11 +0100
  5. Subject: [PATCH] Revert "Use sfdisk instead of parted to resize root partition
  6. table"
  7. Organization: Invisible Things Lab
  8. Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  9. util-linux in Debian is too old for this, because the bug
  10. karelzak/util-linux#532, which is fixed only in util-linux 2.31.1+
  11. (Debian stretch has 2.29.2).
  12. This reverts commit 9792438b3f02161e03d89dfd527ca2459092b478.
  13. ---
  14. misc/resize-rootfs | 9 +++++++--
  15. 1 file changed, 7 insertions(+), 2 deletions(-)
  16. diff --git a/misc/resize-rootfs b/misc/resize-rootfs
  17. index 1c2fca3c..bebf1011 100755
  18. --- a/misc/resize-rootfs
  19. +++ b/misc/resize-rootfs
  20. @@ -8,8 +8,13 @@ case "$(stat -Lc %t:%T /dev/mapper/dmroot)" in
  21. # nothing needed, xvda used directly
  22. ;;
  23. ca:3)
  24. - # resize partition table itself and xda3 partition
  25. - echo ',+' | sfdisk --no-reread -q -N 3 /dev/xvda
  26. + # resize partition table itself
  27. + # use undocumented ---pretend-input-tty (yes, three '-') to
  28. + # force unattended operation, otherwise it aborts on first
  29. + # prompt, even with '-s' option
  30. + echo fix | parted ---pretend-input-tty /dev/xvda print >/dev/null
  31. + # then resize 3rd partition, even though it is mounted
  32. + echo yes 100% | parted ---pretend-input-tty /dev/xvda resizepart 3
  33. # and reload partition table; prefer partprobe over blockdev
  34. # --rereadpt, as it works on mounted partitions
  35. partprobe /dev/xvda
  36. --
  37. 2.17.2