# Mount ext2fs operation not permitted



## balanga (Apr 12, 2017)

I have a 128GB USB stick on which I created a 10GB linux-data using `gpart`. The partition was formatted ext2fs and a number of Linux ISOs were copied to it after mounting it. FreeBSD's pkg grub2 is also installed on the USB stick and I can successfully but some of the Linux distros using `grub`. After I reboot and start FreeBSD (11.0-RELEASE) I am unable to mount the ext2fs partition.

```
mount -t ext2fs /dev/da0s2 /mnt
mount: /dev/da0s2: Operation not permitted
```

Occasionally the mount does work, but most often not.

Any suggestions as to what might be wrong? Has the partition been left in an unmountable state? 

I tried `fsck.ext2 /dev/da0s2` and got the following error

```
Error writing file system info: Invalid argument
```


----------



## tobiam (Apr 16, 2017)

You want to add -o ro as a flag, because it cannot be mounted in a writeable mode currently.


----------



## João Luis (Apr 24, 2017)

tobiam said:


> You want to add -o ro as a flag, because it cannot be mounted in a writeable mode currently.



Sorry, but i really have a need to write in a ext2fs.
Is not possible mount an ext2fs r/w any way ?? 
A fair amount of Internet pages, even FreeBSD book, consider it possible. What happened ?


----------



## balanga (Apr 24, 2017)

It normally is possible, but in my case I had a problem which I was unable to resolve.

Do you have an ext2fs and have you tried to mount it? What was the error?


----------



## João Luis (Apr 24, 2017)

tobiam said:


> You want to add -o ro as a flag, because it cannot be mounted in a writeable mode currently.



Sorry, but i really have a need to write in a ext2fs.
Is not possible mount an ext2fs r/w any way ?? 
A fair amount of Internet pages, even FreeBSD book, consider it possible. What happened ?


----------



## João Luis (Apr 24, 2017)

Hi Balanga,

First of all, i cannot mount as a regular user, even who is in operator group. I cannot mount to write as well.

$ sudo mount -t ext2fs /dev/da0s1 /media/da0s1/
mount: /dev/da0s1: Operation not permitted

ls -l /dev/da*
crw-rw-rw-  1 root  operator  0x8d 24 abr 11:52 /dev/da0
crw-rw-rw-  1 root  operator  0x90 24 abr 11:52 /dev/da0s1

vfs.usermount: 1

[]s

JL


----------



## balanga (Apr 24, 2017)

What's the output from `gpart show` or `gpart list da0`.


----------



## acheron (Apr 24, 2017)

Have you tried with sysutils/fusefs-ext4fuse?


----------



## João Luis (Apr 24, 2017)

balanga said:


> What's the output from `gpart show` or `gpart list da0`.



$ gpart show da0
=>        63  2930277105  da0  MBR  (1.4T)
          63  2930272002    1  linux-data  (1.4T)
  2930272065        5103       - free -  (2.5M)

$ gpart list da0
Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 2930277167
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: da0s1
   Mediasize: 1500299265024 (1.4T)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 32256
   Mode: r1w0e0
   rawtype: 131
   length: 1500299265024
   offset: 32256
   type: linux-data
   index: 1
   end: 2930272064
   start: 63
Consumers:
1. Name: da0
   Mediasize: 1500301910016 (1.4T)
   Sectorsize: 512
   Mode: r1w0e0


----------



## balanga (Apr 24, 2017)

`ls -al  /media`?


----------



## João Luis (Apr 24, 2017)

acheron said:


> Have you tried with sysutils/fusefs-ext4fuse?



Yeah !! I am still in read-only mode.

$ sudo ext4fuse /dev/da0s1  /media/da0s1/

$ df
Filesystem  512-blocks     Used     Avail Capacity  Mounted on
/dev/fuse            0        0         0   100%    /media/da0s1

$ ls /media/da0s1/
ls: /media/da0s1/: Operation not permitted

$ sudo ls /media/da0s1/
Daredevil-FreeBSD11-15fev2017   lost+found           msps               VM
e-Books               Machines           OLD
FreeBSD               Movies               Pictures

$ sudo touch /media/da0s1/TESTE
touch: /media/da0s1/TESTE: Function not implemented


----------



## João Luis (Apr 24, 2017)

balanga said:


> `ls -al  /media`?



$ ls -al /media/
total 18
drwxr-xr-x   3 root  wheel   512 24 abr 11:49 .
drwxr-xr-x  21 root  wheel  1024 24 abr 11:49 ..
drwxr-xr-x  12 jl    wheel  4096 15 fev 16:52 da0s1


----------



## balanga (Apr 24, 2017)

`disktype /dev/da0s1` ?


----------



## João Luis (Apr 24, 2017)

balanga said:


> `disktype /dev/da0s1` ?



$ disktype /dev/da0s1

--- /dev/da0s1
Character device, size 1.365 TiB (1500299265024 bytes)
Ext2 file system
  Volume name "jlBACKUP"
  UUID D3DF2652-BD76-4620-926D-EC31631E1F64 (DCE, v4)
  Last mounted at "/media/jl/jlBACKUP"
  Volume size 1.365 TiB (1500299264000 bytes, 366284000 blocks of 4 KiB)


----------



## balanga (Apr 24, 2017)

`fsck -t ext2 /dev/da0s1` ?


----------



## tobiam (Apr 25, 2017)

Can it be that you are trying to actually access ext4, rather than an earlier version supporting writes? The errors you receive seem to suggest that.

To check that use:

`file -sL /dev/da0s2`

In that case according to the manual page ext2fs(5), the handbook (see the note) and the readme of ext4fuse you will be out of luck with either of those two drivers.


----------

