us ua ua

FreeBSD Mounting drive with ext4 file system

Mounting a disk with ext4 file system in FreeBSD

 

When I switched from GNU/Linux to FreeBSD I had several disks on one of them I installed FreeBSD, but GNU/Linux with all the data did not kill ... After installing and configuring FreeBSD, I needed to transfer all the data to the installed system. I turned off my computer, connected a disk with GNU/Linux, booted from FreeBSD and ran the command in the terminal:

 

# mount /dev/da0s1/mnt

 

what am I doing saw this error message

 

mount: /dev/da0s1: Invalid argument

 

I decided to try this:

 

# mount -t ext4 /dev/da0s1/mnt

 

and then an error

 

mount: /dev/da0s1: Operation not supported by device

But the data had to be retrieved somehow. Then I looked at my disks with these commands:

 

# dmesg | grep da0

and

# gpart show da0

 

The disks were detected normally

 

My next step is to allow a regular user to mount devices.

 

I edited the /etc/devfs.rules file so that users in the operator group have read and write permissions, like this:

 

# ee / etc / devfs. rules

[localrules = 5] add path 'da *' mode 0660 group operator

 

Now edit /etc/rc.conf to allow devfs.rules ruleset:

# ee /etc/rc.conf

 

# ee /etc/rc.conf

 

# ee /etc/rc.conf

Edit the /etc/sysctl.conf file as follows:

 

# ee /etc/sysctl.conf

 

vfs.usermount=1

 

Execute:

 

# sysctl vfs.usermount = 1 vfs.usermount: 0 → 1

 

Create a directory for example linux like I did or anyone else:

 

# mkdir /mnt/linux

And specify the owner and group

 

# chown user: user /mnt/linux

 

Where user is your user and his group

 

After I tried to mount the disk and again the error

 

$ mount -t ext4 /dev/da0s1/mnt/linux

 

mount: /dev/da0s1: Invalid argument

 

But now the error is not forbidden, but an inaccessible argument means that FreeBSD does not support ext4 filesystem.

 

We need to set the fusefs port-ext4fuse

 

# cd /usr/ports/sysutils/fusefs-ext4fuse

 

# make install clean

 

When fusefs-ext4fuse installed I tried to mount the disk again

 

$ ext4fuse /dev/da0s1/mnt/linux

 

fuse: failed to open fuse device: No such file or directory

 

and again trouble

Googling I found that there is a fuse module in the kernel, load the fuse.ko module

 

# kldload fuse.ko

 

Edit we have /boot/loader.conf to load the module on each load

 

# ee /boot/loader.conf

 

Then I tried to mount the disk:

 

$ ext4fuse /dev/da0s1/mnt/linux

 

everything went without errors and I decided to see the contents directory like this

 

$ ls /mnt/linux

 

and saw that everything works!