Lines Matching refs:mount
20 #include <sys/mount.h>
29 #include "mount-util.h"
30 #include "nspawn-mount.h"
244 if (mount("sysfs", full, "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV, NULL) < 0)
245 return log_error_errno(errno, "Failed to mount sysfs to %s: %m", full);
260 if (mount(from, to, NULL, MS_BIND, NULL) < 0)
261 return log_error_errno(errno, "Failed to mount /sys/%s into place: %m", x);
263 if (mount(NULL, to, NULL, MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, NULL) < 0)
264 return log_error_errno(errno, "Failed to mount /sys/%s read-only: %m", x);
276 if (mount(NULL, top, NULL, MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, NULL) < 0)
301 { "/proc/sys", "/proc/sys", NULL, NULL, MS_BIND, true, true, false }, /* Bind mount first */
310 { "/sys/fs/selinux", "/sys/fs/selinux", NULL, NULL, MS_BIND, false, false, false }, /* Bind mount first */
334 return log_error_errno(r, "Failed to detect whether %s is a mount point: %m", where);
358 if (mount(mount_table[k].what,
365 return log_error_errno(errno, "mount(%s) failed: %m", where);
367 log_warning_errno(errno, "mount(%s) failed, ignoring: %m", where);
385 return log_error_errno(r, "Failed to extract mount option: %m");
394 log_error("Invalid bind mount option: %s", word);
400 /* in the future mount_opts will hold string options for mount(2) */
428 log_error("Cannot bind mount directory %s on file %s.", m->source, where);
433 log_error("Cannot bind mount file %s on directory %s.", m->source, where);
445 /* Create the mount point. Any non-directory file can be
454 return log_error_errno(r, "Failed to create mount point %s: %m", where);
456 if (mount(m->source, where, NULL, mount_flags, mount_opts) < 0)
457 return log_error_errno(errno, "mount(%s) failed: %m", where);
462 return log_error_errno(r, "Read-only bind mount failed: %m");
485 return log_error_errno(r, "Creating mount point for tmpfs %s failed: %m", where);
492 if (mount("tmpfs", where, "tmpfs", MS_NODEV|MS_STRICTATIME, options) < 0)
493 return log_error_errno(errno, "tmpfs mount to %s failed: %m", where);
525 return log_error_errno(r, "Creating mount point for overlay %s failed: %m", where);
557 if (mount("overlay", where, "overlay", m->read_only ? MS_RDONLY : 0, options) < 0)
558 return log_error_errno(errno, "overlay mount to %s failed: %m", where);
592 assert_not_reached("Unknown custom mount type");
616 /* The superblock mount options of the mount point need to be
618 if (mount("cgroup", to, "cgroup", MS_NOSUID|MS_NOEXEC|MS_NODEV, controller) < 0)
619 return log_error_errno(errno, "Failed to mount to %s: %m", to);
621 /* ... hence let's only make the bind mount read-only, not the
624 if (mount(NULL, to, NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, NULL) < 0)
654 if (mount("tmpfs", cgroup_root, "tmpfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME, options) < 0)
655 return log_error_errno(errno, "Failed to mount /sys/fs/cgroup: %m");
723 if (mount(NULL, cgroup_root, NULL, MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME|MS_RDONLY, "mode=755") < 0)
747 return log_error_errno(errno, "Failed to determine if mount point %s contains the unified cgroup hierarchy: %m", p);
753 if (mount("cgroup", p, "cgroup", MS_NOSUID|MS_NOEXEC|MS_NODEV, "__DEVEL__sane_behavior") < 0)
754 return log_error_errno(errno, "Failed to mount unified cgroup hierarchy to %s: %m", p);
797 /* Make our own cgroup a (writable) bind mount */
798 if (mount(systemd_own, systemd_own, NULL, MS_BIND, NULL) < 0)
799 return log_error_errno(errno, "Failed to turn %s into a bind mount: %m", own_cgroup_path);
802 if (mount(NULL, systemd_root, NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, NULL) < 0)
803 return log_error_errno(errno, "Failed to mount cgroup root read-only: %m");
842 if (mount("tmpfs", p, "tmpfs", MS_STRICTATIME, options) < 0)
843 return log_error_errno(errno, "Failed to mount tmpfs to /var: %m");
865 /* --volatile=yes means we mount a tmpfs to the root dir, and
878 if (mount("tmpfs", template, "tmpfs", MS_STRICTATIME, options) < 0) {
879 r = log_error_errno(errno, "Failed to mount tmpfs for root directory: %m");
894 if (mount(f, t, NULL, MS_BIND|MS_REC, NULL) < 0) {
895 r = log_error_errno(errno, "Failed to create /usr bind mount: %m");
907 if (mount(template, directory, NULL, MS_MOVE, NULL) < 0) {
908 r = log_error_errno(errno, "Failed to move root mount: %m");