LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-29-2015, 03:08 AM   #1
arun.viswanath@gmail.com
LQ Newbie
 
Registered: May 2015
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 05-30-2015, 12:00 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
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.
 
Old 05-30-2015, 01:16 PM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
Code:
mount -o loop some.iso <mountpoint>
creates a loop back device on <mountpoint>
you then
Code:
umount <mountpoint>
when finished with it.
 
Old 05-30-2015, 10:30 PM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
More correct one would be:

Code:
umount -d <mountpoint>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usb in mount/unmount loop vishesh Linux - Kernel 1 04-09-2009 06:28 AM
What is a loop back device? kd7edh Linux - General 1 01-17-2006 07:19 PM
unmount lufs only after process is killed Caysho Linux - General 0 08-27-2005 01:37 AM
loop back device fails.... possible bug? ProtoformX Linux - General 7 07-21-2005 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration