[Clfs-support] chroot, mount:: only root can do that

Roy Bekken roy.bekken at gmail.com
Tue Aug 11 04:32:09 PDT 2009


I get this error after I have entered the chroot environment and are
about to 8.10.1. Mounting Additional Kernel


$ mount -vt devpts -o gid=4,mode=620 none /dev/pts
fails with “only root can do that”

Anyone else experience this?

$ whoami; id
root
uid=0(root) gid=0(root)

I did s strace entering the chroot:
# strace -f -o output.log setarch linux32 /usr/sbin/chroot "/mnt/clfs"
/tools/bin/env -i \
    HOME=/root TERM="${TERM}" PS1="\u:\w\$ " \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h

9414  execve("/tools/bin/mount", ["mount", "-vt", "devpts", "-o",
"gid=4,mode=620", "none", "/dev/pts"], [/* 4 vars */]) = 0
9414  brk(0)                            = 0x93a4000
9414  fcntl64(0, F_GETFD)               = 0
9414  fcntl64(1, F_GETFD)               = 0
9414  fcntl64(2, F_GETFD)               = 0
9414  access("/etc/suid-debug", F_OK)   = -1 ENOENT (No such file or directory)
9414  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
9414  open("/tools/lib/tls/i686/sse2/libblkid.so.1", O_RDONLY) = -1
ENOENT (No such file or directory)
9414  stat64("/tools/lib/tls/i686/sse2", 0xffd12278) = -1 ENOENT (No
such file or directory)
9414  open("/tools/lib/tls/i686/libblkid.so.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
9414  stat64("/tools/lib/tls/i686", 0xffd12278) = -1 ENOENT (No such
file or directory)
9414  open("/tools/lib/tls/sse2/libblkid.so.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
9414  stat64("/tools/lib/tls/sse2", 0xffd12278) = -1 ENOENT (No such
file or directory)
9414  open("/tools/lib/tls/libblkid.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
9414  stat64("/tools/lib/tls", 0xffd12278) = -1 ENOENT (No such file
or directory)
9414  open("/tools/lib/i686/sse2/libblkid.so.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
9414  stat64("/tools/lib/i686/sse2", 0xffd12278) = -1 ENOENT (No such
file or directory)
9414  open("/tools/lib/i686/libblkid.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
9414  stat64("/tools/lib/i686", 0xffd12278) = -1 ENOENT (No such file
or directory)
9414  open("/tools/lib/sse2/libblkid.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
9414  stat64("/tools/lib/sse2", 0xffd12278) = -1 ENOENT (No such file
or directory)
9414  open("/tools/lib/libblkid.so.1", O_RDONLY) = 3
9414  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200%\0\0004\0\0\0("...,
512) = 512
9414  fstat64(3, {st_mode=S_IFREG|0755, st_size=91694, ...}) = 0
9414  mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7eff000
9414  mmap2(NULL, 75180, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xf67000
9414  mmap2(0xf78000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0xf78000
9414  close(3)                          = 0
9414  open("/tools/lib/libuuid.so.1", O_RDONLY) = 3
9414  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\16\0\0004\0\0\0\274"...,
512) = 512
9414  fstat64(3, {st_mode=S_IFREG|0755, st_size=24734, ...}) = 0
9414  mmap2(NULL, 15280, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xeac000
9414  mmap2(0xeaf000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xeaf000
9414  close(3)                          = 0
9414  open("/tools/lib/libc.so.6", O_RDONLY) = 3
9414  read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220k\1\0004\0\0\0\360"...,
512) = 512
9414  fstat64(3, {st_mode=S_IFREG|0755, st_size=1560464, ...}) = 0
9414  mmap2(NULL, 1513704, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4ab000
9414  mprotect(0x616000, 4096, PROT_NONE) = 0
9414  mmap2(0x617000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16b) = 0x617000
9414  mmap2(0x61a000, 10472, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x61a000
9414  close(3)                          = 0
9414  mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7efe000
9414  set_thread_area(0xffd126f8)       = 0
9414  mprotect(0x617000, 8192, PROT_READ) = 0
9414  mprotect(0x811000, 4096, PROT_READ) = 0
9414  brk(0)                            = 0x93a4000
9414  brk(0x93c5000)                    = 0x93c5000
9414  umask(022)                        = 022
9414  open("/dev/null", O_RDWR|O_LARGEFILE) = 3
9414  close(3)                          = 0
9414  getuid32()                        = 0
9414  geteuid32()                       = 501
9414  write(2, "mount: only root can do that"..., 28) = 28
9414  write(2, "\n"..., 1)              = 1
9414  exit_group(1)                     = ?

I see that geteuid return 501, that is user clfs. Even if I “su -”
from my normal user or do ctrl+alt+f2 and login as root it return
that... strange



More information about the Clfs-support mailing list