On Wed, Apr 24, 2013 at 01:00:02PM -0700, Rich Turner wrote: > i am looking for a way to query btrfs filesystems for all options used to > create the filesystem (i.e. data, leafsize, label, metadata, nodesize, > sectorsize) in an effort to be able to record this information and be able > to recreate the filesystem with the same attributes if necessary.
the 'file' utility is able to give you the leaf/node/sector numbers $ file -s /dev/sda5 /dev/sda5: BTRFS Filesystem sectorsize 4096, nodesize 4096, leafsize 4096) I don't have the label set, but it is printed if set. The raid profiles can be obtained from 'btrfs fi df', this should be enough to recreate the fs. > i see there is a feature request for creating an api/library that may > provide this functionality, but i am unable to find any suitable userspace > command that provides the information. 'file' parses the superblock directly, but we could enhance the ioctl BTRFS_IOC_FS_INFO to get it in an api-friendly way. david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html