1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ext4 on FreeBSD

Discussion in 'General' started by guillaje, Oct 6, 2011.

  1. guillaje

    guillaje New Member

    Messages:
    3
    Thanks Received:
    0
    Hello,

    I'm a Linux user, quite new to FreeBSD.
    I recently installed FreeBSD 8.2-RELEASE amd64 as a backup server. These backups consist of the synchronisation between SAN snapshots of the FS I want to backup and ZFS filesytems.

    In order to mount my Linux FS, I installed the port of e2fsprog, and it works great for EXT2/3, but not for EXT4:

    I can fsck it :
    Code:
    endor# fsck_ext2fs /dev/da1s2
    e2fsck 1.41.14 (22-Dec-2010)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/da1s2: 63569/657072 files (0.2% non-contiguous), 498732/2624256 blocks


    But I can't mount it:
    Code:
    endor# mount -t ext2fs /dev/da1s2 /mnt
    mount: /dev/da1s2 : Invalid argument


    In dmesg:
    Code:
    WARNING: mount of da1s2 denied due to unsupported optional features


    I tried to deactivate some ext4 features of this fs on a Debian box, but I can't disable all of them:
    Code:
    root@xen0adm1:~# tune2fs -O ^flex_bg /dev/iscsi/xen0adm1-2011-09-30-14p2
    tune2fs 1.41.12 (17-May-2010)
    Clearing the flex_bg flag would cause the the filesystem to be
    inconsistent.
    root@xen0adm1:~# tune2fs -O ^uninit_bg /dev/iscsi/xen0adm1-2011-09-30-14p2
    tune2fs 1.41.12 (17-May-2010)
    root@xen0adm1:~# tune2fs -O ^dir_index /dev/iscsi/xen0adm1-2011-09-30-14p2
    tune2fs 1.41.12 (17-May-2010)
    root@xen0adm1:~# tune2fs -O ^extents /dev/iscsi/xen0adm1-2011-09-30-14p2
    tune2fs 1.41.12 (17-May-2010)
    Clearing filesystem feature 'extent' not supported.
    

    And after that, the error is the same when I try to mount it on FreeBSD.

    So my question is, is it a way to mount an EXT4 filesystem on FreeBSD? Even in ro, without journal.

    Thank you,
    jC
     
  2. pkubaj

    pkubaj Member

    Messages:
    460
    Thanks Received:
    51
    Unfortunately, there's currently no way to mount an EXT4 slice. The original driver was created for EXT2, still, it somehow works also with EXT3, but not with EXT4.
     
  3. guillaje

    guillaje New Member

    Messages:
    3
    Thanks Received:
    0
    I read that it was not possible, but this page made me think I missed something...

    "This project implements preallocation in ext2fs and update ext2fs to be able to read ext4 file systems and possibly add other functionality, such as write ext4 file systems."
     
  4. fluca1978

    fluca1978 Member

    Messages:
    735
    Thanks Received:
    68
    Aren't EXT3 and EXT4 back compatible with EXT2?
     
  5. adamk

    adamk New Member

    Messages:
    1,624
    Thanks Received:
    265
    EXT3 mostly is, EXT4 mostly is not :)

    Adam
     
  6. davidgurvich

    davidgurvich New Member

    Messages:
    195
    Thanks Received:
    9
    EXT3 is forward compatible with EXT4. An EXT4 system can be mounted as EXT3 if extents aren't enabled. Is the ext2fs feature complete for EXT3?
     
  7. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,450
    Thanks Received:
    771
    You can mount an EXT3 filesystem on FreeBSD by mounting it as EXT2.

    Last I checked, you could not mount an EXT3 filesystem as EXT3.
     
  8. ddreamer

    ddreamer New Member

    Messages:
    1
    Thanks Received:
    0
    Last edited by a moderator: Oct 16, 2014
  9. Nukama

    Nukama Member

    Messages:
    129
    Thanks Received:
    41
    Get rid of this Linux file system and use ZFS for your external and backup medium on Linux and FreeBSD.
     
  10. user00

    user00 New Member

    Messages:
    62
    Thanks Received:
    0
    After reading the above link, I experimentally found what device and what partitions contained the Linux mounts I wanted to use under FreeBSD by issuing commands and created the below script.

    Code:
    #!/bin/sh
    
    ext4fuse /dev/ada0s6 /mnt/f19home
    ext4fuse /dev/ada0s5 /mnt/f19root
    ext4fuse /dev/ada0s2 /mnt/FileDump1TB


    Then I rebooted... Now instead of mounting the partitions, the command throws an error:

    Code:
    # ./f19mnt.sh
    fuse: failed to open fuse device: No such file or directory
    fuse: failed to open fuse device: No such file or directory
    fuse: failed to open fuse device: No such file or directory


    Fuse FS is enabled in rc.conf just as it was when it worked. What could I possibly break?
     
  11. user00

    user00 New Member

    Messages:
    62
    Thanks Received:
    0
    Turns out, I was not loading fuse module in /boot/loader.conf and that's why ext4fuse was not working. Added a line and loaded the module on command line and EXT4 can be mounted again.