* Magic Number for New File system
@ 2004-12-17 6:12 Bhattiprolu, Ravikumar (Ravikumar)
2004-12-17 8:51 ` Mike Waychison
2004-12-18 2:39 ` Theodore Ts'o
0 siblings, 2 replies; 4+ messages in thread
From: Bhattiprolu, Ravikumar (Ravikumar) @ 2004-12-17 6:12 UTC (permalink / raw)
To: linux-kernel
Hi All,
We are planning to write a new file system for our requirements. Is
there any standard way to allocate a magic number for this new file
system? Also how to go about writing the new file system?
thanks and regards,
Ravi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Magic Number for New File system
2004-12-17 6:12 Magic Number for New File system Bhattiprolu, Ravikumar (Ravikumar)
@ 2004-12-17 8:51 ` Mike Waychison
2004-12-18 2:39 ` Theodore Ts'o
1 sibling, 0 replies; 4+ messages in thread
From: Mike Waychison @ 2004-12-17 8:51 UTC (permalink / raw)
To: Bhattiprolu, Ravikumar (Ravikumar); +Cc: linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bhattiprolu, Ravikumar (Ravikumar) wrote:
> Hi All,
>
> We are planning to write a new file system for our requirements. Is
> there any standard way to allocate a magic number for this new file
> system?
Have a cat walk across your numpad. The value is pretty meaningless
other than as a unique identifier for your fstype. See statfs(2) for a
list of known MAGIC numbers.
> Also how to go about writing the new file system?
>
For a block device backed fs, see fs/minix/* for a simple enough
example. Another good example for a much simpler fs is fs/ramfs/inode.c
- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me,
and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBwp3/dQs4kOxk3/MRAnR0AJ4vOWqcG6L192xmsaO3w03Vc5qQhACbBthn
IDjz1oO7q0mofmP1uuitv/E=
=u+W+
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Magic Number for New File system
2004-12-17 6:12 Magic Number for New File system Bhattiprolu, Ravikumar (Ravikumar)
2004-12-17 8:51 ` Mike Waychison
@ 2004-12-18 2:39 ` Theodore Ts'o
2004-12-18 19:53 ` Phil Lougher
1 sibling, 1 reply; 4+ messages in thread
From: Theodore Ts'o @ 2004-12-18 2:39 UTC (permalink / raw)
To: Bhattiprolu, Ravikumar (Ravikumar); +Cc: linux-kernel
On Fri, Dec 17, 2004 at 11:42:48AM +0530, Bhattiprolu, Ravikumar (Ravikumar) wrote:
>
> We are planning to write a new file system for our requirements. Is
> there any standard way to allocate a magic number for this new file
> system? Also how to go about writing the new file system?
There's no standard place to put a magic number, let alone a standard
way to generate a magic number.... that being said, I'd suggest an 8
character field that contains the ascii name of your filesystem plus a
format version number at the beginning of the superblock. The
location of the superblock will vary from filesystem to filesystem,
but most mkfs program will zero the first 4-8k at the beginning and
end of the device in order to prevent false recognition by programs
trying to ID the device looking for magic numbers in various different
locations.
The blkid library, contained in the e2fsprogs distribution, contains a
list of magic number and their locations used by various different
filesystems, if you'd like to take a look at that for some more
information.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Magic Number for New File system
2004-12-18 2:39 ` Theodore Ts'o
@ 2004-12-18 19:53 ` Phil Lougher
0 siblings, 0 replies; 4+ messages in thread
From: Phil Lougher @ 2004-12-18 19:53 UTC (permalink / raw)
To: Theodore Ts'o, Bhattiprolu, Ravikumar (Ravikumar),
linux-kernel
On Fri, 17 Dec 2004 21:39:29 -0500, Theodore Ts'o <tytso@mit.edu> wrote:
> There's no standard place to put a magic number, let alone a standard
> way to generate a magic number....
>
> The blkid library, contained in the e2fsprogs distribution, contains a
> list of magic number and their locations used by various different
> filesystems, if you'd like to take a look at that for some more
> information.
The disktype program (http://disktype.sourceforge.net) can be used to
decode the content type of a disk/filesystem image. It recognises a
large amount of filesystems and partition types etc. From a quick
glance, the documentation describes the concepts behind magic numbers
and superblock formats, and gives an overview of the filesystem
formats recognised. If you're new to this, this is probably a
reasonable place to start.
Phillip
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-12-18 19:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-17 6:12 Magic Number for New File system Bhattiprolu, Ravikumar (Ravikumar)
2004-12-17 8:51 ` Mike Waychison
2004-12-18 2:39 ` Theodore Ts'o
2004-12-18 19:53 ` Phil Lougher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox