LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2015, 02:17 PM   #1
yashgovin19
LQ Newbie
 
Registered: Nov 2014
Posts: 6

Rep: Reputation: Disabled
Linux kernel module installation and other questions related to kernel module install


I have installed Linux 3.5 kernel and have compiled e2fsprogs as well. I have my own version of ext3 file system - lets say it is myfs. I have compiled myfs as well. Now I have few questions:

1.How to insert myfs module and where? When I do modprobe myfs (.ko file) it says module not found. When I simply do insmod myfs.ko it works but I am not sure where is it putting the .ko file. Also the displays I have added (on mkdir call) are not showing up (kernel debug level is also set to 8) when I try to create a directory in mounted folder

Makefile in myfs directory looks like this:

KERNEL_TREE ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

obj-m := iext3.o

iext3-objs := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
ioctl.o namei.o super.o symlink.o hash.o resize.o ext3_jbd.o \
xattr.o xattr_user.o xattr_trusted.o acl.o xattr_security.o icefs.o \
transaction.o commit.o recovery.o checkpoint.o revoke.o journal.o

all:
make -C $(KERNEL_TREE) M=$(PWD) modules

clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.markers *.order *.symvers

and I am compiling myfs from my own directory: /home/myname/soft/myfs.

Also, I don't see any ext2/ext3/ext4 directories in /lib/modules/linuxversion/kernel/fs/ -- not sure if this is right or wrong.

2.Mount is working fine. I can see myfs is mounted on /dev/sda3 by doing df -a. When I unmount It says - umount: /home/..../mnt: not mounted and then if I do df -a the file system is unmounted. This is strange as its unmounting but still throwing error.

Some Background: Directory where I have everything: /home/soft myfs/ mye2fs/ Linux-3.5/ mnt/

Step1: cd Linux-3.5 --> 1) make 2) make modules 3) make modules_install 4) make install 5) reboot

Step2: compile myfs (my version of ext3) and insert the myfs kernel module --> cd myfs/ --> make --> insmod myfs.ko

Step3: compiled mye2fs for mkfs

Step4: use mye2fs to create myfilesystem on a device --> mount --> test printk statements put under myfs modules
 
Old 06-03-2015, 02:33 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by yashgovin19 View Post
1.How to insert myfs module and where? When I do modprobe myfs (.ko file) it says module not found. When I simply do insmod myfs.ko it works but I am not sure where is it putting the .ko file.
You need to put it in the standard /lib/modules/... path so that modprobe can find it:
http://stackoverflow.com/questions/2...find-my-module

Insmod doesn't "put" the .ko file anywhere. It inserts it directly into the running kernel.

Quote:
Originally Posted by yashgovin19 View Post
Also, I don't see any ext2/ext3/ext4 directories in /lib/modules/linuxversion/kernel/fs/ -- not sure if this is right or wrong.
Modules can either be loadable on the fly, or built directly into the kernel. The other ext filesystem modules are likely compiled directly into the kernel, they're not loadable modules like yours is.

Last edited by suicidaleggroll; 06-03-2015 at 02:34 PM.
 
1 members found this post helpful.
  


Reply

Tags
ext3, insmod, linux, modprobe



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Difference between Static Kernel Module & Dynamic Kernel Module ram619 Linux - Newbie 2 12-11-2012 05:27 AM
[SOLVED] Install older kernel module into newer kernel - no symbol version for module bayoulinux Linux - Kernel 4 10-26-2011 04:32 AM
doubt related to module loading in kernel krap Linux - Kernel 9 07-12-2008 01:33 AM
2.6.5 module -post kernel install questions kkiedrowski Slackware 1 05-05-2004 03:03 PM
module related question when compiling kernel taoweijia Linux - Newbie 1 02-10-2004 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration