LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 07-06-2006, 08:27 PM   #1
JulienPDX
Member
 
Registered: Mar 2005
Location: Corvallis, OR USA
Distribution: Ubuntu 6.01 Dapper Drake
Posts: 57

Rep: Reputation: 15
Smile directories


hi, this is probably a super easy question but it would really help me out.

I have an external USB drive that is in NTFS (its a backup of everything I saved when I used winblows)

Well to make a long story short, I have had signifcant trouble getting the drive to mount and let me browse/open files on it without going into a file browser as root.

Anyway, it woudl really save me time to be able to change the permissions on an entire directory (including the contents) but it seems each time i try this, it only changes the permissions for the directory itself and doens't include the contents. What am I doing wrong?

Thanks
 
Old 07-06-2006, 08:34 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Assuming you are using the chmod command to change permissions, add the -R option (recursive) to change permissions on directories and files recursively. See the chmod man page for more info.
 
Old 07-06-2006, 08:39 PM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Be aware that you can't change the permissions on the NTFS filesystem. If you want to allow users to read/write to that then you need to use the umask option when mounting.
 
Old 07-06-2006, 08:51 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Read throught the "man mount" man pages. Different filesystem types have different mount options. For NTFS, you can use the "umask" option in the mount command to allow "others" to read files. Alternatively, you could use both the "fmask" and "dmask" options to give files and disks different permissions. This allows you to have the "x" permission bit set for directories and cleared for files.

If you are the only user of the drive, then you could use the "uid" option. This options could let you become the "owner" of the mounted partition. You can use either your UID number or your username, as in "uid=julianpdx" if that where your user name on the computer as well.

Kernel write support is limited. With, it you can only modify existing files. I wouldn't recommend using it.
 
Old 07-06-2006, 09:37 PM   #5
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quote:
Kernel write support is limited. With, it you can only modify existing files.
That's old stuff now, since I think 2.6.15 the kernel has pretty good NTFS support. The userspace driver is better (albeit way slower) but the kernel driver can still create files and do enough so Joe Average can use their NTFS partition successfully. Encrypted directories etc aren't support yet but it's stuff like that it can't do.
 
Old 07-07-2006, 12:53 AM   #6
JulienPDX
Member
 
Registered: Mar 2005
Location: Corvallis, OR USA
Distribution: Ubuntu 6.01 Dapper Drake
Posts: 57

Original Poster
Rep: Reputation: 15
well hrm..i was comfortable just copying directories from the drive to a location on my regular user account
..i know that i then need to change permission on the directory to see it
 
Old 07-07-2006, 12:54 AM   #7
JulienPDX
Member
 
Registered: Mar 2005
Location: Corvallis, OR USA
Distribution: Ubuntu 6.01 Dapper Drake
Posts: 57

Original Poster
Rep: Reputation: 15
also how do you open a directory that has a space in it?
 
Old 07-07-2006, 01:00 AM   #8
JulienPDX
Member
 
Registered: Mar 2005
Location: Corvallis, OR USA
Distribution: Ubuntu 6.01 Dapper Drake
Posts: 57

Original Poster
Rep: Reputation: 15
grrr..thats not working. I want one command that can take a directory and change it so that a non-root user can read, write and execute anything within that directory.
 
Old 07-07-2006, 03:30 AM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
As the guys above said. Change fstab (or use the appropriate mount options
if you're doing it manually)

Code:
/dev/you/drive/and/parition /mountpoint    ntfs        umask=000,uid=youraccount,noauto,users      0   0
As for the spaces:
either escape them with a backslash, or put the whole thing in double quotes.
cp -r /this\ is\ a\ stupid\ name /home/user/good_name
or
cp -r "this is a stupid name" /home/user/good_name



Cheers,
Tink
 
Old 07-07-2006, 05:38 AM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
That's old stuff now, since I think 2.6.15 the kernel has pretty good NTFS support.
The support on my kernel (2.6.16) is limited. Look for the ntfs.txt file in the kernel documentation before using write support for ntfs.

Quote from ntfs.txt
Quote:
- This is a complete rewrite of the NTFS driver that used to be in the 2.4 and
earlier kernels. This new driver implements NTFS read support and is
functionally equivalent to the old ntfs driver and it also implements limited
write support. The biggest limitation at present is that files/directories
cannot be created or deleted.
See below for the list of write features that
 
Old 07-07-2006, 07:52 AM   #11
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
Quote:
Originally Posted by Tinkster
As for the spaces:
either escape them with a backslash, or put the whole thing in double quotes.
Cheers,
Tink
I've discovered that the newer bash (3) handles weird file names quite well with tab completion. Type whateve you can of the filename , hit tab and it expands with spaces and unusual characters escaped.
Don't remember if ver. 2 did this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving directories to new directories keysorsoze Linux - Newbie 2 03-31-2006 07:14 PM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 03:22 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
Directories? Dev930 Linux - Newbie 3 02-28-2004 06:34 AM
directories in c++ erratic Programming 1 04-07-2001 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration