# Caja,nemo,pcmanfm don't see the files if the partition is mounted with "lklfuse -o type=ext4" as root



## ziomario (Aug 7, 2021)

Hello to everyone. I think that I've found a bug. Judje by yourself.


```
root@marietto:~/Desktop # lklfuse -o type=ext4 /dev/da2s1 /mnt/da2s1

root@marietto:~/Desktop # cd /mnt/da2s1

root@marietto:/mnt/da2s1 # ls

.Trash-0        lost+found        ubuntu-budgie-gpu.img    vms
.Trash-1000        OS            Virt

root@marietto:/mnt/da2s1 # thunar
```


----------



## eternal_noob (Aug 7, 2021)

If this is a question -> http://catb.org/~esr/faqs/smart-questions.html
if this is a bug report -> https://bugs.freebsd.org/bugzilla/


----------



## George (Aug 7, 2021)

Thunar should see those files. Yet it doesn't.


----------



## Alain De Vos (Aug 7, 2021)

My experience is that lklfuse works as root and read-write. It's "beta" grade.


----------



## ziomario (Aug 7, 2021)

I've reported the bug.


----------



## Alain De Vos (Aug 7, 2021)

Caja,nemo,pcmanfm  are alternative filemanagers to thunar. These could direct to where the problem is located.


----------



## ziomario (Aug 7, 2021)

I don't like caja and nemo because I can't write manually the path of the file and folder I want to reach. pcmanfm is the file manager I want. its similar to thunar and....it works great. It allows to me to see the content of the mounted file systems. So,now we are sure that thunar is bugged.


----------



## Tieks (Aug 7, 2021)

If the problem is that you don't see the files beginning with a dot, these files are considered hidden files. That is why Thunar doesn't show these files in default mode. You can choose to see the files, there's an option 'Show hidden files' under menu item View (it's Visualimacaroni in your case, I think).


----------



## ziomario (Aug 7, 2021)

no,I don't see any files. And even pcmanfm is not working like thunar. Check the image below :


----------



## DanDare (Aug 7, 2021)

After you mount the folder

What's output of command:
ls -la / | grep mnt

And what's output of command:
ls -la /mnt/da2s1


----------



## ziomario (Aug 8, 2021)

```
ls -la / | grep mnt
drwxr-xr-x  11 root  wheel          512 28 lug 18:17 mnt
```


```
ls -la /mnt/da2s1

total 44
drwxrwxrwx   8 1000  1000    4096  1 gen  1970 .
drwxr-xr-x  11 root  wheel    512 28 lug 18:17 ..
drwxrwxrwx   5 1000  1000    4096 30 mag 18:17 .Trash-0
drwx------   5 1000  1000    4096 11 apr 20:20 .Trash-1000
drwxrwxrwx   2 1000  1000   16384  1 apr 02:13 lost+found
drwxrwxrwx   9 1000  1000    4096 18 lug 16:36 OS
drwxrwxr-x  11 1000  1000    4096 11 lug 18:47 Virt
drwxr-xr-x   4 root  wheel   4096  1 gen  1970 vms
```


----------



## DanDare (Aug 8, 2021)

Sorry. For the second command I wanted to say:
ls -la /mnt | grep da2s1


----------



## Vull (Aug 8, 2021)

ziomario said:


> ```
> ls -la / | grep mnt
> drwxr-xr-x  11 root  wheel          512 28 lug 18:17 mnt
> ```
> ...


What user account corresponds to uid=1000? This user account must not exist in your /etc/passwd file, because, if it did, you would see user account names and group account names there, instead of the number 1000. uid=1000 is usually your default Linux account uid from distributions like Ubuntu or Debian. FreeBSD user accounts usually start with a default uid of 1001 unless you override it. Do you even have a lower-level user account, or do you just login as root to do everything?


----------



## DanDare (Aug 8, 2021)

Vull said:


> What user account corresponds to uid=1000? This user account must not exist in your /etc/passwd file, because, if it did, you would see user account names and group account names there, instead of the number 1000. uid=1000 is usually your default Linux account uid from distributions like Ubuntu or Debian. FreeBSD user accounts usually start with a default uid of 1001 unless you override it. Do you even have a lower-level user account, or do you just login as root to do everything?


Can't remember well but that would be just normal as he's mounting some external ext4 partition? Anyway from permission bits still had to be show in Thunar, right?


----------



## DanDare (Aug 8, 2021)

Other thing is: xfce probably auto mounting these under /media folder so perhaps conflicting if you try mounting these again


----------



## Vull (Aug 8, 2021)

DanDare said:


> Other thing is: xfce probably auto mounting these under /media folder so perhaps conflicting if you try mounting these again
> 
> View attachment 10933


Good guess. I don't see enough information to diagnose this problem, but whatever it is, I don't think it's a FreeBSD bug.

I have too little information and too few clues as to what OP is even trying to do.


----------



## ziomario (Aug 8, 2021)

DanDare said:


> Sorry. For the second command I wanted to say:
> ls -la /mnt | grep da2s1



lklfuse -o type=ext4 /dev/da2s1 /mnt/da2s1
ls -la /mnt | grep da2s1
d---------   0 root  wheel     0  1 gen  1970 da2s1


----------



## ziomario (Aug 8, 2021)

Vull said:


> What user account corresponds to uid=1000? This user account must not exist in your /etc/passwd file, because, if it did, you would see user account names and group account names there, instead of the number 1000. uid=1000 is usually your default Linux account uid from distributions like Ubuntu or Debian. FreeBSD user accounts usually start with a default uid of 1001 unless you override it. Do you even have a lower-level user account, or do you just login as root to do everything?



I'm using root to do everything. Please don't suggest me to don't use root because security risks. I know that. I use the root account because I can,I'm learning FreeBSD and for me it's easier at the moment. For sure I will stop using when I will have taken more confidence with the os. The important informations are safe,don't worry.


----------



## ziomario (Aug 8, 2021)

Vull said:


> Good guess. I don't see enough information to diagnose this problem, but whatever it is, I don't think it's a FreeBSD bug.
> 
> I have too little information and too few clues as to what OP is even trying to do.



I'm here to explain. Just ask and I will reply with the informations you need to diagnose the problem. Anyway,I'm not doing something special. I want to mount in rw or ro mode the disks that are attached to my PC when I use FreeBSD. Easy. I'm mounting these disks (some of them are formatted with ext4,some others with ntfs and one with ufs) using the proper command lines because when I do this using the icons that are on my desktop,I can't mount any of them. Below u can see the error that I get,that,in english language sounds like this : "can't mount Android2 ; mount: failed with". For this reason,I'm not mounting a disk two or more times. Simply I'm not trying to mount any disk clicking on the disk icon on my desktop because it does not wok. I mount every disk using the desktop manager xfce4 and I don't get errors. This is the script that I use :

lklfuse -o type=ext4 /dev/ada0s1 /mnt/ada0s1 # CT500 (466 GB / Ubuntu 21.04)
lklfuse -o type=ext4 /dev/ada1p3 /mnt/ada1p3 # Samsung SSD 860 EVO 500GB / nixos
lklfuse -o type=ext4 /dev/da1p1 /mnt/da1p1   # Toshiba (932G)
lklfuse -o type=ext4 /dev/da2s1 /mnt/da2s1   # 1.8T Toshiba

ntfs-3g /dev/nvd0p2 /mnt/nvd0p2 # Windows da 900GB
ntfs-3g /dev/da0p1 /mnt/da0p1 # Elements
ntfs-3g /dev/da3p2 /mnt/da3p2 # 1.8T Seagate

mount -t ufs /dev/ada1p2 /mnt/ada1p2 # Samsung SSD 860 EVO 500GB / FreeBSD da 100 GB

unfortunately using this method,if I want to see the content of the disks,I can do it only within the terminal. it seems that the desktop managers that I tried aren't able to display it.


----------



## Geezer (Aug 8, 2021)

ziomario said:


> I'm here to explain. Just ask and I will reply with the informations you need to diagnose the problem.


??


----------



## ziomario (Aug 8, 2021)

Geezer said:


> ??


??


----------



## Alain De Vos (Aug 8, 2021)

???


----------



## Vull (Aug 8, 2021)

ziomario said:


> ??


What desktop environment (DE) are you running? My DE is Mate.

Have you started your DE using the root account or using a lower level account?

My file manager is Caja. In this screenshot below, you can see that Caja has a "Preferences" setting to show hidden files, and I've ticked that setting. This allows me to see the lost+found file in an ext4 partition. If I don't tick that setting, I can't see lost+found because it's a hidden file. See if you can find a similar setting in your file manager.

In your screenshot, see the little up-arrow icons to the right of all those partitions? That up-arrow suggests you have clicked on them. This causes those partitions to be mounted under the /media directory. Then perhaps you're trying to remount them from the command line. This can create conflicts. Try rebooting and repeat your tests without clicking on those partitions to avoid such conflicts.




Edited to add: Please read the ls(1) manual page.


----------



## ralphbsz (Aug 8, 2021)

ziomario said:


> I want to mount in rw or ro mode the disks that are attached to my PC when I use FreeBSD.


Note that "foreign" file systems (like NTFS or ext2/3/4 on FreeBSD, or UFS on Linux) are never production quality, and have high risk of data corruption, in particular if you use them to write to the foreign file systems. I would only mount them read-only on FreeBSD. You also have to be very careful to make sure all caches are flushed: Never put Windows to sleep, start FreeBSD, and then mount the NTFS file system from FreeBSD: when Windows goes to sleep, the write cache is not actually written to disk yet, so FreeBSD will find (and perhaps modify) a potentially outdated and inconsistent copy on disk. Always make sure the other operating system is fully shut down (or the file system unmounted, which is not possible for the root filesystem) before switching OSes.


----------



## DanDare (Aug 8, 2021)

ziomario said:


> lklfuse -o type=ext4 /dev/da2s1 /mnt/da2s1
> ls -la /mnt | grep da2s1
> d---------   0 root  wheel     0  1 gen  1970 da2s1


See the da2s1 folder permissions from the 'ls -la' command, that's too restrictive, a normal user should not be able to see the filles.

Ziomario: What is the user you're using to launch xfce4? Are you lauching xfce using root account or other account?

What are that folders (mount points) I pointed in the red circle I draw on the image?

And, pretty much what Vull said already. Can you follow his instructions and come back with the results?


----------



## grahamperrin@ (Aug 8, 2021)

ziomario said:


> reported



FreeBSD bug 257677 – x11-fm/thunar: not able to display the content of the folder where I have mounted the ntfs / ext4 / ufs file systems


----------



## ziomario (Aug 8, 2021)

I know,this is the bug that I have reported.


----------



## ziomario (Aug 8, 2021)

Vull said:


> What desktop environment (DE) are you running? My DE is Mate.
> 
> Have you started your DE using the root account or using a lower level account?
> 
> ...



What desktop environment (DE) are you running? ---> XFCE4.

Have you started your DE using the root account or using a lower level account? ---> root.

My file manager is Caja. In this screenshot below, you can see that Caja has a "Preferences" setting to show hidden files. ---> This is not the explanation for this bug. I don't see any file,not only the hidden files.

In your screenshot, see the little up-arrow icons to the right of all those partitions? That up-arrow suggests you have clicked on them. This causes those partitions to be mounted under the /media directory. Then perhaps you're trying to remount them from the command line ---> maybe I've clicked on those partitions,but then I've got the error below :






so,it didn't mount the disks. Anyway I tried to mount those partitions even without clicking on the little up-arrow icon to the right of them.


----------



## eternal_noob (Aug 9, 2021)

ziomario said:


> I'm using root to do everything. Please don't suggest me to don't use root because security risks. I know that.


Sorry but this is a public forum where other people are searching for information. It's just stupid to start X as root and we want to prevent others to do the same mistake if they are reading this thread. It's not about you, it's about harm reduction. 



ziomario said:


> I use the root account because I can,I'm learning FreeBSD and for me it's easier at the moment. For sure I will stop using when I will have taken more confidence with the os.


If you REALLY want to learn FreeBSD, stop logging in as root. None of the professionals does this. In addition, there are things which just don't work out of the box using root :


cmoerz said:


> I read through those logs on Github as well as in your previous posts; you're trying to connect as root. I believe this will not work, unless you updated your /usr/local/etc/xrdp/sesman.ini beforehand (see *AllowRootLogin* value).





ziomario said:


> The important informations are safe,don't worry.


----------



## ziomario (Aug 10, 2021)

What about this ? Is this a bug ? I've logged in FreeBSD as a normal user,I've mounted the ext4 partition in the fstab file with this line :

/dev/ada0s1     /mnt/ada0s1     fuse    ro,failok,late,mountprog=/usr/local/bin/lklfuse,type=ext4,allow_other   0       0

(I haven't got any error during the boot,in relation with the mounting of the ada0s1 disk. Infact as u can see,I can see the content of the disk ada0s1,but only using the terminal. If I use thunar,it comes back the same situation I found when I tried to see the content of the disk using thunar but as root. Now I'm sure that there is a bug to fix.


----------



## DanDare (Aug 10, 2021)

You will be able to browse for these disks/files under /media folder using thunar, probably.


----------



## Vull (Aug 11, 2021)

I'm now running xfce4 on 13.0-RELEASE-p3.

If I mount an ext4 partition using `mount -t ext2fs` I can view the files using thunar.

If I mount the same partition using `lklfuse -o type=ext4` I get the following message:




Conclusion: This is not a bug in FreeBSD or in thunar. Perhaps this is a feature of `lklfuse` or perhaps it is indeed some sort of a bug in fusefs, which seems doubtful. I don't use lklfuse so it doesn't really affect me either way.

This is what OP probably would have seen if he had not started X using the root account.


----------



## ziomario (Aug 11, 2021)

Today I've started X as normal user and I've changed the line that mount the linux disk in this way :

/dev/ada0s1     /mnt/ada0s1    fuse     ro,failok,late,uid=1001,gid=1001,mountprog=/usr/local/bin/lklfuse,type=ext4,allow_other    0    0

because I wanted that it reflected the permissions of the low level user (marietto). Again,I don't see the content of the disk using any file manager (and I repeat : I'm not using the root account). My id is :

marietto@marietto:/mnt/ada0s1 $ id

uid=1001(marietto) gid=1001(marietto) groups=1001(marietto),0(wheel),44(video)

list of the permissions / ownerships with ls -al :

marietto@marietto:/mnt/ada0s1 $ ls -al

total 1216
drwxr-xr-x   27 marietto  marietto     4096  7 ago 01:19 .
drwxr-xr-x   11 root      wheel         512 28 lug 18:17 ..
-rw-------    1 marietto  marietto       39  7 mag 19:10 .bash_history
drwxrwxr-x    2 marietto  marietto     4096  1 mar 19:19 .cache
-rw-r--r--    1 marietto  marietto     1024  4 mag 23:46 .hs_err_pid59.log.swp
drwxrwxrwx    4 marietto  marietto     4096 31 ago  2020 .Trash-0
drwx------    5 marietto  marietto     4096  1 mar 19:54 .Trash-1000
lrwxrwxrwx    1 marietto  marietto        7  1 mar 14:34 bin -> usr/bin
drwxr-xr-x    4 marietto  marietto     4096 22 lug 00:17 boot
drwxr-xr-x    2 marietto  marietto     4096  1 mar 14:07 cdrom
-rw-------    1 marietto  marietto  9756672  7 ago 01:19 core
drwxr-xr-x    4 marietto  marietto     4096 22 ott  2020 dev
drwxr-xr-x  194 marietto  marietto    12288  7 ago 01:19 etc
drwxr-xr-x    3 marietto  marietto     4096  9 giu 13:47 home
-rw-r--r--    1 marietto  marietto      690  4 mag 23:45 hs_err_pid59.log
lrwxrwxrwx    1 marietto  marietto        7  1 mar 14:34 lib -> usr/lib
lrwxrwxrwx    1 marietto  marietto        9  1 mar 14:34 lib32 -> usr/lib32
lrwxrwxrwx    1 marietto  marietto        9  1 mar 14:34 lib64 -> usr/lib64
lrwxrwxrwx    1 marietto  marietto       10  1 mar 14:34 libx32 -> usr/libx32
drwxrwxrwx    3 marietto  marietto    16384  3 ago  2020 lost+found
drwxr-xr-x    5 marietto  marietto     4096 27 mar 08:33 media
drwxr-xr-x   13 marietto  marietto     4096 28 lug 20:13 mnt
drwxr-xr-x    4 marietto  marietto     4096 29 lug 20:15 nix
-rw-------    1 marietto  marietto      202  7 mag 17:36 nohup.out
drwxr-xr-x   14 marietto  marietto     4096 22 lug 21:37 opt
drwxr-xr-x    3 marietto  marietto     4096 10 mar 18:01 path
drwxr-xr-x    2 marietto  marietto     4096 16 ott  2020 proc
drwxrwxrwx   41 marietto  marietto     4096  7 ago 01:20 root
drwxr-xr-x   12 marietto  marietto     4096  1 mar 14:35 run
lrwxrwxrwx    1 marietto  marietto        8  1 mar 14:34 sbin -> usr/sbin
drwxr-xr-x   18 marietto  marietto     4096  9 lug 22:32 snap
drwxr-xr-x    3 marietto  marietto     4096  2 mag 21:01 source
drwxr-xr-x    2 marietto  marietto     4096 31 mag 22:11 srv
drwxr-xr-x    2 marietto  marietto     4096 16 ott  2020 sys
drwxr-xr-x    2 marietto  marietto     4096 23 mar 22:42 timeshift
drwxrwxrwt   11 marietto  marietto    69632  7 ago 01:25 tmp
drwxr-xr-x   18 marietto  marietto     4096 19 lug 12:45 usr
drwxr-xr-x   18 marietto  marietto     4096 19 lug 12:45 var


----------



## Vull (Aug 11, 2021)

Please try:
`umount /mnt/ada0s1`
`mount -t ext2fs -o ro /dev/ada0s1 /mnt/ada0s1`

You should then be able to view your files using `thunar`.

Note: Nothing new needs to be installed. Unlike /usr/local/bin/lklfuse, /boot/kernel/ext2fs.ko is part of the base system.
ext2fs(5)


----------



## ziomario (Aug 11, 2021)

root@marietto:/mnt # umount /mnt/ada0s1
umount: unmount of /mnt/ada0s1 failed: Device busy

I should reboot and comment all the lklfuse lines to do that. I see that u have used ext2fs instead of lklfuse. I've added this line in the fstab file :

/dev/ada0s1     /mnt/ada0s1    ext2fs     ro    0    0

ok. with ext2fs it works. I can view the content of the disks using thunar. Unfortunately it does not support rw.


----------



## bsduck (Aug 11, 2021)

ziomario said:


> Unfortunately it does not support rw.


ext2fs does support writing. It's slow but it works.


----------



## Vull (Aug 11, 2021)

You were mounting read-only with lklfuse. Please re-read reply #24 in this thread again.

For /etc/fstab I suggest: `/dev/ada0s1     /mnt/ada0s1    ext2fs     ro,failok    0    2`

Without "failok" your system might fail to boot if any of these foreign filesystems get unmounted uncleanly.


----------



## astyle (Aug 11, 2021)

LOL, these symptoms usually mean that the filesystem was never mounted. FreeBSD's automounter sometimes tacks something onto the folder name. If you mount the drive by hand, like this: (assuming that lklfuse.ko is kldload-ed):

```
# mount ext2fs_mount /dev/da0s1 /mnt/zip
% ls -l /mnt/zip
# umount /mnt/zip
```

If you let FreeBSD's automounter handle things, you'll end up having your files in different /media/seagate9t0-43nh5043nh9043nhgv0 folder or something like that every time. Then Thunar won't be able to see anything in /mnt/zip/ folder. 

Oh, and when unmounting, always make sure Thunar (or other programs) are not trying to access the device. Sometimes, I have to close VLC (because it was playing movies stored on the mounted media) first, and only after that, unmounting becomes possible.


----------



## grahamperrin@ (Jan 3, 2022)

ziomario hi



ziomario said:


> … pcmanfm is the file manager I want. …



Is *PCManFM-Qt* x11-fm/pcmanfm-qt (the Qt port of PCManFM) of equal interest to you?

I see the developer/maintainer of sysutils/bsdisks recently using PCManFM-Qt in relation to another bug (not the one that you reported). It's feasible that this will lead, indirectly, to improvements relating to e.g. devices and volumes as they appear in the the sidebar of the application.


----------



## ziomario (Jan 5, 2022)

Thanks. But I've changed method. Now if I want to transfer files from and to a EXT4 and NTFS partition I don't mount the partition using the driver ported for FreeBSD,but I use a bhyve VM with its native driver. I've seen too many damaged sectors.


----------



## grahamperrin@ (Jan 5, 2022)

Thank you,



ziomario said:


> … damaged sectors.



– damage with EXT4, with NTFS, or with both types of file system?

I have no _meaningful_ experience with sysutils/fusefs-ext2, and no _recent_ experience with sysutils/fusefs-ntfs, however I'm fairly certain that the solution for NTFS should be reliable enough – *if* the file system gets the care and attention that's required.

I do like, but don't _entirely_ agree with this:



ralphbsz said:


> Note that "foreign" file systems (like NTFS or ext2/3/4 on FreeBSD, or UFS on Linux) are never production quality, and have high risk of data corruption, in particular if you use them to write to the foreign file systems. I would only mount them read-only on FreeBSD. You also have to be very careful to make sure all caches are flushed: … Always make sure the other operating system is fully shut down (or the file system unmounted, which is not possible for the root filesystem) before switching OSes.



Now:



ziomario said:


> … I use a bhyve VM with its native driver. …



FYI:



grahamperrin said:


> When Windows says:
> 
> 
> 
> ...



– and so on; there's more of interest in that topic.

I'm slightly out of my depth, but I do wonder whether deficiencies on the Microsoft side can increase the likelihood of encountering some of the more recently reported bugs on the FreeBSD side.

*Postscript*: from <https://forums.freebsd.org/posts/543765> I guess that you do _not_ dual boot, but for the record:

Windows Fast Startup dangerous for dual boot systems | The FreeBSD Forums


Historical, from around the time when I occasionally used NTFS with Mac OS X: Experiences : Paragon NTFS vs MacFuse and ntfs-3g? - Ars Technica OpenForum. I don't recall any gripes with the software, although it did (I think) become absurdly difficult, for a while, to find the open source alternative to the commercial solution. NTFS-3G for Mac OS X: NTFS-3G for Mac OS X 2010.10.2 became the go-to page.


----------

