Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-20-2011, 11:15 AM
|
#1
|
|
LQ Newbie
Registered: Jul 2011
Location: Newcastle, NSW, Australia
Distribution: ESXi with Open Suse, Centos, Ubuntu, Win XP, Win7, MS Server 2008 R2, Solaris x86, QNX and others,
Posts: 8
Rep: 
|
fstab or export options needed to write to an nfs mounted ntfs export
I need to be able to backup a (drupal) CMS site to an external location. For many reasons, that external location is an external USB HDD on another machine on my LAN.
The USB HDD has 2 partitions, 1 NTFS and the other ext3. I need to back up to the NTFS parition (don't ask why, unless it affects the solution, I just do and the reason is not pretty!).
The machine with the USB HDD attached (the destination) mounts it (via fstab) using the following:
/dev/disk/by-id/usb-WD_My_Book_1110_5743415A4131353639333138-0:0-part1 /usbhdd/ntfs ntfs-3g user,users,gid=users,fmask=133,dmask=022,locale=en_AU.UTF-8 0 0
and exports it (in /etc/exports) using this :
/usbhdd/ntfs *(fsid=0,crossmnt,rw,root_squash,sync,no_subtree_check)
The Drupal site runs a cron job to automate the backup (not sure if it is run as root or wwwrun, but the backup tests I have tried have been via the Drupal admin, while simple file/directory creation tests have been done as root).
The machine running Drupal that I want to back up mounts the USB hdd using nfs with the following fstab entry:
192.168.0.26:/usbhdd/ntfs /usbhdd nfs defaults 0 0
The mount works in read-only mode - I can see files and directories, but even as root I can not create a directory and of course the Drupal backup fails.
I have tried substituting the simplict "rw" option for "defaults" and a few combinations of umask (0000 and 0002) to no avail, along with quite a few variations of fstab and export options at the destination and fstab options at the source.
The backup path exists, the IP address is correct (obviously, I can mount and see files), but no matter what combination of source mount options or destination mount and export options I try, it seems I can not make this writable.
On the destination box (where the USB HDD is mounted via fstab), the permissions appear as this:
drwxr-xr-x 4 root users 4096 2011-07-20 23:05 usbhdd
On the source box where it is mounted via nfs, it appears as follows:
drwxrwxr-x 1 root root 4096 2011-07-21 01:08 usbhdd
and mount returns the following:
192.168.0.26:/usbhdd/ntfs on /usbhdd type nfs (rw,addr=192.168.0.26)
Even as simple mkdir (mkdir /usbhdd/test) as root on the source box fails with a "permission denied" error.
Both machines are running OpenSuse 11.3
Any and all help in resolving this would be greatly appreciated.
|
|
|
|
07-20-2011, 08:07 PM
|
#2
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 14,983
|
NFS option (default) that automatically converts root client to non-priv user, therefore
on nfs server is un-writeable from/by client-root user ....
HTH
|
|
|
|
07-21-2011, 07:07 AM
|
#3
|
|
LQ Newbie
Registered: Jul 2011
Location: Newcastle, NSW, Australia
Distribution: ESXi with Open Suse, Centos, Ubuntu, Win XP, Win7, MS Server 2008 R2, Solaris x86, QNX and others,
Posts: 8
Original Poster
Rep: 
|
most of the solution - many thanks
Thanks very much chrism01 - this got me most of the way there (I could create files/directories as root on the source box), however the backups still failed.
I went back and { for int x=0; x<5; x++) {re-read the man page(s);} } to ensure I understood the change you suggested and from there I believe I found the second part of the problem, which is (I think) in the way the ntfs partition was originally mounted on the destination.
The fstab entry is (AFIK) mounting as writable only by root, and nothing the nfsserver/exports configuration said was going to change that.
I changed the fstab entry to /dev/disk/by-id/...etc /usbhdd/ntfs ntfs-3g defaults,locale=en_AU.UTF-8 0 0
and lo and behold it became writable (by everyone), which then allowed your suggestion to work for the uid that actually performed the backup.
This is not quite optimal, as I would like this directory (which is a couple of levels below /usbhdd) to be rw only by that user (and root of course), but at least my backups now work and my site doesn't remain offline after the backup fails !
I can fine tune this (I think) by exporting directories below /usbhdd (specifically, /usbhdd/mywebsite/backups) with machine and user/group specific parameters (anonuid and anonguid)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:15 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|