How do I enable xattr?

I can’t find any info anywhere. Does Opensuse 12.1 have extended attributes enabled by default in ext4? How do I even check something like that?

So I found several things of interest.

  1. A kernel option must be enabled to use xattr & I found this in the default kernel config in openSUSE 12.1: CONFIG_EXT4_FS_XATTR=y
  2. A fstab mount option entry for the mounting of the EXT4 partition must include: user_xattr (ie fstab entry: /dev/disk/by-id//dev/disk/by-id/ata-ST31000528AS_9VP1AEZJ-part1 / ext4 acl,user_xattr 0 1)
  3. I found a reference about using it like this: setfattr -n user.name -v val file (use man setattr for more info)
  4. There does not seem to be a command called xattr in openSUSE I can find.

Hope this helps.

Thank You,

On Thu, 10 May 2012 21:46:02 +0000, Maxxi12 wrote:

> I can’t find any info anywhere. Does Opensuse 12.1 have extended
> attributes enabled by default in ext4? How do I even check something
> like that?

As near as I can tell, it should be enabled by default as part of ext4.

setfattr and getfattr are the command used to manipulate extended file
attributes.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On Thu, 10 May 2012 22:26:06 +0000, jdmcdaniel3 wrote:

> 3) I found a reference about using it like this: setfattr -n user.name
> -v val file (use man setattr for more info)

Something I found that’s of importance is that you must use the ‘user.’
prefix.

I tried it on my laptop earlier today and found that adding that prefix
let me set any arbitrary extended attribute in the filesystem.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Thank you. I guess if I want to configure that value, I have to install kernel-source, and use some kind of kernel configuration tool…
Here is the config that I found: GIT Browse

I think I rather do these steps in a VM first (if/when I need to)… How to: Compile Linux kernel 2.6

On Fri, 11 May 2012 07:06:02 +0000, Maxxi12 wrote:

> Thank you. I guess if I want to configure that value, I have to install
> kernel-source, and use some kind of kernel configuration tool…
> Here is the config that I found: ‘GIT Browse’
> (http://kernel.opensuse.org/cgit/kernel/tree/fs/ext4/Kconfig?h=stable)
>
> I think I rather do these steps in a VM first (if/when I need to)… ‘How
> to: Compile Linux kernel 2.6’
> (http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html)

Have you tried setting an attribute using the command I indicated?

I think you’ll find that the feature is already enabled.

From my 12.1 system at home with a stock kernel:


lamuella:/proc # zcat config.gz | grep XATTR
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_REISERFS_FS_XATTR=y
CONFIG_TMPFS_XATTR=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_SQUASHFS_XATTR=y
CONFIG_CIFS_XATTR=y

So it’s enabled in the stock kernel.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I indicated the kernel option is enabled already AND the /home & root mounts have the option enabled by default as well. If you have any other Linux mounts in your fstab file you could enable those partitions as well. If you want to compile a kernel, why not have a look at my bash script instead if you are set on doing such a thing, but its not required?

S.A.K.C. - SUSE Automated Kernel Compiler - Version 2.71 - Blogs - openSUSE Forums

Thank You,