This is going to be short. I write this tutorial, because a lot of tutorials mention ext4fuse. While it works for some things one experiences quite a few oddities.
Examples of problems I experienced:
In other words: The file system will still be mounted read-only, but the permissions will be correct.
There is three things you need to take care of:
So to repeat the important points. Load the kernel module! Make sure you always write ext2fs, both for the module AND the mount option. Don't forget about the fs part. And make sure to mount it read only.
You can of course add ext2fs to the list of automatically loaded kernel modules, so you don't have to load it over and over again.
In your /etc/rc.conf add:
This will make sure that the kernel module will be loaded on boot. If you already have a kld_list entry then just append ext2fs to it.
Examples of problems I experienced:
- everything has only read permissions
- it is possible cd into non existing directories
- things like recursive copies cause failures
- sometimes stuff can't be read correctly
In other words: The file system will still be mounted read-only, but the permissions will be correct.
There is three things you need to take care of:
- Load the ext2fs kernel module
- Mount the partition with -t ext2fs (you need to specify it and it's ext2fs, not ext2!)
- Mount it read-only! Trying to mount the partition without -o ro will not work
# Load the kernel module
kldload ext2fs
# mount
mount -t ext2fs -o ro /dev/<device/partition> <mountpoint>
# Exmaples:
mount -t ext2fs -o ro /dev/ad1s1 /mnt/
# Or on a different partition scheme (p vs s):
mount -t ext2fs -o ro /dev/ada0p1 /mnt/
So to repeat the important points. Load the kernel module! Make sure you always write ext2fs, both for the module AND the mount option. Don't forget about the fs part. And make sure to mount it read only.
You can of course add ext2fs to the list of automatically loaded kernel modules, so you don't have to load it over and over again.
In your /etc/rc.conf add:
Code:
kld_list="ext2fs"
This will make sure that the kernel module will be loaded on boot. If you already have a kld_list entry then just append ext2fs to it.