-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mounting from /etc/fstab #211
Comments
This is probably an issue with how fstab is parsed and how many times the options are passed through shell. You may need 4 escapes :) Can you please attach a strace -f of the mount command? @cemeyer can you please take a look? I am not familiar with FreeBSD and Linux has a different way of handling fstab / mount (using external helpers) which makes it hard for me to debug it. |
I'll look. I don't have a lot of familiarity with this part of the system either. If I had to guess, I'd guess that whatever parses fstab is ignoring your escapes entirely and just splitting on commas. Edit: I can't even get mount to attempt to mount a fuse filesystem. It prints:
Any idea, @eu41? @opurdila, by the way, the FreeBSD equivalent of |
Conrad, try a fstab entry simlar to mine. |
I used a very similar line:
|
Your line has the proper format, but ext4 does not support space_cache and compress=no, which are specific to btrfs. |
The output of truss -f mount /dev/ada5p5 is attached in a text file. |
mount hasn't gotten to where
Thanks! |
Would it be useful to send you the output of truss command that mounts successfully from command line? |
Hmm, looks like the output does not help much because the lklfuse execve arguments are not show. Quickly googling freebsd, truss and execve shows that using -a might help. @eu41 could you please rerun truss with -a and post the result here? Thanks! |
Octavian, I don't know much about tracing/debugging, but I did what you asked and applied some logic.
The second command fails with the message: fuse: unknown option `discard' As you see, the message indicates that the parsing of fstab seems to work properly, the option 'discard' is correctly detected, but somehow is unknown to fuse. Note that even if I add one escape or two escapes in fstab for "opts= ...", I get the same error message, which indicates again that parsing works fine. Note that the first line in my fstab, which is using ntfs-3g to mount a Windows partition works perfectly when doing "mount /dev/ada5p1". So there seems to be a difference on the way ntfs3g, lklfuse or mount deal with fstab lines. One more thing: the command that fails is "mount /dev/ada5p4". However, at the end of the output of truss you can see that actually mount is not trying to work with ada5p4 (btrfs partition), but ada5p5, which is my Freebsd native ufs root partition. No ideea why it does that. I have a feeling that FreeBSD mount does not know anything other than ufs partitions, but I cannot explain why "mount /dev/ada5p1" properly mounts the ntfs windows partition, while "mount /dev/ada5p4" fails to mount the btrfs partition. I don't know which one, mount or lklfuse, is the problem, but the fact that the parsing works, leans towards an lklfuse issue. Maybe Conrad has some ideas here. |
@eu41 please run with -f as well, i.e. truss -f -a, otherwise we can't see the arguments passed to fuse. |
See attached the output of truss -f -a for three versions of fstab: no escapes, 1 escape, 2 escapes. Looking at the parameters passed to lklfuse in execve, I think that the fstab should not include any escapes and it's up to lklfuse to assemble into one string all the "-o" options that follow "opts=..." and then use that string to do the mount. truss-no_excapes.txt |
Thanks! It seems that the fstab parser ignores the comma escapes. Also please note that -o rw, -o noatime, etc. are only passed to the fuse module and does not reach LKL. Right now lklfuse follows the libfuse's conventions and options to be passed to the mount system call should be passed as -o opts=... with , and = escaped. I am not sure if it is wise to pass all -o options to LKL since there may be collisions with fuse options. A safe way to solve this is to use a separate mount script as a wrapper for lklfuse. I'll have to think about this more, hope to have something in a couple of days. |
Why not trying to pass to LKL only its own specific options, including filesystem specific options, like -o type=btrfs,opts=space_cache,compress=no,discard ... etc. and leave the others like "rw,noatime ... etc." to be dealt with by OS specific mount command? After you think about it and do the necessary modifications, please let Conrad know, so he can update the FreeBSD port. |
crazy idea: why don't we just use the original mount command(from busybox or core-utils) and either change the source or use LD_PRELOAD to change the 'mount' syscall to a lklfuse function call? |
Check attached FreeBSD /etc/fstab: "mount /mnt/windows" works, while "mount /mnt/gentoo" fails Puzzling why ntfs-3g works fine and has no problems processing all the mounting options, one of them |
ACPICA commit 29da9a2a3f5b2c60420893e5c6309a0586d7a329 ACPI is allocating an object using kmalloc(), but then frees it using kmem_cache_free(<"Acpi-Namespace" kmem_cache>). This is wrong and can lead to boot failures manifesting like this: hpet0: 3 comparators, 64-bit 100.000000 MHz counter clocksource: Switched to clocksource tsc-early BUG: unable to handle page fault for address: 000000003ffe0018 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.6.0+ lkl#211 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 RIP: 0010:kmem_cache_alloc+0x70/0x1d0 Code: 00 00 4c 8b 45 00 65 49 8b 50 08 65 4c 03 05 6f cc e7 7e 4d 8b 20 4d 85 e4 0f 84 3d 01 00 00 8b 45 20 48 8b 7d 00 48 8d 4a 01 <49> 8b 1c 04 4c 89 e0 65 48 0f c7 0f 0f 94 c0 84 c0 74 c5 8b 45 20 RSP: 0000:ffffc90000013df8 EFLAGS: 00010206 RAX: 0000000000000018 RBX: ffffffff81c49200 RCX: 0000000000000002 RDX: 0000000000000001 RSI: 0000000000000dc0 RDI: 000000000002b300 RBP: ffff88803e403d00 R08: ffff88803ec2b300 R09: 0000000000000001 R10: 0000000000000dc0 R11: 0000000000000006 R12: 000000003ffe0000 R13: ffffffff8110a583 R14: 0000000000000dc0 R15: ffffffff81c49a80 FS: 0000000000000000(0000) GS:ffff88803ec00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000003ffe0018 CR3: 0000000001c0a001 CR4: 00000000003606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __trace_define_field+0x33/0xa0 event_trace_init+0xeb/0x2b4 tracer_init_tracefs+0x60/0x195 ? register_tracer+0x1e7/0x1e7 do_one_initcall+0x74/0x160 kernel_init_freeable+0x190/0x1f0 ? rest_init+0x9a/0x9a kernel_init+0x5/0xf6 ret_from_fork+0x35/0x40 CR2: 000000003ffe0018 ---[ end trace 707efa023f2ee960 ]--- RIP: 0010:kmem_cache_alloc+0x70/0x1d0 Bisection leads to unrelated changes in slab; Vlastimil Babka suggests an unrelated layout or slab merge change merely exposed the underlying bug. Link: https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Link: acpica/acpica@29da9a2a Fixes: f79c8e4 ("ACPICA: Namespace: simplify creation of the initial/default namespace") Reported-by: Jan Kiszka <[email protected]> Diagnosed-by: Vlastimil Babka <[email protected]> Diagnosed-by: Kees Cook <[email protected]> Signed-off-by: Vegard Nossum <[email protected]> Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Erik Kaneda <[email protected]> Cc: 5.10+ <[email protected]> # 5.10+ Signed-off-by: Rafael J. Wysocki <[email protected]>
The previous update #205 fixed the mounting with filesystem specific options when mounting with lklfuse from command line, but not from /etc/fstab.
The following happens:
lklfuse -o type=btrfs,opts=space_cache,compress=no,discard
works perfectly fine from command line.
When adding this line in /etc/fstab:
/dev/ada2p2 /mnt/data fuse mountprog=/usr/local/bin/lklfuse,type=btrfs,opts=space_cache 0 0
it also works.
But when I add a second or third, fourth filesystem specific option:
/dev/ada2p2 /mnt/data fuse mountprog=/usr/local/bin/lklfuse,type=btrfs,opts=space_cache,compress=no,discard 0 0
it fails with message "Unknown option compress=no".
Tried with one escape, two escapes and no escape, same result.
From fstab it only works with one option, it seems that it cannot deal with subsequent options after the first one.
The text was updated successfully, but these errors were encountered: