Skip to contentSkip to conversation

Writing to superblock?

DISCUSSION BandiPat 3 participants 3 messages Feb 20, 2009 – Feb 21, 2009

lore
Share & tools
lore

BandiPat

author
#0 lore raw

Quickly getting the devs of Zenwalk convinced to move over to Grub2 it seems. They are now busy working on a script that will help the user set up Grub2 when installing Zenwalk! Let me just say I'm very pleased with their enthusiasm over converting from Lilo to Grub2.

Anyway, the writer of the script ask me a question I have not been able to find anything about, so I thought I would come straight to you guys!
I already know that Grub2 will work with XFS and will write to the
MBR, but he is asking about Superblocks also when using XFS. Will it? Any special instructions needed to do that? I hope I am asking the right question. Just let me know if you need more clarification.

TIA,
Pat

Signature · 3 lines
       ---Zenwalk v6.0--Linux 2.6.28---
        Registered Linux User #225206
"Ever tried Zen computing?"  http://www.zenwalk.org
#1 lore raw
Quoted 5 lines · BandiPat

Anyway, the writer of the script ask me a question I have not been able to find anything about, so I thought I would come straight to you guys!
I already know that Grub2 will work with XFS and will write to the
MBR, but he is asking about Superblocks also when using XFS. Will it?

If I understand you correctly, you talk about writing GRUB to a root sector of a partition that contains a XFS filesystem (which happens to coincide with the start of the superblock of XFS' first allocation group), right?

I mean the traditional way to execute raw boot code from a partition is to chainload its first sector and jump to its first byte, which means there has to be boot code at this place or at the very least a jump instruction that points to the real boot code.

But I don't think this is possible with XFS since it has its magic number in the first 4 bytes. It looks like this:

00000000  58 46 53 42 00 00 10 00  00 00 00 00 00 20 00 00  |XFSB......... ..|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  19 c5 80 51 80 34 4a c9  b6 aa c5 44 0b 16 c7 7b  |...Q.4J....D...{|

etc.

For this, also have a peek at
http://xfs.org/index.php/XFS_FAQ#Q:_Does_LILO_work_with_XFS.3F

The alternative would be to find another unused cave with stable location in XFS' metadata, although I doubt there is one. But you may want to check more deeply at http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf

Regards,
Niels Böhm

#2 lore raw
In reply to BandiPat
Quoted 7 lines · BandiPat

Anyway, the writer of the script ask me a question I have not been able to find anything about, so I thought I would come straight to you guys! I already know that Grub2 will work with XFS and will write to the MBR, but he is asking about Superblocks also when using XFS. Will it? Any special instructions needed to do that? I hope I am asking the right question. Just let me know if you need more clarification.

This is highly discouraged and won't work at all in some cases (I think XFS is one of those). Just install to MBR instead.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."