Henry,

I think the issue is that when you mount a non-unix filesystem, like a fat/msdos, they don't have users and groups.

The default, from the mount man page, is to use the user and group of the user issuing the mount command, which would probably be root. Have a look at the uid and gid option until the filesystem type specific section - you probably want to make it asterisk and asterisk.

The other option could be to make it a ext or other unix type filesystem - but then it would be tough to use the USB stick on a Windows system.

Regards,
Doug.


On 23/12/2010 2:47 PM, Henry Coleman wrote:
On Thu, Dec 23, 2010 at 2:45 PM, Henry Coleman<henry.cole...@voip-pbx.ca>wrote:

Thanks for staying with this.
Here's what is happening....

When creating a backup in Freepbx  the backup *name* will create a
directory, otherwise the option is to add it to an existing directory and it
goes ahead and adds the backup file (tar.gz) file into an existing
directory. The new or existing directories are owned all owned by *
asterisk*
When the stick is inserted initially there are no sub-directories off the
mounted * var/lib/asterisk/backups*. If an attempt is made to backup using
a new *name* the new directory doesn't display and the file gets lost.
Using Putty and Winscp I can see the newly created directory but it is
owned by* root, *attempting to change this using *chown* creates an error
saying I don't have permission to change the owner. (very odd).
So it seems as though it is still a owner/permission problem.

Thanks Henry










On Wed, Dec 22, 2010 at 12:18 PM, John Lange<j...@johnlange.ca>  wrote:

On Wed, Dec 22, 2010 at 9:22 AM, Henry Coleman
<henry.cole...@voip-pbx.ca>  wrote:
Inserting the stick and refreshing the GUI page shows the new directory
structure on the USB stick.
However after a backup they get saved to the HD directory instead

You lost me there. If the USB is mounted on top of
/var/lib/asterisk/backups, then it would be impossible for you to
write to that directory and have it written to the hard disk.

Unplugging the USB stick does not restore the original HD directory,
only a reboot does this.

We probably need to fix something in this section:

# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l
/var/lib/asterisk/backups"

After removing the usb key, try running the unmount manually and see
what it says:

# /bin/umount -l /var/lib/asterisk/backups

There should also be a log of what happened in /var/log/messages
(That's assuming CentOS uses /var/log/messages for udev logging).

The most likely explanation is that the file system is "busy"
preventing it from being unmounted. If that is the case you can do (as
root):

# lsof | grep /var/lib/asterisk/backups

to find out what it is.

--
John Lange
www.johnlange.ca




--
*Henry L. Coleman *
***Per: VoIP-PBX.ca
*
*
*







---------------------------------------------------------------------
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

Reply via email to