7

I have recently decided to install FreeBSD on my desktop but I still have several computers running GNU/Linux and I would like to share disk partitions between the two OSs, in particular:

  • The computer using FreeBSD will also have a GNU/Linux distribution installed and I would like to have a shared partition that can be read / written by both FreeBSD and GNU/Linux.
  • I would like to use external hard-disk drives and USB-sticks from both operating systems.

By reading various documentation and online forums, I understood that ext2 is the only solution right now: ufs write-support in Linux is still experimental, FreeBSD has limited support for ext3, and supports ext4 and ReiserFS read-only. Did I miss something, i.e. are there other viable filesystems?

4
  • 3
    If you're careful about the version, zfs could be an option, see en.wikipedia.org/wiki/… Commented Oct 28, 2016 at 17:24
  • 2
    I think you should use ZFS (as @kba wrote above) or FAT/NTFS (depends on your requirements). Commented Oct 28, 2016 at 18:35
  • I will have a look at ZFS. What would be the advantage of using FAT/NTFS over ext2? Commented Oct 28, 2016 at 18:38
  • Advantage of FAT is portability, not sure about NTFS but should be pretty widely supported nowadays. Disadvantage of FAT is that it has limits in file and partition size and is outfeatured by modern fs. Commented Oct 28, 2016 at 19:21

4 Answers 4

3

You can use ext2. Support for ext2 has existed in FreeBSD for a while and can probably be considered stable. Of course it is native in GNU/Linux as you know.

You could also use ext3 but without journal and extended attributes (use mount options in Linux /etc/fstab), which would increase some limits.

This is probably much better than using a fs which is not native on any of the two systems, like NTFS and the like.

Source: https://www.freebsd.org/doc/handbook/filesystems-linux.html

5
  • NTFS is for me out of the question because I want to retain Unix semantics (is it called this way?): users, permissions, and so on. Commented Oct 30, 2016 at 9:08
  • @Giorgio I feel the same for my files. Then ext2 is probably perfect for you! Have you tested it? Commented Nov 4, 2016 at 7:08
  • I have one common partition with ext2 and up to now I had no problem whatsoever. So I think I will go for it and format all the disks / partitions that I want to share with ext2. Commented Nov 4, 2016 at 23:52
  • Thanks. Since it seems to be a solution for you I would be grateful if you could mark it as such. Commented Nov 9, 2016 at 17:06
  • Done. But see my next open problem ;-) unix.stackexchange.com/questions/321984/… Commented Nov 9, 2016 at 17:08
0

FreeBSD also supports FUSE.

Surprisingly there is an EXT4 implementation for FUSE. I don't know how stable it is considered.

http://blog.ataboydesign.com/2014/04/23/freebsd-10-mounting-usb-drive-with-ext4-filesystem/

There is a portable ext4fuse, but it is read-only. It should be possible to use ntfs-3g, giving you the benefit of a journaling filesystem, but some Unix features might be unavailable or require extra configuration.

0

One possible solution is to use the Universal Disk Format (UDF). UDF supports 2 terabyte volumes, long file names, and POSIX file permissions. UDF is used on DVD and Blu-ray discs, but is, contrary to popular belief, also usable as a file system format on hard disks and removable flash drives.

I'm not very familiar with FreeBSD, so I am not sure write support is implemented on that system.

0

I don't have the rep to comment on Johan's comment but UDF on a thumb drive is simple and not a bad option either. ZFS would be preferable and you'd be able to run multiple thumb drives in any type of pool you'd like. Mirrored and encrypted? No problem.

On FreeBSD 11 I'd run something like:

gpart create -s gpt ada0 gpart create -s gpt ada1 gpart add -t freebsd-zfs -a 1M -l sensitive1 /dev/ada0 gpart add -t freebsd-zfs -a 1M -l sensitive2 /dev/ada1 geli init /dev/ada0p1 geli init /dev/ada1p1 geli configure -b /dev/ada0p1 geli configure -b /dev/ada1p1 geli attach /dev/ada0p1 geli attach /dev/ada1p1 zpool create zmedia mirror /dev/ada0p1.eli /dev/ada1p1.eli 

UFS is done with:

dd if=/dev/zero of=/dev/ada[etc] bs=1m count=10 newfs -L labelfordrive -O2 -U -m 6 /dev/ada0 

Check if the automounter mounted it with:

mount 

and if it's not mounted just mount it as you normally would

mkdir /media/mydrive0 mount /dev/ada0 /media/mydrive0 

done

1
  • I will have a look at UDF. UFS is not an option AFAIK, because not well supported by Linux. At the moment I have settled for ext2fs, but even that has some problems when I try to read an external USB disk from FreeBSD. However, it has worked fine for me using an internal SATA disk. Commented Aug 10, 2017 at 8:35

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.