Skip to content

Instantly share code, notes, and snippets.

@jfroy
Created January 28, 2026 17:46
Show Gist options
  • Select an option

  • Save jfroy/93f2ceefb38e9becf08a26ddc429d187 to your computer and use it in GitHub Desktop.

Select an option

Save jfroy/93f2ceefb38e9becf08a26ddc429d187 to your computer and use it in GitHub Desktop.

Plan

Current state

index fs type name offset-size
0 - free 0-1TiB
1 fat32 EFI -
2 ext4 root -
3 swap swap -
4 - free -

Step 1: new EFI partition

index fs type name offset-size
0 fat32 EFI 256-1GiB
1 - - -
2 fat32 EFI -
3 ext4 root -
4 swap swap -
5 - free -
  • Mount 0 (/dst) and 2 (/src).
  • rsync -a /src/ /dst/
  • Unmount 0 and 2
  • Get GPT partition UUID of 2 with tool (fdisk, sdisk, gparted)
  • Delete 2 (old EFI system partiton)
  • Change GPT partition UUID of 0

Step 2: new ext4 partition

index fs type name offset-size
0 fat32 EFI 256-1GiB
1 ext4 new-root -
2 ext4 root -
3 swap swap -
4 - free -
  • Mount 1 (/dst) and 2 (/src).
  • rsync -a /src/ /dst/
  • Unmount 1 and 2
  • Delete 2 (old root)
  • Delete 3 (swap)

Step 3: expand new root ext4

index fs type name offset-size
0 fat32 EFI 256-1GiB
1 ext4 new-root -

profit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment