lsattr:设备不适当的ioctl读取标志时


20

对于我们的一台运行CentOS 6.0的Linux服务器,如果我执行lsattr / home,则会得到以下内容(以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

现在,我尝试使用chattr进行更改

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

挂载返回:

$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)

我不知道如何解决这个问题。有人可以帮忙吗?


你能发布输出cat /proc/mounts吗?
量子

1
就是这样 我曾使用automount在/ home / DIR中挂载用于LDAP登录的主目录,后来又删除了它-但它仍在挂载/ home / DIR作为自动挂载。这样就解决了。无论如何,为什么安装不会返回自动安装点?
rchhe 2011年

Answers:


11

所在的文件系统/home必须支持扩展属性。由于/home最有可能位于LogVol00分区上(而不是NFS挂载之类),因此您必须使用user_xattrmount选项挂载文件系统:

挂载-o重新挂载,user_xattr /

请注意,ext4这两个user_xattracl默认启用。对于其他文件系统,这有所不同。


4

我意识到这是一个旧线程,但是/ home下的目录似乎是自动挂载的nfs导出,并且nfs不支持chattr,lsattr等。您必须在nfs服务器的文件系统上进行设置(如果可能),以使文件不可变。


-1

我假设/ home在您的根目录下。您要做的是更改根卷的/ etc / fstab文件以添加'acl'选项。这将激活文件系统上的ACL。

然后要激活ACL,请重新安装根卷(mount -o remount,acl /),或重新引导系统(因为acl选项现在在根卷的options字段中)。


谢谢。我尝试了您的方法,但收到了相同的错误消息。
rchhe

虽然有些相关,但ACL不应与扩展属性混淆。
ckujau
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.