Re: Unmounting a busy RO-Filesystem

Denis Vlasenko (vda@port.imtp.ilyichevsk.odessa.ua)
Mon, 16 Dec 2002 16:03:01 -0200


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/