Re: filesystem differentiation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux