FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Tue Oct 19, 2021 14:32



Post new topic Reply to topic  [ 4 posts ] 
uClinux mount problem 
Author Message

Joined: Tue Mar 22, 2011 12:12
Posts: 2
Post uClinux mount problem
Hello, i did following steps to install NTFS-3G for uClinux running on blackfin processor:

1. I have enabled the "FUSE (Filesystem in Userspace) support" in uClinux kernel
2. I configured the NTFS-3G (Stable Source Release 2011.1.15) with:
./configure --host=bfin-linux-uclibc --enable-really-static
3. I changed the fork() parts (to vfork() - because of blackfin ) of the source code and did "make" and "make install"
4. I made a copy of "ntfs-3g"and "ntfs-3g.probe" into uClinux /bin directory
5. I tried to mount the ntfs disc under uClinux with: root: /> ntfs-3g /dev/sda1 /mnt/

but i ended up with the following error on blackfin:

Failed to write lock '/dev/sda1': Permission denied
Error opening '/dev/sda1': Permission denied
Failed to mount '/dev/sda1': Permission denied
Please check '/dev/sda1' and the ntfs-3g binary permissions,
and the mounting user ID. More explanation is provided at
http://ntfs-3g.org/support.html#unprivileged



PS: With
root: /> mount /dev/sda1 /mnt/
i was able to mount the disk so i have permissions to acces the device.

root: /> ls -l /dev/sda1
brw-rw---- 1 root root 8, 1 Jan 1 00:00 /dev/sda1

I do also have access right to the mount point.

Acces rights for ntfs-3g:
root:/> ls -al ntfs-3g
-rwxrwxrwx 1 root root 1996618 Jan 1 03:03 ntfs-3g

I tried to run the ntfs-3g with strace to see more details what happened.

root: /> strace ./ntfs-3g /dev/sda1 /mnt/usb/

ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B57600 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B57600 opost isig icanon echo ...}) = 0
getpid() = 426
sched_getaffinity(1, 4, {1}) = 4
rt_sigaction(SIGRTMIN, {0x5d1910, [], 0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x5d1920, [RTMIN], 0}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0x5d1500, [], 0}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RT_1], NULL, 8) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x28aa000
open("/dev/null", O_RDWR|O_LARGEFILE) = 3
close(3) = 0
getegid32() = 0
getgid32() = 0
getegid32() = 0
setresgid32(-1, 0, 0) = 0
getegid32() = 0
geteuid32() = 0
getuid32() = 0
geteuid32() = 0
setresuid32(-1, 0, 0) = 0
geteuid32() = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x5c0000
readlink("/dev", 0x29bec30, 4095) = -1 EINVAL (Invalid argument)
readlink("/dev/sda1", 0x29bec30, 4095) = -1 EINVAL (Invalid argument)
getuid32() = 0
getgid32() = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x2830000
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x2832000
readlink("/dev", 0x29bec04, 4095) = -1 EINVAL (Invalid argument)
readlink("/dev/sda1", 0x29bec04, 4095) = -1 EINVAL (Invalid argument)
open("/etc/mtab", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/mnt/usb/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x29bfa24) = -1 ENOTTY (Inappropriate ioctl for device)
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 256) = 211
close(3) = 0
geteuid32() = 0
getegid32() = 0
stat64("/dev/fuse", {st_mode=S_IFCHR|0660, st_rdev=makedev(10, 229), ...}) = 0
stat64("/dev/misc", {st_mode=S_IFDIR|0775, st_size=0, ...}) = 0
stat64("/dev/misc/fuse", {st_mode=S_IFCHR|0666, st_rdev=makedev(10, 229), ...}) = 0
getegid32() = 0
getgid32() = 0
getegid32() = 0
setresgid32(-1, 0, 0) = 0
getegid32() = 0
geteuid32() = 0
getuid32() = 0
geteuid32() = 0
setresuid32(-1, 0, 0) = 0
geteuid32() = 0
stat64("/dev/sda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 1), ...}) = 0
mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x1500000
stat64("/dev/sda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 1), ...}) = 0
open("/dev/sda1", O_RDWR|O_LARGEFILE) = 3
fcntl64(3, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 0x29bfacc) = -1 EACCES (Permission denied)
write(2, "Failed to ", 10Failed to ) = 10
write(2, "write", 5write) = 5
write(2, " lock '", 7 lock ') = 7
write(2, "/dev/sda1", 9/dev/sda1) = 9
write(2, "'", 1') = 1
write(2, ": ", 2: ) = 2
write(2, "Permission denied", 17Permission denied) = 17
write(2, "\n", 1) = 1
close(3) = 0
write(2, "Error opening '", 15Error opening ') = 15
write(2, "/dev/sda1", 9/dev/sda1) = 9
write(2, "'", 1') = 1
write(2, ": ", 2: ) = 2
write(2, "Permission denied", 17Permission denied) = 17
write(2, "\n", 1) = 1
munmap(0x1500000, 135168) = 0
write(2, "Failed to mount '", 17Failed to mount ') = 17
write(2, "/dev/sda1", 9/dev/sda1) = 9
write(2, "'", 1') = 1
write(2, ": ", 2: ) = 2
write(2, "Permission denied", 17Permission denied) = 17
write(2, "\n", 1) = 1
write(2, "Please check '", 14Please check ') = 14
write(2, "/dev/sda1", 9/dev/sda1) = 9
write(2, "' and the ntfs-3g binary permiss"..., 141' and the ntfs-3g binary permissions,
and the mounting user ID. More explanation is provided at
ntfs-3g.org/support.html#unprivileged) = 141
_exit(19) = ?


It looks like fuse changes uid/gid from root to -1 (probably "nobody")?

Can you give me some hints how to solve this problem?
Thanks


Tue Mar 22, 2011 12:54
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: uClinux mount problem
Hi,

Quote:
Hello, i did following steps to install NTFS-3G for uClinux running on blackfin processor:
[...]
but i ended up with the following error on blackfin:

Failed to write lock '/dev/sda1': Permission denied
Error opening '/dev/sda1': Permission denied
Failed to mount '/dev/sda1': Permission denied
Please check '/dev/sda1' and the ntfs-3g binary permissions,
and the mounting user ID. More explanation is provided at

Did you succeed with earlier versions, or is this your first try ?
Note : the explanations from the FAQ are only valid if the first assumption ("ntfs-3g is compiled with integrated FUSE support") is true, but with uClinux you can only use external fuse.

Quote:
setresgid32(-1, 0, 0) = 0
[...]
setresuid32(-1, 0, 0) = 0
[...]
readlink("/dev", 0x29bec30, 4095) = -1 EINVAL (Invalid argument)
readlink("/dev/sda1", 0x29bec30, 4095) = -1 EINVAL (Invalid argument)

So, some process is checking whether /dev or /dev/sda1 is a symbolic link.

This reminds me of a recent security update in fuse, of which you can see the description, for instance in http://www.mail-archive.com/lucid-chang ... 12037.html This update is apparently causing problems to Ubuntu users.

Hence my question about whether you have succeeded in the past. If so, a temporary workaround would be to downgrade fuse, but, if I understand correctly, you can also use the mount command.

Regards

Jean-Pierre


Tue Mar 22, 2011 15:01
Profile

Joined: Tue Mar 22, 2011 12:12
Posts: 2
Post Re: uClinux mount problem
Hi, thanks for your reply!
I tried to build NTFS-3g with external FUSE:

./configure --host=bfin-linux-uclibc LDFLAGS=-L/home/abc/work/Projekte/NTFS/fuse-2.8.5/lib --enable-really-static --with-fuse=external

The external FUSE was build by myself for uClinux.
But when i run it, there is no difference, still the Failed to write lock '/dev/sda1': Permission denied error.

I tried some older versions NTFS-3G 1.913 and 1.1120, but i got an error while building:
ntfs_3g-ntfs-3g.o: In function `_main':
ntfs-3g.c:(.text+0x1c84): undefined reference to `_fuse_opt_add_arg'
ntfs-3g.c:(.text+0x1c94): undefined reference to `_fuse_opt_add_arg'
ntfs-3g.c:(.text+0x1cbe): undefined reference to `_fuse_opt_add_arg'
ntfs-3g.c:(.text+0x1ce0): undefined reference to `_fuse_new'
ntfs-3g.c:(.text+0x1cea): undefined reference to `_fuse_opt_free_args'
ntfs-3g.c:(.text+0x1de0): undefined reference to `_fuse_loop'
ntfs-3g.c:(.text+0x1df2): undefined reference to `_fuse_unmount'
ntfs-3g.c:(.text+0x1dfa): undefined reference to `_fuse_destroy'
ntfs-3g.c:(.text+0x1f6a): undefined reference to `_fuse_opt_free_args'
ntfs-3g.c:(.text+0x1f9e): undefined reference to `_fuse_unmount'

I tried older versions of FUSE as well.

PS: i can use the mount command but only with ntfs option, not with ntfs-3g, so i am not able to write any data to the ntfs disc (uClinux ntfs supports only reading).

Do you have any other ideas?

Regards
Saman


Wed Mar 23, 2011 12:34
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: uClinux mount problem
Hi,

Quote:
I tried to build NTFS-3g with external FUSE:
[...]
The external FUSE was build by myself for uClinux.
But when i run it, there is no difference, still the Failed to write lock '/dev/sda1': Permission denied error.

With uClinux you have no option, you always use external fuse, even when not requesting so.
Quote:
I tried some older versions NTFS-3G 1.913 and 1.1120, but i got an error while building:

These are old versions (now unsupported), and you should use fuse from a similar generation.
Quote:
PS: i can use the mount command but only with ntfs option, not with ntfs-3g, so i am not able to write any data to the ntfs disc (uClinux ntfs supports only reading).

The old ntfs driver does not rely on fuse, so you cannot derive conclusions from its working.

Quote:
Do you have any other ideas?

Code:
geteuid32() = 0
stat64("/dev/sda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 1), ...}) = 0
mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x1500000
stat64("/dev/sda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 1), ...}) = 0
open("/dev/sda1", O_RDWR|O_LARGEFILE) = 3
fcntl64(3, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 0x29bfacc) = -1 EACCES (Permission denied)

So /dev/sda1 could be opened rw, but not locked. On Linux the manual says :
Code:
       EACCES or EAGAIN
              Operation is prohibited by locks held by other processes.

Is the device already mounted (by the read-only driver) ? Note that this could not be checked because there is apparently no /etc/mtab on uClinux.

Regards

Jean-Pierre


Wed Mar 23, 2011 13:41
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.