Linux Filesystems – Convert Ext4 Partition to Existing Btrfs Volume

btrfsfilesystemslinux

I recently installed Fedora on my laptop and I have my old /home ext4 partition (/dev/sdb2).
I would like to convert then merge this partition with the btrfs filesystem.

Here is my current setup :

$: btrfs filesystem show
Label: 'fedora'  uuid: accd2db4-87ca-4c78-84b9-4500534d63f5
    Total devices 2 FS bytes used 7.76GiB
    devid    1 size 236.89GiB used 1.02GiB path /dev/sda3
    devid    2 size 500.00GiB used 9.01GiB path /dev/sdb1


$: sudo btrfs subvolume list /
ID 256 gen 1007 top level 5 path root
ID 257 gen 1007 top level 5 path home
ID 258 gen 888 top level 256 path var/lib/machines


$: parted -l
...

Model: ATA Samsung SSD 860 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size   File system  Name         Flags
 1      1049kB  537GB   537GB  btrfs
 2      537GB   1000GB  463GB  ext4         Linux /home  linux-home

As a result I would have a single Btrfs volume (Label: fedora), containing the /dev/sdb2 partition data.

I've found this article to convert an Ext partition to Btrfs, but I don't know if it's possible merge two Btrfs volumes.

Best Answer

  • move the files
  • delete the second partition
  • extend the first partition
  • extend the filesystem
Related Topic