How to mount ext4 correctly on FreeBSD?

Consulting google, chatgpt, forum, I was very worried about losing 1TB of data that I cannot lose.
All I want to do is bring the data from a Linux ext4 partition to another disk on FreeBSD UFS.

I read in several places that I should use fusefs-ext4fuse,
So I prepare myself, I try to understand how to do it, until I discover that I should NEVER use this!
https://forums.freebsd.org/threads/mounting-ext4-drives-fusefs-ext4fuse-package-removed.74394/

So going back to looking, researching and trying to understand how I can do this,
I understood that I should use ext2fs

And then I come across the link below where it says that FreeBSD will damage the data?
https://forums.freebsd.org/threads/mounting-ext4-drive-in-14-0.91010/

I want to bring the data from nda0p4 to a UFS partition. I'm using FreeBSD 14.0, I would like to do this safely, and as I mentioned the links above left me very confused in understanding if this works or not!
If anyone has already done this procedure of transferring data from ext4 to ufs using FreeBSD and can help me by telling me the commands so that I can do it correctly, I would be grateful.

Code:
# gpart show
=>        34  3907029101  nda0  GPT  (1.8T)
          34        2014        - free -  (1.0M)
        2048     1048576     1  efi  (512M)
     1050624    62914560     2  linux-data  (30G)
    63965184   209715200     3  linux-swap  (100G)
   273680384  3631300608     4  linux-data  (1.7T)
  3904980992     2048000     5  linux-data  (1.0G)
  3907028992         143        - free -  (72K)

# file -s /dev/nda0p4
/dev/nda0p4: Linux rev 1.0 ext4 filesystem data, UUID=....., volume name "data" (extents) (64bit) (large files) (huge files)
 
If you mount readonly you will not damage the data. I have more faith in FreeBSD's kernel driver.

mount -r -t ext4 /dev/nda0p4 /mnt/tmp

The idea of putting it together as read-only is appreciated, I liked it.
The mount command you provided gives error: Invalid fstype
 
Code:
pkg install fusefs-ext2
kldload fuse
fuse-ext2 /dev/nda0p4 /mnt
The first line, only if you don't yet have
fuse-ext2 installed.
I don't have a Linux partition to check right now, but I'm pretty sure that will mount it read-only. It requires root, sudo, or doas. Even though it says ext2, it works on ext4 partitiions.
 
The following method is the one that works for me:

Consulting google, chatgpt, forum, I was very worried about losing 1TB of data that I cannot lose.
Please don't do that, you'll end up with a variety of false responses, chatgpt might be interesting for some tasks but not that one.
 
Back
Top