(solved) Ubuntu. Question re upgrading from ext4 to to btrfs

Noob here. I’m currently using Ubuntu 21.04 with ext4 on an internal 2TB nvme drive (AMD Ryzen with no dual boot). I want to upgrade to 21.10 with btrfs. I’m assuming I need to totally wipe out 21.04 and do a clean install of 21.10 in order to go from ext4 to btrfs. If this assumption is wrong, let me know.

I’ll first do a Clonezilla clone of my main hard drive to an external drive, just in case. Also I’ll have multiple backups of all my user files (FeeFileSync and Restic).

I’ll have Ubuntu 21.10 loaded onto a USB stick ready to install. I’ll select btrfs during the 21.10 install process.

What else do I need to do to help assure this upgrade goes smoothly? I’m a newbie and very much a beginner with Linux. I have very very limited knowledge of the command line. What are the common problems that arise when doing this kind of upgrade?

Yes, you need to reinstall completely to be able to use btrfs. Then it should be all good after you select btrfs from the installer. I am just not sure how far Ubuntu’s implementation of btrfs goes. For example openSUSE and Fedora use btrfs by default whereas Ubuntu uses ext4. So you have to enable it at install time.

Does this mean that Ubuntu has a reputation of many problems and bugs and crashes when run with btrfs? Does this mean that Ubuntu is not really designed or poorly designed to work with btrfs?

Others may have had different experiences and although I have never, yet, used btrfs on a desktop machine my home server is running Ubuntu Server 20.04 with btrfs and has been very reliable.

I’ve even had a couple of disk failures (not both at once :wink: ) and btrfs recovered easily enough after replacing the failed drive.

Not that I know of. I think Ubuntu is just fine, btrfs is just not the default. That is all. Try it out and see for yourself.

After reading this thread upgrade - What do I need to do to install 21.10 with btrfs? - Ask Ubuntu I’m hesitant about installing Ubuntu 21.10 with btrfs. I think I’ll install Ubuntu 21.10 with btrfs in VBox and play around with it using TImeshift and other apps.

Could someone mark this thread as resolved? Thanks.

I really see no problem with it and I also would recommend a fresh install, it is just easier than converting.

I will mark your thread solved. But I think buy now you should have the permission to do that yourself by simply editing the title of your first post.

1 Like

Can you finally install Ubuntu on btrfs on an encrypted disk using the installer?

Thanks. I checked and it seems I’m unable to edit the post title. The forum admins must know I’m still just a noob. :grin:

The forum ranking is based on a few metrics for community involvement (i’d have to hunt it down), it may require reading topics that aren’t your own.

If you need a title changed just use @Ulfnic

Update: I’ve adjusted the forum settings so you should be able to edit your inital posts now if you’d like to give it a test. I recently became an admin so I can make changes.

I checked and I’m unable to edit the title and the body of my original post.

I’ll create a temp account and play around with it, this is getting fixed one way or another.

You can convert an ext4 fs to btrfs with the btrfs-convert tool

From the man page.

BTRFS-CONVERT(8)                                                                                  Btrfs Manual                                                                                 BTRFS-CONVERT(8)

       btrfs-convert - convert from ext2/3/4 or reiserfs filesystem to btrfs in-place

       btrfs-convert [options] <device>

       btrfs-convert is used to convert existing source filesystem image to a btrfs filesystem in-place. The original filesystem image is accessible in subvolume named like ext2_saved as file image.

       Supported filesystems:

       •   ext2, ext3, ext4 — original feature, always built in

       •   reiserfs — since version 4.13, optionally built, requires libreiserfscore 3.6.27

       The list of supported source filesystem by a given binary is listed at the end of help (option --help).

           If you are going to perform rollback to the original filesystem, you should not execute btrfs balance command on the converted filesystem. This will change the extent layout and make btrfs-convert
           unable to rollback.

       The conversion utilizes free space of the original filesystem. The exact estimate of the required space cannot be foretold. The final btrfs metadata might occupy several gigabytes on a
       hundreds-gigabyte filesystem.

       If the ability to rollback is no longer important, the it is recommended to perform a few more steps to transition the btrfs filesystem to a more compact layout. This is because the conversion
       inherits the original data blocks' fragmentation, and also because the metadata blocks are bound to the original free space layout.

       Due to different constraints, it is only possible to convert filesystems that have a supported data block size (ie. the same that would be valid for mkfs.btrfs). This is typically the system page size
       (4KiB on x86_64 machines).

I’ve looked into btrfs-convert and it looks very compelling. Soon I’ll purchase another external drive so I’ll have 2 Clonezilla clones before I try btrfs-convert.

1 Like