You are not logged in.

#1 2018-12-02 16:11:45

tabokie
Member
Registered: 2018-12-02
Posts: 10

[Solved] Cannot mount customized filesystem: Operation not permitted

I was running a self-compiled linux 4.14, and trying to test some filesystem. But right now I can't even mount a ext2 system by following lines:

# dd if=/dev/zero of=myfs bs=1M count=1
# /sbin/mkfs.ext2 myfs
# mount -t ext2 -o loop ./myfs /mnt

the system says mount: Operation not permitted.
I also notice that in this post [SOLVED] Cannot mount squashed filesystem after upgrade, a similar error occurs due to some boot partition problem.
And my result are 4.14 and 4.19. for

# uname -a
# pacman -Q linux

I wonder if I was compiling kernel the wrong way that leads to this error.

Last edited by tabokie (2018-12-04 15:34:59)

Offline

#2 2018-12-02 16:21:55

loqs
Member
Registered: 2014-03-06
Posts: 17,373

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

Welcome to the arch linux forums tabokie.  You have not supplied any details about the .config used for the custom kernel,  how it was built or how it was installed.
You also have not supplied the output from any command except mount.

Offline

#3 2018-12-02 17:01:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,793

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

tabokie wrote:

And my result are 4.14 and 4.19. for

# uname
# pacman -S linux

I wonder if I was compiling kernel the wrong way that leads to this error.

Yep. Edit: Well, no. it has nothing to do with how the kernel is compiled.  But that disparity is your problem </edit>

The kernel you are running is not the kernel that is installed; as such it cannot find its modules.

This can happen if you have updated the kernel and have not rebooted (you are still running the old kernel)
-or-
Your boot partition was not mounted when you updated the kernel, so the old kernel remains on the boot partition and the boot loader is still finding it.

BTW, your commands as shown work just fine here..

Last edited by ewaller (2018-12-02 17:03:01)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2018-12-02 17:28:49

loqs
Member
Registered: 2014-03-06
Posts: 17,373

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

$ uname
linux
# pacman -S linux
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-4.19.4.arch1-1

Total Download Size:   66.89 MiB
Total Installed Size:  71.31 MiB

:: Proceed with installation? [Y/n] 

Offline

#5 2018-12-03 04:02:28

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

ewaller wrote:

Your boot partition was not mounted when you updated the kernel, so the old kernel remains on the boot partition and the boot loader is still finding it.

BTW, your commands as shown work just fine here..

So how could I fix this without updating and dumping my compiled kernel? I'm positive that I am running the compiled kernel, only something wrong with boot partition.
Here is my script to compile and load new kernel:

make CROSS_COMPILE="ccache " -j4
make modules_install
cp -v ~/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-linux
mkinitcpio -p linux
grub-mkconfig -o /boot/grub/grub.cfg
reboot

Last edited by tabokie (2018-12-03 10:47:25)

Offline

#6 2018-12-03 04:03:29

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

loqs wrote:
$ uname
linux
# pacman -S linux
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-4.19.4.arch1-1

Total Download Size:   66.89 MiB
Total Installed Size:  71.31 MiB

:: Proceed with installation? [Y/n] 

I made a typo, should be pacman -Q linux

Offline

#7 2018-12-03 07:32:19

sincomil
Member
Registered: 2018-02-13
Posts: 106

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

can you check your dmesg output after trying to mount your loop device?

Last edited by sincomil (2018-12-03 07:32:29)

Offline

#8 2018-12-03 11:52:46

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

sincomil wrote:

can you check your dmesg output after trying to mount your loop device?

there is no new kernel message after the mount.

Offline

#9 2018-12-03 14:46:34

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

About "mount: Operation not permitted" on the extfs2 image: did you try that as regular user or as root?

Offline

#10 2018-12-03 16:13:18

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

seth wrote:

About "mount: Operation not permitted" on the extfs2 image: did you try that as regular user or as root?

as root.

Offline

#11 2018-12-03 17:06:11

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

Please post complete dmesg and lsmod outputs and "stat /lib/modules/`uname -r`"

Offline

#12 2018-12-03 17:07:57

loqs
Member
Registered: 2014-03-06
Posts: 17,373

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

Please post the output of zcat /proc/config.gz and lsmod.  If you have not included support for CONFIG_IKCONFIG please post the .config used.

Offline

#13 2018-12-04 13:39:24

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

I am using vmware and can't copy the whole config right now.
I re-install the system, all I have done till now are

a.install the system
b.compile a kernel
c.load it as an additional boot choice

btw, all config are as default.
After crosschecking, only difference between me and the guide is I use these lines to configure the EFI grub booting, instead of UEFI-GPT mode:

pacman -S grub efibootmgr
grub-install --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

And currently both systems are running ok, only that new kernel doesn't have the permission to mount.
Can anyone elaborate something on problems about boot partition?

Offline

#14 2018-12-04 14:29:52

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

new kernel doesn't have the permission to mount

That's nonsense, you more likely lack the loop module

I am using vmware and can't copy the whole config right now.

I assume you're looking for https://wiki.archlinux.org/index.php/Pastebin ?
Otherwise please elaborate how vmware relates to your ability to "copy the whole config".

The "boot partition problem" is the thing where the installed kernel is not the running kernel, thus no modules outside the initramfs (eg. the loop one) are available.
This happens when people forget to mount their boot partition when isntalling the kernel and initramfs.

Offline

#15 2018-12-04 14:52:31

loqs
Member
Registered: 2014-03-06
Posts: 17,373

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

tabokie wrote:

btw, all config are as default.

Which default defconfig,  alldefconfig or olddefconfig?  Please stop providing only the outputs you believe are relevant.
Please provide all the outstanding information requests.

Offline

#16 2018-12-04 15:15:21

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

seth wrote:

I assume you're looking for https://wiki.archlinux.org/index.php/Pastebin ?

loqs wrote:

Please provide all the outstanding information requests.

Thanks for the tool and advice, and indeed it's the loop module's fault.
Then how exactly do I have to do to mount the partition when installing my kernel? I didn't see it down here:
https://wiki.archlinux.org/index.php/Ke … ompilation

log and config as you want:
lsmod: https://ptpb.pw/-Bcn
dmesg: https://ptpb.pw/NH4x
zcat /proc/config.gz: https://ptpb.pw/_6RC

Last edited by tabokie (2018-12-04 15:17:03)

Offline

#17 2018-12-04 15:22:47

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

Does the dmesg output cover a failed mount attempt?
Also

stat /lib/modules/`uname -r`/kernel/drivers/block/loop.ko.xz

and (as root)

modprobe loop; lsmod | grep loop

Offline

#18 2018-12-04 15:34:38

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

seth wrote:

Does the dmesg output cover a failed mount attempt?
Also

stat /lib/modules/`uname -r`/kernel/drivers/block/loop.ko.xz

and (as root)

modprobe loop; lsmod | grep loop

Problem solved, I didn't set the CONFIG_BLK_DEV_LOOP when compiling kernel.
Thanks for help!

Offline

#19 2018-12-04 15:39:16

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

Your paste said:

CONFIG_BLK_DEV_LOOP=m

so it was compiled as a model.
Now you're compilig it it, SIDESTEPPING the module loading issues…

Offline

#20 2018-12-04 16:01:12

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

seth wrote:

Your paste said:

CONFIG_BLK_DEV_LOOP=m

so it was compiled as a model.
Now you're compilig it it, SIDESTEPPING the module loading issues…

the "modprobe loop" says Can't find module in /lib/modules/`uname -r` before, was it really compiled as module?

Offline

#21 2018-12-04 16:04:23

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

We don't know and especially we don't know whether you properly installed modules…

ls /lib/modules/
ls /lib/modules/`uname -r`
ls /lib/modules/`uname -r`/kernel/drivers
ls /lib/modules/`uname -r`/kernel/drivers/block

Offline

#22 2018-12-04 16:20:15

tabokie
Member
Registered: 2018-12-02
Posts: 10

Re: [Solved] Cannot mount customized filesystem: Operation not permitted

seth wrote:

We don't know and especially we don't know whether you properly installed modules…

I rebuild again with "CONFIG_BLK_DEV_LOOP=m", the loop.ko shows up.
donno what went wrong before, I will settle for now.

Offline

Board footer

Powered by FluxBB