[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pivot_root. unmount old root



On Wed, 24 Mar 2010 04:16:20 -0400 (EDT), K. Haselhorst wrote:
> Stephen Powell wrote:
>>
>> Maybe lsof doesn't necessarily list everything.  What does "fuser -m
>> /old_root"
>> show?  What about doing "fuser -k -m /old_root"?
> 
> Ok, I finally got the old root unmounted. There were some tmpfs mounted
> unter old-root/dev/shm and old-root/lib/init/... - after unmounting these
> I could also unmount the old-root. It's strange that neither lsof nor
> fuser did show any open files for these mountpoints... I really wonder how
> the pivot_root guys expect their examples to work ;)

Of course!  Why didn't I think of that!  There is nothing keeping the file
system structure from from being umounted, which is what "fuser -m" was
designed to show.  But it still has to be umounted "from the bottom up."
I guess I just assumed that the shutdown scripts would umount that stuff,
but I guess since it's not a permanent file system they don't bother.
If you're shutting down or rebooting, you don't need to do that.  They
remount the permanent root file system read-only, which causes the write
cache to be flushed to disk, but that's as far as they go.  If you
want to do a pivot_root and umount the old root, you do actually have to
umount that stuff.  I'm sorry I didn't think of it.  Nice sleuthing!

> 
> What I still need to figure out is how I can replace init with a custom
> process... but I think for that I will have to patch init itself.

Why do you need to patch init?

-- 
  .''`.     Stephen Powell    <zlinuxman@wowway.com>
 : :'  :
 `. `'`
   `-


Reply to: