Unmount loop back device for a particular process in Linux
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Unmount loop back device for a particular process in Linux
I've mounted an iso image as loop device in my linux box on /dev/loop0. I'm also having a network namespace [tmpns] and in my linux box.
When I start a new process to run on tmpns then this mount device is attached to new process"/proc/15350/mounts", but when I try to unmount the loop back device entry for this process is not getting removed from /proc/15350 directory.
I'm not using this mount point "/dev/loop0" inside the network namespace tmpns.
So is there is any way when starting the process I can mention not to mount /dev/loop0 for this new process or is there is any way I can unmount a /dev/loop0 for a particular process.
No way of hiding/unmounting a device just for for one process process. that I am aware of - I see nobody has chimed in on this with better ideas.
I am sure you can make it inaccessible though, by cleverly working on permissions, or some security suite (e.g. Selinux). You can also double mount it, have one for your process, and unmount the second mount later. This sort of thing.
mount /dev/sdaN /here
mount /dev/sda5 /there
<process uses /there, others can access /here>
unmount /there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.