Filesystem natively supported by FreeBSD and Linux

zetrotrack000

Active Member

Reaction score: 13
Messages: 143

Hi
I have dualbooted Linux and FreeBSD. My data is in separate drive mounted as /home with ext4 filesystem. When I mount this ext4 partition in FreeBSD and copy and move some file, it creates some problems and Linux complain about 'orphan links' (Screenshot is attached). So, I am thinking to change filesystem of my /home directory. So, in this regard kindly guide me that which filesystem is natively supported by both, FreeBSD and Linux, so these kinds of problem do not happen.
Thanks
 

Attachments

sidetone

Daemon

Reaction score: 456
Messages: 1,202

You can try msdosfs. Perhaps there's a better choice.

It's also possible that ext4 has more features than ext2 and ext3 that make that an occurrence.
 
OP
OP
Z

zetrotrack000

Active Member

Reaction score: 13
Messages: 143

Wozzeck.Live

Member

Reaction score: 120
Messages: 78

ext2 is the best choice, it is handled natively since many years now by the FreeBSD kernel module ext2fs, BUT this is a non journalised file system. Being a non journalised filesystem, ext2 is a good choice for portable/shared data

msdosfs is quite old now, and not supported anymore (the Microsoft DOS file system is frozen since many years, and replaced by exfat) and it has some limitations. For example it doesn't support files higher than 5 gigabytes, and not for saying that this is not a journalised file system

Depending on Linux flavor, support of ZFS is in a beta state (so very advanced) in some distros like OpenSUSE Tumbleweed.
In some few years we should be able to perfectly exchange data through ZFS, but we should wait that FreeBSD switches to ZFS on Linux (ZOL).

For moment, implementation of ZFS in FreeBSD is not exactly the same. But with FreeBSD 13, FreeBSD will probably switch definitively to ZOL and we should expect full compatibility. IXSystems has already ported an early version of ZOL available for FreeBSD 13 (Current)

Anyway, in some cases ZFS is not a solution for user (not supported by some old controllers, not compatible with fake raid, should be preferably used with good hardware configuration)

But looking to your message.... I am not sure at all that ext4 is the problem. Using "lklfuse", there should be no problem.
Theses kind of error may occur when we force connect dirty filesystem. Dirty filesystem should firslty by checked with e2fsck before mouting it.

I suspect possible issues at a hardware level.
You should make some tests with an external USB Hard drive formatted in ext4.... try to copy data, connect to Linux... repeat operation to check if you can reproduce the error.

I have a 64 Gbyte sdcard formatted in ext4 and connected permanently to a Linux box.
Sometimes I disconnect it and I connect it to a FreeBSD system... I have never had any issue.
 
Last edited:
OP
OP
Z

zetrotrack000

Active Member

Reaction score: 13
Messages: 143

ext2 is the best choice, it is handled natively since many years now by the FreeBSD kernel module ext2fs, BUT this is a non journalised file system. Being a non journalised filesystem, ext2fs is a good choice for portable/shared data

msdosfs is quite old now, and not supported anymore (the Microsoft DOS file system is frozen since many years now, and replaced by exfat) and it has some limitations. For example it doesn't support files higher than 5 gigabytes, and not for saying that this is not a journalised file system

Depending on Linux flavor, support of ZFS is in a beta state (so very advanced) in some distros like OpenSUSE Tumbleweed.
In some few years we should be able to perfectly exchange data through ZFS, but we should wait that FreeBSD switches to ZFS on Linux (ZOL).

For moment, implementation of ZFS in FreeBSD is not exactly the same. But with FreeBSD 13, FreeBSD will probably switch definitively to ZOL and we should expect full compatibility. IXSystems has already ported an early version of ZOL available for FreeBSD 13 (Current)

Anyway, in some cases ZFS is not a solution for user (not supported by some old controllers, not compatible with fake raid, should be preferably used with good hardware configuration)

But looking to your message.... I am not sure at all that ext4 is the problem. Using "lklfuse", there should be no problem.
Theses kind of error may occur when we force connect dirty filesystem. Dirty filesystem should firslty by checked with e2fsck before mouting it.

I suspect possible issues at a hardware level.
You should make some tests with an external USB Hard drive formatted in ext4.... try to copy data, connect to Linux... repeat operation to check if you can reproduce the error.

I have a 64 Gbyte sdcard formatted in ext4 and connected permanently to a Linux box.
Sometimes I disconnect it and I connect it to a FreeBSD system... I have never had any issue.
Thanks a lot. Very informative, well structured and detailed answer :)
 

userxbw

Well-Known Member

Reaction score: 30
Messages: 424


and automount. look into it, this is what I am using on a separate hdd formatted to ext4 I get read write in Fbsd and Linux don't complain about it.
 
OP
OP
Z

zetrotrack000

Active Member

Reaction score: 13
Messages: 143


and automount. look into it, this is what I am using on a separate hdd formatted to ext4 I get read write in Fbsd and Linux don't complain about it.
Yes, I am planning to try it on weekend. Thanks.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,488
Messages: 32,562

msdosfs is quite old now, and not supported anymore (the Microsoft DOS file system is frozen since many years now, and replaced by exfat) and it has some limitations. For example it doesn't support files higher than 5 gigabytes, and not for saying that this is not a journalised file system
FAT is still supported, heck the EFI partition is actually FAT32. Maximum filesize is 4 GB, not 5.

 
  • Thanks
Reactions: OJ

Alain De Vos

Well-Known Member

Reaction score: 55
Messages: 301

Note : It is possible to do block based gjournaling on an ext2 or msdos partition.
 

roccobaroccoSC

Aspiring Daemon

Reaction score: 150
Messages: 600

Hi
I have dualbooted Linux and FreeBSD. My data is in separate drive mounted as /home with ext4 filesystem. When I mount this ext4 partition in FreeBSD and copy and move some file, it creates some problems and Linux complain about 'orphan links' (Screenshot is attached). So, I am thinking to change filesystem of my /home directory. So, in this regard kindly guide me that which filesystem is natively supported by both, FreeBSD and Linux, so these kinds of problem do not happen.
Thanks
Linux can mount UFS and ZFS. Why don't you try to use the native FreeBSD file systems and see if you have problems mounting them with Linux?

Edit: By the way, as suggested above, using ext3 might also help - I think it is older and more stable than ext4 (Linux might be ahead of FreeBSD in the ext4 development, which might be the source of your trouble). ext2 is probably not a good idea because it is not journaled, i.e. not as safe as ext3 would be.
 

kpedersen

Daemon

Reaction score: 673
Messages: 1,644

If it is external between different operating systems I tend to use NTFS (via ntfs-3g kernel module). This way it works on Linux, Windows and *BSD.

My main motivation is that it provides no file / folder ownership so is quite easy to plug in, copy and go without having to chown, chmod etc.
Oddly enough I actually find it faster than the fat32 module at copying files. This might be in my mind however.
 
OP
OP
Z

zetrotrack000

Active Member

Reaction score: 13
Messages: 143

Thanks everyone for your messages. From your recommendations, I think I will try UFS or ZFS in Linux.
tedbell, I have mounted FreeBSD's ufs partition in Linux, but it is only in read-only mode. I will check for read-write options. If you have any clue regarding read-write options, then kindly share with me.
I will also look into ext3.
I will avoid ext2, FAT, NTFS and other older filesystems.
Thanks everyone :)
 
OP
OP
Z

zetrotrack000

Active Member

Reaction score: 13
Messages: 143

roccobaroccoSC

Aspiring Daemon

Reaction score: 150
Messages: 600

Look here: https://gms.tf/dtracing-passwords-for-fun.html
Maybe your Linux kernel is compiled with only read-only support for UFS. You can check this with this command:
cat /proc/config.gz | gunzip | grep CONFIG_UFS

My own kernel is indeed compiled without write support but I don't use UFS anyway:
Bash:
% cat /proc/config.gz | gunzip | grep CONFIG_UFS
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
If you want to use UFS in your Linux, you need to compile a custom kernel. You can take your current configuration (mentioned above) and uncomment CONFIG_UFS_FS_WRITE.

However, I recommend you trying ZFS instead. ZFS is a very powerful file system and if you have enough RAM (>= 4GB) you should give it a try.
You can create a partition for your /home or whatever you want to share (you can even install FreeBSD on a ZFS pool). Then in GNU/Linux you need to install ZFS support (e.g. https://wiki.archlinux.org/index.php/ZFS ) and make the kernel driver load automatically on startup. It will discover the pool and mount it, you don't need an fstab for that. Just make sure you don't put /root in the ZFS pool on the Linux side, otherwise if something goes wrong with ZFS you won't be able to log in.
 
OP
OP
Z

zetrotrack000

Active Member

Reaction score: 13
Messages: 143

Look here: https://gms.tf/dtracing-passwords-for-fun.html
Maybe your Linux kernel is compiled with only read-only support for UFS. You can check this with this command:
cat /proc/config.gz | gunzip | grep CONFIG_UFS

My own kernel is indeed compiled without write support but I don't use UFS anyway:
Bash:
% cat /proc/config.gz | gunzip | grep CONFIG_UFS
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
If you want to use UFS in your Linux, you need to compile a custom kernel. You can take your current configuration (mentioned above) and uncomment CONFIG_UFS_FS_WRITE.

However, I recommend you trying ZFS instead. ZFS is a very powerful file system and if you have enough RAM (>= 4GB) you should give it a try.
You can create a partition for your /home or whatever you want to share (you can even install FreeBSD on a ZFS pool). Then in GNU/Linux you need to install ZFS support (e.g. https://wiki.archlinux.org/index.php/ZFS ) and make the kernel driver load automatically on startup. It will discover the pool and mount it, you don't need an fstab for that. Just make sure you don't put /root in the ZFS pool on the Linux side, otherwise if something goes wrong with ZFS you won't be able to log in.
Great suggestion. I will try it tomorrow :)
 

garry

Member

Reaction score: 61
Messages: 72

.....I recommend you trying ZFS instead... in GNU/Linux you need to install ZFS support and make the kernel driver load automatically on startup. It will discover the pool and mount it...
This would be a great solution for me. I'm running Gentoo now to get an up-to-date sagemath but I would love to run my beloved FreeBSD in parallel and share a 2 TB "library". But I tried this before, years ago, and ran into problems because the "ownership" notion of zfs. How would I get linux and freebsd to both automatically mount the zfs pool without having to always export the pool from one before rebooting and importing the pool into the other os? On my previous attempt I tried to set the hostid of both systems and the pool to the same value and I don't remember details of what I tried but I know that I finally gave up. It seemed that zfs resists being owned by multiple "hosts". Can anyone guide me on this now?

Edit: Today I stumbled upon the obvious solution to which I had been blind -- there is a zfs mountpoint option "legacy". If mountpoint is legacy, zfs file systems can be managed with traditional mount, umount, fstab. From the zfs() manual "If a file system's mount point is set to legacy, ZFS makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system". The correct answer to my question was RTFM, a lesson I learn again (and again).
 
Last edited:

roccobaroccoSC

Aspiring Daemon

Reaction score: 150
Messages: 600

This would be a great solution for me. I'm running Gentoo now to get an up-to-date sagemath but I would love to run my beloved FreeBSD in parallel and share a 2 TB "library". But I tried this before, years ago, and ran into problems because the "ownership" notion of zfs. How would I get linux and freebsd to both automatically mount the zfs pool without having to always export the pool from one before rebooting and importing the pool into the other os? On my previous attempt I tried to set the hostid of both systems and the pool to the same value and I don't remember details of what I tried but I know that I finally gave up. It seemed that zfs resists being owned by multiple "hosts". Can anyone guide me on this now?
Great point! I have not thought about that because I don't doubleboot anymore.
Just a speculation - The ZFS pool is registered in the ZFS cache file, right? What if you put the cache file on a UFS partition for example and shared this between the two OS-es too?

Edit: Take a look here: https://ericmccorkleblog.wordpress.com/2016/11/15/cohabiting-freebsd-and-gentoo-linux-on-a-common-zfs-volume/
 

sidetone

Daemon

Reaction score: 456
Messages: 1,202

My ext2fs(5) filesystem could only mount as read only on FreeBSD 12.1.

mount -t ext2fs -o ro /dev/da?s? /media/share
My fstab now has a corresponding entry.
 
Top