0

I intend to make some changes to XFS filesystem.

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. Ensure my OS is not using XFS currently (no directories formatted as XFS)
  2. Download the source of XFS for my kernel version
  3. Make changes to the source file
  4. compile the modified source code (this step requires some conf files, which I am not sure where I can get from)
  5. rmmod the xfs module and then insmod the xfs module so that changes are reflected in the system.
  6. 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.

Thanks

Atish Kathpal
  • 693
  • 2
  • 7
  • 20

1 Answers1

1

Your steps might work, but if you run into any issues you could wind up with an unbootable system. The modules for the kernel must be built with the same version of compiler as the kernel itself or you'll have trouble. I've been stymied every time I tried to build a module for the kernel that came with the distro because the distribution maintainers invariably used some customized version of the compiler that I was not able to match.

A safer but longer option is install the kernel source package for your distro, and modify the XFS module source as necessary. Then build the entire kernel, including the customized XFS module, following the instructions for your linux distribution. Google for your distro and 'custom linux kernel', you should find dozens of hits.

Once built, you'll want to install your new kernel alongside your old one, and configure the bootloader to make the kernel selectable at boot time. This way even if something goes horribly wrong, you can still boot your system using your existing kernel.

Joe
  • 25,000
  • 3
  • 22
  • 44
  • "Then build the entire kernel, including the customized XFS module, following the instructions for your linux distribution." Is it not possible to build only the modified XFS and then load the recompiled module into the kernel? – Atish Kathpal Jun 12 '13 at 10:34
  • Yes, that is possible, IF you can get the exact versions of the compiler and linker used by the folks that originally compiled the kernel. I have personally found it faster and easier to build the entire kernel with the tool chain provided with the distro than to try to identify and obtain the versions required to go along with the provided kernel. – Joe Jun 12 '13 at 15:09