lsattr: Inappropriate ioctl for device While reading flags

For one of our Linux servers running CentOS 6.0, if I do lsattr /home, I get something like this (as root):

$lsattr /home
lsattr: Inappropriate ioctl for device While reading flags on /home/user
lsattr: Inappropriate ioctl for device While reading flags on /home/user
lsattr: Inappropriate ioctl for device While reading flags on /home/DIR

Now, I try to change something with chattr

$chattr -R -i /home
chattr: Inappropriate ioctl for device while reading flags on /home

Mount returns:

$mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

I have no clue how to fix this. Could somebody help?


Solution 1:

The filesystem where /home is located has to support Extended Attributes. Since /home is most likely located on your LogVol00 partition (and not an NFS mount or something), you have to mount the filesystem with the user_xattr mount option:

mount -o remount,user_xattr /

Note that for ext4 both user_xattr and acl are enabled by default. This varies for other filesystems.

Solution 2:

I realize this is an old thread, but it looks likely the directories under /home are automounted nfs exports and nfs does not support chattr, lsattr etc.. You would have to set this on the nfs server's filesystem (if possible) to make the files immutable.