public void RecursiveBindMount(PathName source, PathName target) { var bind = MountRun($"mount --verbose --rbind {source} {target}"); this.mountPoints.Push(new MountPoint(target, true)); Bash.ThrowOnError(bind); }
public void ProcfsMount(PathName target) { var bind = MountRun($"mount --verbose --types proc proc {target}"); this.mountPoints.Push(new MountPoint(target, false)); Bash.ThrowOnError(bind); }
private void UnMountOne(ChrootBox box, MountPoint mountPoint, Progress progress) { var flag = (mountPoint.Recursive ? "--recursive" : string.Empty); var umount = new Bash() .Command($"umount --verbose {flag} {mountPoint.Path}") .WithProgress(progress) .Run(); Bash.ThrowOnError(umount); }
public void MountOverlay() { this.box.Base.CreateDirectory(); this.box.Changes.CreateDirectory(); this.box.Work.CreateDirectory(); this.box.Merged.CreateDirectory(); var lowerdir = $"/:{this.box.Base}:{this.box.Pogo.Root}"; var upperdir = box.Changes; var workdir = box.Work; var options = $"lowerdir={lowerdir},upperdir={upperdir},workdir={workdir}"; var command = $"mount --verbose --types overlay overlay --options {options} {box.Merged}"; var mount = MountRun(command); this.mountPoints.Push(new MountPoint(box.Merged, false)); Bash.ThrowOnError(mount); }