{"id":120,"date":"2025-08-15T16:16:23","date_gmt":"2025-08-15T16:16:23","guid":{"rendered":"https:\/\/www.beitsahour.net\/?p=120"},"modified":"2025-08-15T16:16:23","modified_gmt":"2025-08-15T16:16:23","slug":"resizing-another-too-small-boot-partition-live-and-in-place","status":"publish","type":"post","link":"https:\/\/www.beitsahour.net\/index.php\/2025\/08\/15\/16\/16\/resizing-another-too-small-boot-partition-live-and-in-place\/","title":{"rendered":"Resizing another too small \/boot partition. Live and in-place."},"content":{"rendered":"<p>Debian 13 &#8220;Trixie&#8221; has updated the minimum <code>\/boot<\/code> size to 768MiB. This laptop was installed with a <code>\/boot<\/code> of only 488MiB \u2014 just enough to upgrade to Trixie, but likely to cause issues in the future. Unfortunately, an encrypted LVM partition is directly adjacent to the <code>\/boot<\/code> partition, so we cannot simply resize it. Instead, we\u2019ll recreate both partitions. Thanks to the magic of LVM, we\u2019ll do this live and in place.<\/p>\n<p>This process should be safe, but I have a backup in place using the excellent <strong>Relax and Recover<\/strong>.<\/p>\n<p>We will attach an external drive (<code>\/dev\/sdb<\/code>) to the volume group, move the logical volumes to it, repartition the internal drive (<code>\/dev\/sda<\/code>), and then move everything back.<\/p>\n<h2>Step 1 \u2014 Prepare the External Drive<\/h2>\n<p>We\u2019ll use an external disk (<code>\/dev\/sdb<\/code>) as a temporary storage location.<\/p>\n<ol>\n<li><strong>Wipe and partition the disk<\/strong>:<br \/> Wipe existing signatures:<br \/> <code>wipefs -a \/dev\/sdb<\/code><br \/> Then use <code>gpart<\/code> (or another partitioning tool) to create a single partition large enough to hold all the data from the LVM volumes you\u2019ll move.<\/li>\n<li><strong>Encrypt the new partition<\/strong>:<br \/> <code>cryptsetup luksFormat \/dev\/sdb1<\/code><\/li>\n<li><strong>Open the encrypted partition<\/strong>:<br \/> <code>cryptsetup luksOpen \/dev\/sdb1 sdb1_crypt<\/code><\/li>\n<li><strong>Mark for LVM and add to VG<\/strong>:<br \/> <code>pvcreate \/dev\/mapper\/sdb1_crypt<\/code><br \/> <code>vgextend laptop-vg \/dev\/mapper\/sdb1_crypt<\/code><\/li>\n<\/ol>\n<h2>Step 2 \u2014 Move Data to the External Drive<\/h2>\n<p>Run the following to move all data off the internal encrypted volume:<\/p>\n<pre><code>pvmove --autobackup y --atomic \/dev\/mapper\/sda3_crypt<\/code><\/pre>\n<p>If the volume group becomes inconsistent, re-add <code>sda3_crypt<\/code> and clean it up:<\/p>\n<pre><code>cryptsetup luksOpen \/dev\/sda3 sda3_crypt\nvgck --updatemetadata laptop-vg\nvgreduce laptop-vg \/dev\/mapper\/sda3_crypt<\/code><\/pre>\n<h2>Step 3 \u2014 Resize \/boot<\/h2>\n<ol>\n<li>Unmount <code>\/boot\/efi<\/code>: <code>umount \/boot\/efi<\/code><\/li>\n<li>Backup <code>\/boot<\/code>: <code>tar -cavf \/boot.tar.xz \/boot<\/code><\/li>\n<li>Unmount <code>\/boot<\/code>: <code>umount \/boot<\/code><\/li>\n<li>Delete and recreate <code>\/dev\/sda2<\/code> as a 1GiB partition using <code>gpart<\/code>, then reload the partition table: <code>partprobe \/dev\/sda<\/code><\/li>\n<li>Run <code>fsck \/dev\/sda2<\/code> and <code>resize2fs \/dev\/sda2<\/code><\/li>\n<\/ol>\n<h2>Step 4 \u2014 Recreate the Encrypted Volume<\/h2>\n<ol>\n<li>Create the partition using <code>gpart<\/code>, then reload the partition table: <code>partprobe \/dev\/sda<\/code><\/li>\n<li>Encrypt the partition: <code>cryptsetup luksFormat \/dev\/sda3<\/code><\/li>\n<li>Open it: <code>cryptsetup luksOpen \/dev\/sda3 sda3_crypt<\/code><\/li>\n<li>Mark for LVM: <code>pvcreate \/dev\/mapper\/sda3_crypt<\/code><\/li>\n<li>Add to VG: <code>vgextend laptop-vg \/dev\/mapper\/sda3_crypt<\/code><\/li>\n<li>Move data back: <code>pvmove --autobackup y --atomic \/dev\/mapper\/sdb1_crypt<\/code><\/li>\n<li>Remove temporary disk: <code>vgreduce laptop-vg \/dev\/mapper\/sdb1_crypt<\/code><\/li>\n<\/ol>\n<h2>Step 5 \u2014 Update Configuration<\/h2>\n<ol>\n<li>Get the new UUID: <code>lsblk --nodeps --noheadings -o uuid \/dev\/sda3<\/code><\/li>\n<li>Edit <code>\/etc\/crypttab<\/code> with the new UUID<\/li>\n<li>Update initramfs: <code>update-initramfs -k all -u<\/code><\/li>\n<li>Mount <code>\/boot<\/code> and <code>\/boot\/efi<\/code>: <code>mount \/boot &amp;&amp; mount \/boot\/efi<\/code><\/li>\n<li>Reboot and fix any unexpected issues<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Debian 13 &#8220;Trixie&#8221; has updated the minimum \/boot size to 768MiB. This laptop was installed with a \/boot of only 488MiB \u2014 just enough to upgrade to Trixie, but likely to cause issues in the future. Unfortunately, an encrypted LVM partition is directly adjacent to the \/boot partition, so we cannot simply resize it. Instead, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[22,20,10,18,21,23],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-boot","tag-cryptsetup","tag-debian","tag-partition","tag-resize","tag-trixie"],"_links":{"self":[{"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":3,"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":124,"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions\/124"}],"wp:attachment":[{"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beitsahour.net\/index.php\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}