From: Andreas Dilger <adilger@sun.com>
To: Peter Teoh <htmldeveloper@gmail.com>
Cc: kernelnewbies <kernelnewbies@nl.linux.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: filesystem differentiation
Date: Sat, 15 Mar 2008 07:24:03 +0800 [thread overview]
Message-ID: <20080314232403.GI3542@webber.adilger.int> (raw)
In-Reply-To: <804dabb00803140917o2abebd2dh12c77b21a48094c4@mail.gmail.com>
On Mar 15, 2008 00:17 +0800, Peter Teoh wrote:
> given different harddisk partition, does anyone knows how to
> differentiate one partition from another?
>
> at the kernel source level, which is the constant/variable for this?
>
> Is it EXT3_XATTR_MAGIC? (but EXT2_XATTR_MAGIC have the same value as
> ext3, so betw the two they are not distinguisable?)
> (or REISERFS_XATTR_MAGIC etc)
Read the file (1) and blkid (8) man pages. These tools understand a
lot of different magic numbers for filesystems:
# file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large
files)
# blkid /dev/sda1
/dev/sda1: LABEL="/boot" UUID="1fe1d719-1a8c-45a0-969a-cba8b101cc57"
SEC_TYPE="ext2" TYPE="ext3"
> So I supposed if I were to create my
> new filesystem, then just create a new /random value from this?
Pretty much, yes. You should also add a LABEL and UUID field so that one
instance of the filesystem can be distinguished from another.
A better goal (IMHO) than creating your own new filesystem is to help out
some existing filesystem like ext4 or btrfs.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
next prev parent reply other threads:[~2008-03-14 23:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 16:17 filesystem differentiation Peter Teoh
2008-03-14 23:24 ` Andreas Dilger [this message]
2008-03-22 4:39 ` "Write once only but read many" filesystem Peter Teoh
[not found] ` <20080322102331.GA19347@logfs.org>
[not found] ` <804dabb00803220752h670757d8o9c1b7fa3696467bc@mail.gmail.com>
[not found] ` <20080322150626.GB19347@logfs.org>
2008-03-22 15:55 ` Peter Teoh
2008-03-22 16:59 ` Jörn Engel
2008-03-24 4:49 ` Scott Lovenberg
2008-03-24 6:35 ` Peter Teoh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080314232403.GI3542@webber.adilger.int \
--to=adilger@sun.com \
--cc=htmldeveloper@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).