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

Re: apt-get can not remount /usr ro. How to use lsof to find the offending files?



> On 22/12/99 Shaul Karl wrote:
> 
> >There are times that this remounting is not done because /usr is left busy
> >after apt-get dist-upgrade. There for, I wonder if and how lsof can be used in
> >order to find the offending files?
> 
> it won't help really, the problem is files being overwritten that are 
> in use, so if you are running a rxvt and you overwrite the rxvt 
> binary with a new one you will not be able to remount /usr ro until 
> that running rxvt is closed. (since the disk blocks are not freed 
> until that occurs)  lsof does not help in the case really since 
> before you upgraded it would show rxvt opened and the exact same 
> thing after the upgrade (at least as far as I have seen, maybe there 
> is an option to show pending disk removal i don't know about?)
> 
> since there are usually a dozen or more programs and libraries from 
> /usr open at any given time its hard to say which one is the offender 
> unless you pay very close attention to what packages were upgraded 
> and know exactly what they overwrote.
> 

Let me see if I got it correctly:
mount can tell whether I have open file descriptors that are related to 
removed files and there for it does not let me remount the fs ro?
What does it care? Will remounting the fs erase the data from these blocks? 
Why was I allowed to remount /usr rw when apt-get was started?

BTW: After I sent my previous email I tried to convince mount to let me 
remount the fs ro by quitting some applications and then changing to run level 
3 and then back to 2, which did not help. But then I stopped my mgetty-fax 
daemon, and this enabled me the to mount the fs ro. I restarted the daemon 
after wards. As far as I remember no megtty package was involved in the 
upgrade, although it seems to be using some perl stuff and perl was indeed 
upgraded. I wonder if others can verify that the meggty-fax daemon in 
particular, or perhaps perl is responsible for not letting mount to remount 
/usr ro after an upgrade. Can it be that it some how this daemon opens a file 
rw but this is ignored when the fs is mounted ro?


Reply to: