# mount linux ext4 drives on Freebsd



## NapoleonWils0n (Mar 10, 2020)

You can mount linux ext4 drives on Freebsd using fusefs-ext2 package

Install fusefs-ext2


```
# pkg install fusefs-ext2
```

Enable the fuse kernel module

To enable loading FUSE kernel module at boot add
fuse_load=YES line to the /boot/loader.conf file

Edit /boot/loader.conf


```
# vi /boot/loader.conf
```

Add the following code to the loader.conf


```
fuse_load=YES
```

You can also load the fuse kernel module on a running system just using the kldload command.


```
# kldload fuse
```

Create a mount point


```
# mkdir -p /mnt/linux
```

plug in the drive and use dmesg to find the device id


```
# dmesg
```

find the drives device id which should be something like da0

use gpart to show information about the drive


```
# gpart show da0
```

check /dev/da0


```
ls -l /dev/da0*
```

the slice should be called /dev/da0s1

mount the ext4 drive to /mnt/linux


```
# fuse-ext2 /dev/da0s1 /mnt/linux
```

unmount the drive


```
# umount /mnt/linux
```


----------



## aragats (Mar 12, 2020)

This is all good, except the quality of sysutils/fusefs-ext2. It chokes at large number of files (tens of thousands) and symlinks with long target names.
The latter is the most dangerous thing since you may not even discover the issue until try to use, e.g. copied files.
At work I have to deal with _ext4_ formatted SD cards almost every day, and found the most reliable is sysutils/fusefs-lkl.
Everything remains the same, but the mount part of the how-to will look as the following:
	
	



```
# lklfuse -o type=ext4 /dev/da0s1 /mnt/linux
```


----------



## NapoleonWils0n (Mar 12, 2020)

I found fusefs-ext2 is also very slow i got an average speed of 4.5mb,
compared to 11.2mb when i plugged in the ext4 drive into a linux machine and used rsync over ssh to transfer to freebsd

I started off using cp -r to copy files from the ext4 drive but as you point out it just choke,
so i ended up using rsync in small batches


----------



## Alain De Vos (Mar 22, 2020)

Note : lklfuse is buggy for xfs and you cannot mount read-only.


----------



## YuryG (Jul 28, 2020)

Is it better to use kernel EXT2FS module (when available) than fuse-ext2?


----------

