Re: /usr busy after aptitude operations?
On 2008-05-08 19:36 +0200, Todd A. Jacobs wrote:
> I have the following in /etc/apt/apt.conf:
>
> Dpkg::Pre-Invoke {"/bin/mount -o remount,rw /usr";};
> Dpkg::Post-Invoke {"/bin/mount -o remount,ro /usr";};
>
> However, in many cases, running aptitude results in the following error:
>
> mount: /usr is busy
> E: Problem executing scripts DPkg::Post-Invoke '/bin/mount -o remount,ro /usr'
> E: Sub-process returned an error code
>
> I can't figure out why aptitude is leaving the partition in a state
> where it can't be remounted ro, even after a significant amount of time
> has passed or /bin/sync has been called.
Probably the problem is that many files which have been upgraded are
still open (binaries and libraries). If the system were to remount /usr
read-only, their inodes could not be freed any more, resulting in file
system corruption.
> Running "fuser -vm /usr" reveals that /usr/lib/iceweasel/firefox-bin is
> being left open for writing (why???), but even after closing firefox and
> seeing /usr/lib/iceweasel/firefox-bin disappear from the fuser output,
> the problem remains the same.
Maybe lsof would be more informative, but that spits out rather many
files; fuser does not list libraries.
> How do I work around this issue, or at the very least find out why the
> filesystem is being held open?
Closing down X could be of great help, but I guess that is not quite
what you want to hear. Maybe someone else has a better idea.
Sven
Reply to: