Mount 无法分配内存

Mount 无法分配内存

调用以下命令会立即崩溃并mount声称无法分配内存:

sudo mount -t overlay overlay -o lowerdir=/home/foo,upperdir=/mnt/home /home/foo

就上下文而言,/mnt/home/dev/sda3,以 ext4 格式化的闪存驱动器的第 3 个分区,/{home}/dev/sda1,同一闪存驱动器的第 1 个分区,但以只读模式安装,因为它是一个实时操作系统(从闪存驱动器启动)。

我也用它运行了strace,得到了下面的结果

execve("/run/wrappers/bin/sudo", ["sudo", "mount", "-t", "overlay", "overlay", "-o", "lowerdir=/home/foo,upperdir=/mn"..., "/home/foo"], 0x7fff5bf43738 /* 63 vars */) = 0
access(0x7f28dafd4883, F_OK)            = -1 ENOENT (No such file or directory)
brk(NULL)                               = 0x55d7e0d7a000
fcntl(0, F_GETFD)                       = 0
fcntl(1, F_GETFD)                       = 0
fcntl(2, F_GETFD)                       = 0
access(0x7f28dafd4883, F_OK)            = -1 ENOENT (No such file or directory)
access(0x7f28dafd8a00, R_OK)            = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, 0x7ffce760b0d0, 0x7ffce760b1b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7ffce760b0d0, O_RDONLY|O_CLOEXEC) = 3
read(3, 0x7ffce760b318, 832)            = 832
pread64(3, 0x7ffce760ad40, 784, 64)     = 784
pread64(3, 0x7ffce760ad10, 32, 848)     = 32
pread64(3, 0x7ffce760acc0, 68, 880)     = 68
newfstatat(3, 0x7f28dafd4b15, 0x7ffce760b1b0, AT_EMPTY_PATH) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f28dafac000
pread64(3, 0x7ffce760ae00, 784, 64)     = 784
mmap(NULL, 1851728, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f28dade7000
mmap(0x7f28dae0d000, 1323008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f28dae0d000
mmap(0x7f28daf50000, 315392, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x169000) = 0x7f28daf50000
mmap(0x7f28daf9d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b5000) = 0x7f28daf9d000
mmap(0x7f28dafa3000, 33104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f28dafa3000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f28dade4000
arch_prctl(ARCH_SET_FS, 0x7f28dade4740) = 0
mprotect(0x7f28daf9d000, 12288, PROT_READ) = 0
mprotect(0x55d7e00ab000, 4096, PROT_READ) = 0
mprotect(0x7f28dafdd000, 8192, PROT_READ) = 0
brk(NULL)                               = 0x55d7e0d7a000
brk(0x55d7e0d9b000)                     = 0x55d7e0d9b000
readlink(0x55d7e00aa027, 0x55d7e0d7a2a0, 4096) = 38
newfstatat(AT_FDCWD, 0x55d7e0d7a2a0, 0x7ffce7609f30, AT_SYMLINK_NOFOLLOW) = 0
geteuid()                               = 1001
write(2, 0x7ffce7607770, 143)           = 143
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f28dade3000
rt_sigprocmask(SIG_UNBLOCK, 0x7ffce7609d30, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, 0x7ffce7609ca0, 0x7ffce7609c20, 8) = 0
getpid()                                = 3614
gettid()                                = 3614
tgkill(3614, 3614, SIGABRT)             = 0
rt_sigprocmask(SIG_SETMASK, 0x7ffce7609c20, NULL, 8) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=3614, si_uid=1001} ---
+++ killed by SIGABRT (core dumped) +++

答案1

问题不在于无法分配的内存。检查系统日志以获得更好的错误报告。你给了工作目录吗?我认为当我没有提供此选项时会出现此错误(必须位于同一文件系统上)

相关内容