Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating from EXT4 results in core dump #730

Open
jbrunk1966 opened this issue Aug 22, 2024 · 4 comments
Open

Migrating from EXT4 results in core dump #730

jbrunk1966 opened this issue Aug 22, 2024 · 4 comments

Comments

@jbrunk1966
Copy link

jbrunk1966 commented Aug 22, 2024

trying to migrate a EXT4 partition to BcacheFS:

[root@q920 ~]# bcachefs migrate -f /data
Creating new filesystem on /dev/sda1 in space reserved at /data/bcachefs
starting version 1.7: mi_btree_bitmap opts=noexcl,sb=85458944
initializing new filesystem
going read-write
initializing freespace
starting version 1.11: disk_accounting_inum opts=noexcl,sb=85458944
bcachefs: libbcachefs/super.c:1009: bch2_fs_start: Assertion `!(test_bit(BCH_FS_started, &c->flags))' failed.
Abgebrochen (Speicherabzug geschrieben)
[root@q920 ~]# bcachefs version
1.9.5
[root@q920 ~]# uname -a
Linux q920.local 6.10.6-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Mon, 19 Aug 2024 17:02:05 +0000 x86_64 GNU/Linux
@hb-lee
Copy link

hb-lee commented Sep 29, 2024

Is this issue still occurring?

@hb-lee
Copy link

hb-lee commented Sep 30, 2024

ok, got it, it called bch2_fs_start twice which caused this issue. The fix is on the way.

@jbrunk1966
Copy link
Author

Is this issue still occurring?

yip tested it even yet but you did find the issue in the meantime by itself, thanks!

@hb-lee
Copy link

hb-lee commented Sep 30, 2024

haha, after removing the first bch2_fs_start, I migrate file system successfully with the following steps:

  • constructure the directory tree for target file system
mount -t ext4 /dev/loop3 /mnt/ext4/
cp /etc/profile /mnt/ext4/file1
  • migrate tree
bcachefs migrate -f /mnt/ext4

hints:
starting version 1.12: rebalance_work_acct_fix opts=noexcl,sb=524288
initializing new filesystem
going read-write
initializing freespace
shutdown complete, journal seq 62
Migrate complete, running fsck:
starting version 1.12: rebalance_work_acct_fix opts=ro,nochanges,noexcl,sb=524288,read_only
recovering from clean shutdown, journal seq 62
accounting_read... done
alloc_read... done
stripes_read... done
snapshots_read... done
journal_replay... done
resume_logged_ops... done
delete_dead_inodes... done
fsck complete
To mount the new filesystem, run
  mount -t bcachefs -o sb=524288 /dev/loop3 dir

After verifying that the new filesystem is correct, to create a
superblock at the default offset and finish the migration run
  bcachefs migrate-superblock -d /dev/loop3 -o 524288

The new filesystem will have a file at /old_migrated_filesystem
referencing all disk space that might be used by the existing
filesystem. That file can be deleted once the old filesystem is
no longer needed (and should be deleted prior to running
bcachefs migrate-superblock)

  • mount bcachefs with offset
umount /mnt/ext4
mount -t bcachefs -o sb=524288 /dev/loop3 /mnt/bcachefs
  • remove old
rm -f /mnt/bcachefs/old_migrated_filesystem
umount /mnt/bcachefs
  • migrate superblock
bcachefs migrate-superblock -d /dev/loop3 -o 524288
  • mount bcachefs again without offset
mount -t bcachefs /dev/loop3 /mnt/bcachefs
  • test
we get the file1 in original ext4 file system by ls /mnt/bcachefs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants