Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I intend to make some changes to XFS filesystem. I have never done this before. I am running Ubuntu 12.04 kernel 3.2.0-40-generic-pae

Is there a documentation on the steps involved in doing so? I tried google but found nothing of much use. I have a rough understanding of the steps involved (see below), but I am looking for a detailed description so that I don't get stuck on simple things.

Steps in my mind:

  1. Download the source of XFS for my kernel version (using apt-get install linux-source ...)
  2. Make changes to the source file
  3. compile only the modified source code of XFS (When I tried to "make" it asked for some conf file, which I am not sure where I can get from) (do I have to recompile the whole kernel or just XFS is fine?)
  4. rmmod the xfs module and then insmod the xfs module so that changes are reflected in the system.
  5. create a new partition, format it with XFS and test if things are alright after my changes.

Looking forward to some useful pointers.

Its OK if the pointers are for some other FS like ext3 or 4 as I believe the details would not vary from FS to FS.

share|improve this question
add comment

2 Answers 2

Try the following:

First install some dependencies, the ncurses-dev is only needed if you want to use make menuconfig

sudo apt-get install build-essential ncurses-dev

Create some folder for the source, then download the kernel source. The folder linux-lts-quantal-3.5.0 is the right one for my kernel, you might change that depending on your environment. I just tested it with 12.04 LTS.

mkdir /home/<user>/kernel/
apt-get source linux-image-`uname -r`
cp /boot/config-`uname -r` /home/<user>/kernel/linux-lts-quantal-3.5.0/.config
cp /usr/src/linux-headers-`uname -r`/Module.symvers /home/<user>/kernel/linux-lts-quantal-3.5.0/

Now you should be able to build the kernel or modules:

cd /home/<user>/kernel/linux-lts-quantal-3.5.0/
make prepare
make driver/<something>.ko

For building xfs you would then run make modules SUBDIRS=fs/xfs/.

That should be all!

Good luck!

share|improve this answer
add comment

It's dooable. I've been using a modified version of XFS for several years.

On Debian Wheezy, I use this:

make -C /lib/modules/3.2.0-4-686-pae/build SUBDIRS=/usr/src/linux-source-3.2/fs/xfs modules

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.