Skip to content

Instantly share code, notes, and snippets.

@m00nwtchr
Last active December 5, 2024 09:58
Show Gist options
  • Select an option

  • Save m00nwtchr/514a2d36eeeeff90452dc60cd0b62b15 to your computer and use it in GitHub Desktop.

Select an option

Save m00nwtchr/514a2d36eeeeff90452dc60cd0b62b15 to your computer and use it in GitHub Desktop.

References

Step 1: Identify Your Drive Type

  1. Boot into the EndeavourOS live environment.

  2. Open a terminal and run the following command to list all drives:

    lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT
    • Drives will appear as sdXn (e.g., /dev/sda1) for SATA drives or nvmeXn (e.g., /dev/nvme0n1p1) for NVMe SSDs.
    • Identify the partition where your root (/) filesystem resides.

Step 2: Convert EXT4 to Btrfs

  1. Convert the root (/) partition from EXT4 to Btrfs using the following command:

    sudo btrfs-convert /dev/sdXn

    Replace /dev/sdXn with your root partition, e.g., /dev/sda1 or /dev/nvme0n1p1.


Step 3: Create a New Home Subvolume

  1. Mount the converted Btrfs partition:

    sudo mount /dev/sdXn /mnt
  2. Create the @home subvolume:

    sudo btrfs subvolume create /mnt/@home
  3. Move your existing /home data to the new subvolume using rsync:

    cd /mnt/home
    sudo rsync -ar --link-dest=. ./ /mnt/@home/

    This command ensures that all files from /home are moved to the @home subvolume.

  4. Verify that all files have been copied correctly:

    ls /mnt/@home

Step 4: Clean Up the Old Filesystem

  1. Change to the mount point and remove everything except the @home subvolume:

    cd /mnt
    ls -la
    sudo rm -rf bin boot dev etc lib lib64 media mnt opt proc root run sbin srv sys tmp usr var home
    ls -la
  2. Remove the old ext2_saved subvolume created by the conversion process:

    sudo btrfs subvolume delete /mnt/ext2_saved
  3. Unmount the partition:

    sudo umount /mnt

Step 5: Install EndeavourOS

  1. Launch the EndeavourOS installer and start the installation process.
  2. When you reach the partitioning step, select the existing Btrfs partition.
  3. Choose manual partitioning and assign subvolumes:
    • / (new subvolume, @)
    • /home (use the existing @home subvolume)
  4. Continue with the installation as normal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment