Koozali.org: home of the SME Server

File in use / locked

Offline Donquick

  • *
  • 20
  • +0/-0
File in use / locked
« on: November 29, 2010, 11:22:13 AM »
Hi,

I am using SME 7 as a simple file and print server.  we have 5 windows Vista machines connected via a switch.  Occasionally one of the workstations crashes or needs a restart or what have you.  Sometimes this leaves some files open on the server (i think).  For example outlook data files claim to be open by another user when a reboot happens.  Similarly, excel file are unopenably quite often, etc.

Could somebody tell me the process for seeing which files are open by who and how to cancel the lock from the server.  I have some idea that the fuser or lsof commands might be useful, but i could use some more detailled advice - perhaps an example including how to release the lock if possible.

Thank you for your help.


Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: File in use / locked
« Reply #1 on: November 29, 2010, 12:15:00 PM »
do you mean you are saving .pst files on shared folders?

that's E V I L (search technet for more info)

Offline Donquick

  • *
  • 20
  • +0/-0
Re: File in use / locked
« Reply #2 on: November 29, 2010, 12:21:53 PM »
Yes - i have heard this is probably not recommended in the past - i will work on a solution to that.  In the meantime do you know how to do what i asked as I also have similar problems with excel files quite regularly.

Thanks for your help.

Offline idp_qbn

  • *****
  • 347
  • +0/-0
Re: File in use / locked
« Reply #3 on: November 29, 2010, 07:29:02 PM »
Donquick,
If this is a simple home network (ie one where you can easily reboot the server) then there is a quick and dirty solution: reboot of SME - this usually will fix the problem.

There must be another way but I don't know it.

What Stefano says about sharing .PST files is true. It can be done but every so often it will encounter a problem and remain "locked" because the system has set a flag that says the file is open. The more PCs that share the file, the more often this will happen (that's a rule of thumb not a provable fact - like "The more people ride bicycles, the more knees will be skinned".)

I have shared a .PSt file for years using SME and the locked file happens a couple of times year at least. A reboot of SME always fixes it. I wish I knew a better way but the solution I use is so simple (there are only two of us) I have not bothered.

The worst time we had for "locked file" with .PST was when we firrst got our ipods and had them set to sync Outlook Calendars and Contacts......which of course, aceeses the .PST file and locks it. Often it even left the file locked, especially if we disconnected the ipod by just pulling out the plug.

So, good luck with your search for a "proper" solution - post it here if you find it, please.

Cheers
Ian
___________________
Sydney, NSW, Australia

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: File in use / locked
« Reply #4 on: November 29, 2010, 09:49:41 PM »
Donquick,
If this is a simple home network (ie one where you can easily reboot the server) then there is a quick and dirty solution: reboot of SME - this usually will fix the problem.

There must be another way but I don't know it.
Perhaps:
Code: [Select]
service smb restart
I have shared a .PSt file for years using SME and the locked file happens a couple of times year at least. A reboot of SME always fixes it. I wish I knew a better way but the solution I use is so simple (there are only two of us) I have not bothered.
...

So, good luck with your search for a "proper" solution - post it here if you find it, please.
I wonder what the goal is of sharing the .pst file, is it to have a backup of e-mails? If that is the case I fail to see it's use as a proper backup of the server and a mail client configured as IMAP client would save you all the hassle. All mail stays at the server and is included in the default backups. Perhaps that might be a solution.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: File in use / locked
« Reply #5 on: November 30, 2010, 08:53:20 AM »
Donquick,
from the command prompt type the following:

Code: [Select]
#smbstatus
This will list all the currently logged on users. It will also show which workstation they are logged on to and which files each user has open.
Regards, Lloyd

Offline Donquick

  • *
  • 20
  • +0/-0
Re: File in use / locked
« Reply #6 on: December 02, 2010, 10:35:32 AM »
Hi Folks,

I have been away for a day or two - hence no replies.  Thank you for all of your musings and advice, i appreciate it.  In our case we are not SHARING pst files on the server, merely locating all of the users pst files on a shared area.  The purpose of this is that I can backup the server to a removable drive and get all the outlook info into the bargain.

Idkeen - thank you - this is what i was looking for - great stuff.  Would you know how to release a file usage - once i have identified the user and the file.  I wonder, is there a way to kill the process or what have you, without having to reboot the server.

Thanks,

Don