# ext2fs inode size 256



## ankscorek (Mar 9, 2013)

Hello friends, I am aware this is an old problem with a patch available. I am using this link
http://linux-bsd-sharing.blogspot.in/2009/09/howto-mount-ext2fs-partitions-with.html. I am not getting the desired results hence here is the snippet. 

```
/usr/src/sys/gnu/fs # patch < ~/ext2fs.diff 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_fs.h ext2fs/ext2_fs.h
|--- ext2fs.orig/ext2_fs.h	2005-06-16 06:51:38.000000000 +0000
|+++ ext2fs/ext2_fs.h	2008-09-03 14:10:27.000000000 +0000
--------------------------
File to patch:
```

Can someone please tell what file is it asking in the end? (The last line please)


----------



## Terry_Kennedy (Mar 9, 2013)

ankscorek said:
			
		

> Hello friends I am aware this is an old problem with a patch available.
> 
> I am using this link
> http://linux-bsd-sharing.blogspot.in/2009/09/howto-mount-ext2fs-partitions-with.html
> ...


What version of FreeBSD are you running? According to the PR kern/124621, this was fixed in 7-STABLE and 8-STABLE (and implicitly in 9-STABLE, which was HEAD at the time) back in October 2009.



> Can someone please tell what file is it asking in the end? (The last line please.)


/usr/src/sys/gnu/fs/ext2fs/ext2_fs.h

However, I'm concerned that you may not have the background to understand what will happen next. In particular, you may be asked if you want to revert a previous-applied patch, or that the patch failed or succeeded with fuzz or offsets. Any of those indicates that something is wrong. And the patch is going to ask you the same question for a few additional files.


----------



## ankscorek (Mar 9, 2013)

> What version of FreeBSD are you running?




```
uname -a
FreeBSD noname.noname.edu 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec  4 06:55:39 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```



> However, I'm concerned that you may not have the background to understand what will happen next.


Here you have hit the Bull's eye. I agree with you on this aspect and is eager to read links pertaining to this.


```
$ cd /usr/src/sys/gnu/fs
$ ls
reiserfs	xfs
```


----------



## Toast (Mar 9, 2013)

```
[CMD="%"]ll /usr/src/sys/fs[/CMD]
total 33
drwxr-xr-x  2 root  wheel  17 Jan  9 04:52 cd9660/
drwxr-xr-x  2 root  wheel  20 Jan  9 04:52 coda/
drwxr-xr-x  2 root  wheel   3 Jan  9 04:52 deadfs/
drwxr-xr-x  2 root  wheel   9 Jan  9 04:52 devfs/
[B]drwxr-xr-x  2 root  wheel  18 Jan  9 04:52 ext2fs/[/B]
drwxr-xr-x  2 root  wheel   5 Jan  9 04:52 fdescfs/
drwxr-xr-x  2 root  wheel   4 Jan  9 04:52 fifofs/
drwxr-xr-x  2 root  wheel  11 Jan  9 04:52 hpfs/
drwxr-xr-x  2 root  wheel  16 Jan  9 04:52 msdosfs/
```

The files are already patched.


----------



## ankscorek (Mar 10, 2013)

@Toast, please suggest what to do to get the ext2fs folder in /usr/src/sys/fs.


----------



## wblock@ (Mar 10, 2013)

Install the source.  But if the problem has already been fixed, that's pointless.


----------



## ankscorek (Mar 10, 2013)

```
root@noname:/usr/src/sys/fs # ll
total 88
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 cd9660/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 coda/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 deadfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 devfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 ext2fs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 fdescfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 fifofs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 hpfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 msdosfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 nfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 nfsclient/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 nfsserver/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 ntfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 nullfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 nwfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 portalfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 procfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 pseudofs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 smbfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 tmpfs/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 udf/
drwxr-xr-x  2 root  wheel  512 Mar 10 11:08 unionfs/
```

This was followed by


```
root@noname:/usr/src/sys/fs # patch < ~/ext2fs.diff 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_fs.h ext2fs/ext2_fs.h
|--- ext2fs.orig/ext2_fs.h	2005-06-16 06:51:38.000000000 +0000
|+++ ext2fs/ext2_fs.h	2008-09-03 14:10:27.000000000 +0000
--------------------------
File to patch: ext2fs/ext2_fs.h
No file found--skip this patch? [n] n
File to patch: ext2fs/ext2fs.h
Patching file ext2fs/ext2fs.h using Plan A...
Hunk #1 failed at 150.
1 out of 1 hunks failed--saving rejects to ext2fs/ext2fs.h.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_inode.c ext2fs/ext2_inode.c
|--- ext2fs.orig/ext2_inode.c	2006-09-26 04:15:58.000000000 +0000
|+++ ext2fs/ext2_inode.c	2008-09-03 13:54:49.000000000 +0000
--------------------------
Patching file ext2fs/ext2_inode.c using Plan A...
Hunk #1 failed at 91.
1 out of 1 hunks failed--saving rejects to ext2fs/ext2_inode.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_vfsops.c ext2fs/ext2_vfsops.c
|--- ext2fs.orig/ext2_vfsops.c	2008-04-03 18:51:13.000000000 +0000
|+++ ext2fs/ext2_vfsops.c	2008-09-03 13:55:37.000000000 +0000
--------------------------
Patching file ext2fs/ext2_vfsops.c using Plan A...
Hunk #1 failed at 424.
Hunk #2 failed at 578.
Hunk #3 failed at 1013.
3 out of 3 hunks failed--saving rejects to ext2fs/ext2_vfsops.c.rej
done
```

Still no patch done. Any suggestions please


----------



## Terry_Kennedy (Mar 10, 2013)

ankscorek said:
			
		

> Still no patch done. Any suggestions please


As people here have been saying, you're trying to apply a patch for a problem that was fixed years ago.

Have you tried just enabling ext2fs support and mounting the ext2fs partition as described in ext2fs(5)?

In particular, this step:
`# kldload ext2fs`
followed by the appropriate mount(8) command line:
`# mount -t ext2fs /dev/ad1s1 /mnt`
Note that your device name and choice of mount point may differ from this line.


----------



## ankscorek (Mar 11, 2013)

*T*his has already been carried out:


```
cat /boot/loader.conf 
ext2fs_load="YES"
linux_load="YES"
```

This was checked as under


```
# gpart show
=>       63  625142385  ada0  MBR  (298G)
         63  204796557     2  linux-data  (97G)
  204796620  204796620     3  freebsd  (97G)
  409593240  205310700     4  linux-data  (97G)
  614903940   10233405     1  linux-swap  (4.9G)
  625137345       5103        - free -  (2.5M)

=>        0  204796620  ada0s3  BSD  (97G)
          0  203423744       1  freebsd-ufs  (97G)
  203423744    1372876          - free -  (670M)

# mount -t ext2fs /dev/ada4 /mnt/
mount: /dev/ada4: No such file or directory
# mount -t ext2fs /dev/ada2 /mnt/
mount: /dev/ada2: No such file or directory
# kldload ext2fs
kldload: can't load ext2fs: File exists
```

Still I am unable to mount the partition. Suggestions please.


----------



## wblock@ (Mar 11, 2013)

You don't have an ada4 drive.  The notation should be:
`# mount -t ext2fs /dev/ad0s4 /mnt`

That's drive ada0 slice (MBR partition) 4.

(This thread is a good example of an X/Y problem.)


----------



## ankscorek (Mar 11, 2013)

> You don't have an ada4 drive. The notation should be:
> # mount -t ext2fs /dev/ad0s4 /mnt
> 
> That's drive ada0 slice (MBR partition) 4





```
# mount -t ext2fs /dev/ad0s4 /mnt
mount: /dev/ad0s4: No such file or directory
# mount -t ext2fs /dev/ada0s
ada0s1%  ada0s2%  ada0s3%  ada0s3a% ada0s4%  
# mount -t ext2fs /dev/ada0s4 /mnt
mount: /dev/ada0s4: Invalid argument
```


----------



## Crivens (Mar 11, 2013)

ext2fs needs to be marked 'clean' on unmount. Maybe you need to first run e2fsck (sp?) on it, which is available from ports.


----------



## wblock@ (Mar 11, 2013)

Let's check the assumptions.  Please show the output of
`# file -s /dev/ada0s4`


----------



## ankscorek (Mar 12, 2013)

> Let's check the assumptions. Please show the output of
> # file -s /dev/ada0s4




```
# file -s /dev/ada0s4
/dev/ada0s4: Linux rev 1.0 [B]ext4[/B] filesystem data, UUID=75e417c5-4aa5-4d27-822e-fa81b42fb3e2 (extents) (large files) (huge files)
```

I followed this link http://forums.nas4free.org/viewtopic.php?f=64&t=1861

It mounts the partition but as a normal user there are permission issues. How to fix these?

```
chown foo:wheel /mnt
```

This is not helping


----------



## wblock@ (Mar 12, 2013)

Okay, good.  Now we need to answer the question of whether FreeBSD's ext2fs support can handle ext4.


----------



## ankscorek (Mar 12, 2013)

> Okay, good. Now we need to answer the question of whether FreeBSD's ext2fs support can handle ext4.
> Reply With Quote



This was already thought by me and after referring to the link http://forums.nas4free.org/viewtopic.php?f=64&t=1861 I did [cmd=]/usr/local/bin/ext4fuse /dev/ada0s4 /mnt/[/cmd].

I was able to mount it but I am getting permission problems. I tried [cmd=]# chown foo:wheel /mnt[/cmd]

Still I am unable to view the partition as a normal user. I can only see it as a *super user*. People have commented that this is not a neat approach. Any suggestions?


```
ls -al /mnt/
total 16
drwxr-xr-x   2 foo   foo     512  Dec  4 12:36 .
drwxr-xr-x  19 root  wheel  1024 Mar 12 19:17 ..
```


----------



## ankscorek (Mar 16, 2013)

Can someone pl*ease* suggest me how to fix the permission issues?

Is this thread Solved?


----------

