Subject: | SuSE 11.4: rootfs in mtab |
The problem is:
on SuSE 11.4 default installation Quota module doesn't work.
Trying to install Quota module with CPAN:
****************************************
Enter path to get quota for (NFS possible; default '.'):
Using device/argument "rootfs"
Quota::sync: No quotas on this system
Choose another file system - quotas not functional on this one
****************************************
Forced installation (force install Quota) works, but Quota module can
not be used on a root mountpoint.
Here is a test script:
****************************************
use strict;
use warnings;
use Quota;
print "Quota version: " . $Quota::VERSION . "\n";
my $dev = Quota::getqcarg("/srv");
print "Dev: " . $dev . "\n";
print "Sync: " . Quota::sync($dev) . "\n";
print "Error: " . $! . "\n";
****************************************
It's output:
****************************************
Quota version: 1.6.5
Dev: rootfs
Sync: -1
Error: No such file or directory
****************************************
Quota itself works well - I've created a user with hard limit, and
reached it:
****************************************
Show quoted text
t> dd if=/dev/zero of=tes
sda2: write failed, user block limit reached.
dd: writing to `tes': Disk quota exceeded
****************************************
Repquota output:
****************************************
# repquota -a
*** Report for user quotas on device /dev/sda2
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
lp -- 4 0 0 1 0 0
mail -- 4 0 0 1 0 0
man -- 4 0 0 1 0 0
messagebus -- 4 0 0 1 0 0
news -- 12 0 0 6 0 0
nobody -- 4 0 0 1 0 0
ntp -- 8 0 0 2 0 0
postfix -- 60 0 0 43 0 0
root -- 1010496 0 0 40624 0 0
statd -- 12 0 0 3 0 0
uucp -- 8 0 0 2 0 0
wwwrun -- 16 0 0 4 0 0
qa -- 36 0 0 10 0 0
mysql -- 22216 0 0 84 0 0
pop -- 40 0 0 2 0 0
named -- 16 0 0 4 0 0
t -- 1024 0 1024 12 0 0
****************************************
My investigation showed that for some unknown for me reasons SuSE 11.4
has rootfs mounted in /etc/mtab, there are 2 '/' mountpoints(probably it
is a SuSE 11.4 bug, but I have not found a way to fix it):
****************************************
# cat /etc/mtab
rootfs / rootfs rw 0 0
devtmpfs /dev devtmpfs rw,relatime,size=247516k,nr_inodes=61879,mode=755 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
/dev/sda2 / ext4
rw,relatime,user_xattr,acl,barrier=1,data=ordered,usrquota 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
****************************************
Perl version:
****************************************
# perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for
i586-linux-thread-multi
****************************************
OS version:
****************************************
# uname -a
Linux suse114 2.6.37.1-1.2-pae #1 SMP 2011-02-21 10:34:10 +0100 i686
athlon i386 GNU/Linux
# cat /etc/SuSE-release
openSUSE 11.4 (i586)
VERSION = 11.4
CODENAME = Celadon
****************************************
Attached a patch, however I'm not sure we could disable rootfs in such
way (I consider the patch as a workaround, and it works fine). Feel free
to contact me for more information.
Subject: | rootfs.patch |
72c72
< next if $fstyp =~ /^(lofs|ignore|auto.*|proc)$/;
---
> next if $fstyp =~ /^(lofs|ignore|auto.*|proc|rootfs)$/;