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 an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux