Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: How to migrate from btrfs to ext4 ?

  1. #1
    Join Date
    Sep 2008
    Location
    Argentina
    Posts
    139

    Default How to migrate from btrfs to ext4 ?

    Hello

    I want to migrate from btrfs to ext4 on leap 15.0
    Btrfs needs a lot of cpu after a crash and other times too on netbooks so I want to go back to ext4.

    My question: What is the right way to backup and restore whole system?
    Dump does not work, the only solution I see is with tar, recreated partitions and restore with a live system.

    Any other idea?

    Thanks

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,603

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by tkmbe View Post
    Dump does not work, the only solution I see is with tar, recreated partitions and restore with a live system.

    Any other idea?
    That is how I would do it. Thus, no, not another idea

    BTW, I am not sure that "recreating partitions" is needed. Just create an ext4 file system on the existing partition is enough. Except if you of course have other wishes the just what your title and post say.
    Last edited by hcvv; 23-Apr-2019 at 05:05.
    Henk van Velden

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,009
    Blog Entries
    3

    Default Re: How to migrate from btrfs to ext4 ?

    Yes, I would do what you suggest -- using "tar" for the backup.

    And note that after restore, you probably need to reinstall grub. And you need to fix any UUID in "/etc/fstab" (and "/etc/crypttab" if that file exists).

    I've been using "ext4" all along. I experimented with "btrfs" for a while, then changed to "ext4". But I did that with a reinstall -- it was Tumbleweed, so I reinstalled with the current iso.

    You might want to consider reinstall, except use Leap 15.1 for the reinstall (currently at a release candidate level).
    openSUSE Leap 15.1; KDE Plasma 5;

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,634
    Blog Entries
    1

    Default Re: How to migrate from btrfs to ext4 ?

    I've only recently started thinking about this, here are some suggestions if you want to try an in place conversion (of course when experimenting you should make sure your data is fully backed up).

    First,
    You have to consider the BTRFS volume/sub-volume structure.
    I don't know if that can be left in place, noting that the YaST Volume Manager module is supposed to manage both LVM and BTRFS volumes seamlessly (I haven't verified this but take documentation at word).
    If you want to instead convert subvolumes to directories, the following may provide some guidance... The posters didn't actually convert anything, they appear to have created new and then copied data from old to new.

    https://www.reddit.com/r/archlinux/c..._into_regular/

    The data in the parent volume is easier to address.
    The following "fstransform" is supposed to be able to convert almost any filestem to another including BTRFS to EXT4

    https://software.opensuse.org/packag...rm=fstransform
    https://github.com/cosmos72/fstransform

    If all this seems too much trouble especially if your system is very new and has very little customization, you would likely find it easier and more sure to simply save your data to an external location and re-install.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,349

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by tkmbe View Post
    My question: What is the right way to backup and restore whole system?
    If you're on Leap 15.0 then, there's usually a Btrfs system partition and, an XFS User (/home) partition.

    Simply overwrite the existing Btrfs system partition with a new ext4 system partition and, leave the XFS User (/home) partition as it is -- do not recreate the /home partition …

    • After the reinstallation has completed, review the Package list you saved to your home directory (which shouldn't have been touched by the reinstallation process) and, reinstall any missing packages.
    • Of course, you should, before starting, backup your Home partition to another drive – an attached disk or a NAS.
    • There's no real need to backup to system partition as such but, the list of user's using the system does of course need to be backed up and, any customized system settings.
    • If you're not using LDAP to authenticate the people using the system then, they'll have to re-enter their passwords when the system comes back online after the system partition change – the files ‘passwd’ and ‘shadow’ in “/etc” will be recreated, with new keys, by the re-installation.
    • Don't forget to make a note of the password for the user “root” before performing the re-installation …

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,634
    Blog Entries
    1

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by dcurtisfra View Post
    If you're on Leap 15.0 then, there's usually a Btrfs system partition and, an XFS User (/home) partition.

    Simply overwrite the existing Btrfs system partition with a new ext4 system partition and, leave the XFS User (/home) partition as it is -- do not recreate the /home partition …

    • After the reinstallation has completed, review the Package list you saved to your home directory (which shouldn't have been touched by the reinstallation process) and, reinstall any missing packages.
    • Of course, you should, before starting, backup your Home partition to another drive – an attached disk or a NAS.
    • There's no real need to backup to system partition as such but, the list of user's using the system does of course need to be backed up and, any customized system settings.
    • If you're not using LDAP to authenticate the people using the system then, they'll have to re-enter their passwords when the system comes back online after the system partition change – the files ‘passwd’ and ‘shadow’ in “/etc” will be recreated, with new keys, by the re-installation.
    • Don't forget to make a note of the password for the user “root” before performing the re-installation …
    If you don't have to deal with any subvolumes, you might be able to simply run the "fstransform" utility I mentioned.
    Am guessing that the remaining Volume structure can be managed like an LVM volume, but would need to be verified...
    I'm also guessing that any such operations on the root partition would need to be done by unmounting the partition first which would mean running fstransform from an alternate boot like a LiveCD. I don't know that this kind of relatively low level disk operation would be done through a re-boot although it's probably technically possible.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  7. #7
    Join Date
    Sep 2012
    Posts
    4,921

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by tsu2 View Post
    The following "fstransform" is supposed to be able to convert almost any filestem to another including BTRFS to EXT4
    Code:
    Currently, the programs mentioned above have been tested on Linux with the following filesystems, both as source and as target: ext2, ext3, ext4, jfs, reiserfs, xfs.
    
    Do NOT use these programs with other filesystems unless you are willing to LOSE your data.

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,634
    Blog Entries
    1

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by arvidjaar View Post
    Code:
    Currently, the programs mentioned above have been tested on Linux with the following filesystems, both as source and as target: ext2, ext3, ext4, jfs, reiserfs, xfs.
    
    Do NOT use these programs with other filesystems unless you are willing to LOSE your data.
    The warning you found is boilerplate that applies to general use of fstransform and is not specific to BTRFS.

    First, if anyone wants to use fstransform, although the openSUSE package might work, its codebase is about 4 years old and the fstransform project on Github indicates last major codebase changes were 2 years ago with minor patching since... and as recently as a few weeks ago. If you're in a hurry, you may want to build from the Github source, else check the date in the OBS repo.

    The fstransform Github page
    https://github.com/cosmos72/fstransform
    The fstransform OBS for the package
    https://build.opensuse.org/package/s...ms/fstransform

    The first thing to note in the project's TODO page is that a group of file systems that include BTRFS is just not tested adequately that the author can feel comfortable supporting officially. Note that the TODO page was last updated in 2017, and documentation is slow to be updated... NTFS "experimental" support was added 2 years ago, NTFS testing was completed satisfactorily a year ago and yet this TODO page has not been updated.

    https://github.com/cosmos72/fstransf...ob/master/TODO

    Some people have gone ahead and used fstransform to convert their BTRFS to EXT4 anyway and been successful, you can find those postings by doing an Internet search "fstransform btrfs to ext4"

    To run fstransform doing this conversion, you may need to add the "--force-untested-file-systems" option as follows, and is described in this Fedora article dated January 2019
    https://bzdww.com/article/100042/
    Code:
     fstransform /dev/sdb1 btrfs --force-untested-file-systems
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  9. #9
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    794

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by tkmbe View Post
    Hello

    I want to migrate from btrfs to ext4 on leap 15.0
    Btrfs needs a lot of cpu after a crash and other times too on netbooks so I want to go back to ext4.

    My question: What is the right way to backup and restore whole system?
    Dump does not work, the only solution I see is with tar, recreated partitions and restore with a live system.

    Any other idea?

    Thanks
    You may install squashfs and try mksquashfs: http://tldp.org/HOWTO/SquashFS-HOWTO...gandusing.html
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

  10. #10
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,349

    Default Re: How to migrate from btrfs to ext4 ?

    Quote Originally Posted by tsu2 View Post
    Am guessing that the remaining Volume structure can be managed like an LVM volume, but would need to be verified...
    I'm also guessing that any such operations on the root partition would need to be done by unmounting the partition first which would mean running fstransform from an alternate boot like a LiveCD. I don't know that this kind of relatively low level disk operation would be done through a re-boot although it's probably technically possible.
    I'm suggesting that, the only reliable method is to reinstall – i.e. boot the installation DVD and then perform an installation which will reformat the system partition and, the EFI partition as well but, leave the User partition (/home) “as is” …

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •