Failed to Covert ext4 root file system to Btrfs on ubuntu 20.04

Hi,
I have created Amazon EC2 Ubuntu20.04 instance with EXT4 RootFS. I tried to convert/migrate ext4 rootfs to Btrfs using following commands.

  1. Created root volume snapshot and attached to same instance as second volume. The / and /boot are installed on same partition.

  2. check ext4 file system on second volume for error or any corruption using below command.
    sudo e2fsck -fvy

  3. Run Btrfs convert command on non error device.
    sudo btrfs-convert -L

  4. Changed /etc/fstab files rootfs ext4 to Btrfs as below
    change xfs/ext4 to btrfs and last 2 column entry to 0.

  5. commented /etc/grub.d/00_header line
    #if [ -n “${have_grubenv}” ]; then if [ -z “${boot_once}” ];

  6. update-grub

  7. grub-install --recheck --no-rs-codes --modules=“btrfs” deviceName

  8. update-grub
    10 Failed to boot ubuntu on secondary root Btrfs volume.

During each boot time getting below error,

  • “Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(259,1)”

Please let me know is migration of ext4 rootfs to BTRFS is supported?If supported above mentioned steps are correct to migrate or any thing else is missing? Is separate /boot partition required?

Thank You
Sushma

@sushma1 Welcome to the Rockstor community.

Althought our DIY NAS solution is based on btrfs we rely entirely on our upstream, now openSUSE/SuSE via our “Built on openSUSE” initiative for their btrfs expertise.

Our own project concern is interfacing with the existing btrfs capabilities, or a subset of them, and making them easily available to folks building their own NAS setups.

Your question would thus be better presented in a btrfs forum, or possibly on the linux-btrfs mailing list:

https://btrfs.wiki.kernel.org/index.php/Btrfs_mailing_list

Be advised thought that you are then addressing the btrfs developers directly, so it may be prudent for all concerned to first find a btrfs focused discussion forum/list/chat-room to help prepare your question.

What I could advise is that you first review older posts in the linux-btrfs mailing list as from my reading, although converting is a possibility is is a little in need of some attention. However from memory I believe it has had a little fix-up of late so you may fair better by using the very latest kernel and btrfs-progs versions. You situation is complicated by the conversion being on the rootfs.

So in short although we have some familiarity with btrfs we are not experts here. Thought hopefully we have some competencies here and there. Our expertise is primarily around our NAS software and how it avails btrfs via a Web-UI in a NAS context.

Also note that our experience of btrfs is originally from early CentOS 7 (1511) with elrepo kernel-ml added and in more recent years with openSUSE 15.0-15.3 using their default kernels. We have never been based on Ubuntu. Each linux distro applies their own special patches, this is another point of context.

Hope that helps and apologies for not being of more help.

3 Likes