13
3
How to unmount a filesystem in Linux without investigating why is it busy?
I want to do it in one command. It should handle applications using that filesystem, submounts, containers (lxc-execute -n qqq <command>
) and all other things.
Just "unmount. No objections!". Special kernel patches or configuration is allowed.
Filesystem should be really unmounted, so umount -l
is certainly not an option. For example, for cryptsetup remove
(BTW how to forcibly cryptsetup remove
? Update: cryptsetup luksSuspend
, but you won't be able to cryptsetup luksResume
if it is not LUKS).
How to make all filehandles on that filesystem invalid?
The only reliable way I know is mounting the filesystem through the FUSE (there is usually no problem to unmount FUSE thing because of I can just kill it's process).
P.S. Already know mount fuser
, lsof | grep
, cat /proc/*/mounts | grep
and obsolete non-working "badfs patch".
The shift key is not necessary, just Alt+SysRq+key. Another thing worth mentioning (especially for laptop users) is that you can press Alt, press and release SysRq, then press and release the letter/digit and finally release Alt. Most importantly, this remount all filesystems as read-only, so it's a last-ditch thing before forcibly rebooting, not a general way of remounting filesystems read-only. – Gilles 'SO- stop being evil' – 2010-08-15T08:00:08.480
@Gilles: thanks for the tip about the shift key. I've corrected my instructions. – sml – 2010-08-16T07:50:24.643
>