public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Unmounting a busy RO-Filesystem
  2002-12-17  1:06 Unmounting a busy RO-Filesystem Bourne
@ 2002-12-16 18:03 ` Denis Vlasenko
  2002-12-16 18:17   ` Steven Dake
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Vlasenko @ 2002-12-16 18:03 UTC (permalink / raw)
  To: Bourne, linux-kernel

On 16 December 2002 23:06, Bourne wrote:
> I have 3 partitions. /dev/hda3 for '/' , /dev/hda1 for /boot and
> /dev/hda2 for swap.
>
> I boot & then i do a CTRL+ALT+SYSRQ+U.  '/' and '/boot' are now
> remounted ReadOnly.
>
> 1) cd '/boot'
> 2) umount /boot ----> This gives me an error "Device Busy"

How do you imagine unmounting a directory when you are in it? ;)

> 3) cd /
> 4) umount / -------> No error

This is special case: "umount /" == "mount -o remount,ro /"

> 5) echo $? -----> outputs '0' indicating success. !!!!!!!!
>
> When i do the above by skipping the Sysrq part, i get the usual
> expected errors.

Without SysRq,

# mount -o remount,ro /

fails 'coz you have files open for writing.
You might ask how kernel can do that ro remount with SysRq?
It cheats! ;)
--
vda

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unmounting a busy RO-Filesystem
  2002-12-16 18:03 ` Denis Vlasenko
@ 2002-12-16 18:17   ` Steven Dake
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Dake @ 2002-12-16 18:17 UTC (permalink / raw)
  To: vda; +Cc: Bourne, linux-kernel



Denis Vlasenko wrote:

>On 16 December 2002 23:06, Bourne wrote:
>  
>
>>I have 3 partitions. /dev/hda3 for '/' , /dev/hda1 for /boot and
>>/dev/hda2 for swap.
>>
>>I boot & then i do a CTRL+ALT+SYSRQ+U.  '/' and '/boot' are now
>>remounted ReadOnly.
>>
>>1) cd '/boot'
>>2) umount /boot ----> This gives me an error "Device Busy"
>>    
>>
>
>How do you imagine unmounting a directory when you are in it? ;)
>  
>
This is possible with a kernel patch called forced unmount.  It will 
blow away the mount point even if there are files open in it or not. 
 The best part is it properly closes the superblock so the filesystem 
doesn't have to be fsck'ed.

>  
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Unmounting a busy RO-Filesystem
@ 2002-12-17  1:06 Bourne
  2002-12-16 18:03 ` Denis Vlasenko
  0 siblings, 1 reply; 3+ messages in thread
From: Bourne @ 2002-12-17  1:06 UTC (permalink / raw)
  To: linux-kernel

I have 3 partitions. /dev/hda3 for '/' , /dev/hda1 for /boot and 
/dev/hda2 for swap.

I boot & then i do a CTRL+ALT+SYSRQ+U.  '/' and '/boot' are now 
remounted ReadOnly.

1) cd '/boot'
2) umount /boot ----> This gives me an error "Device Busy"
3) cd /
4) umount / -------> No error
5) echo $? -----> outputs '0' indicating success. !!!!!!!!

When i do the above by skipping the Sysrq part, i get the usual expected 
errors.

So is the above behaviour expected ? I tried this on 2.4.19 & 2.5.51. 
Same results.

I am subscribed to the list

TIA
Bourne


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-16 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-17  1:06 Unmounting a busy RO-Filesystem Bourne
2002-12-16 18:03 ` Denis Vlasenko
2002-12-16 18:17   ` Steven Dake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox