LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Closed Thread
  Search this Thread
Old 12-18-2006, 12:09 AM   #1
jmding
LQ Newbie
 
Registered: Oct 2006
Posts: 13

Rep: Reputation: 0
Ask for help: change permissions of the second hard drive


I have two 160G hard drives. On the first one, I have two operating system: windows XP(pro) and Linux Red Hat. The second hard drive is only available in XP or root under Linux. as a common user in Linux, the second HD is only readable but not writable. I had tried to login as root and change the permission by chmod. But it didn't change anything.

For example: (/DATA is the folder of second HD)

ls -l /DATA
total 288
drwxr-xr-x 2 root root 32768 Nov 28 23:07 ancova
drwxr-xr-x 9 root root 32768 Nov 29 13:03 multi
drwxr-xr-x 9 root root 32768 Oct 11 13:41 oldbackupUCD
drwxr-xr-x 11 root root 32768 Nov 15 09:25 paper
drwxr-xr-x 3 root root 32768 Nov 23 16:24 projects
drwxr-xr-x 2 root root 32768 Sep 29 13:09 Recycled
drwxr-xr-x 3 root root 32768 Sep 28 12:49 System Volume Information
drwxr-xr-x 4 root root 32768 Oct 1 17:20 teaching
-rwxr-xr-x 1 root root 8 Dec 17 19:38 test.txt

When I type:
chmod o+w /DATA/test.txt
ls -l /DATA
............
-rwxr-xr-x 1 root root 8 Dec 17 19:38 test.txt

Nothing changed ???

Any suggestion?

I googled for a while and it seems that if I change /etc/fstab, it might be helpful. But I don't know how to change it. Here is my current /etc/fstab:

This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
/dev/hdb /media/cdrom auto pamconsole,fscontext=system_ubject_r:removable_t,exec,noauto,managed 0 0
/dev/hda /media/cdrecorder auto pamconsole,fscontext=system_ubject_r:removable_t,exec,noauto,managed 0 0
 
Old 12-18-2006, 01:31 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
whatever you are currently mounting to /DATA it seems to be a fat filesystem.
to understand /etc/fstab type 'man fstab'
to understand the diffrerent parts of fstab read tha man mount page
 
Old 12-18-2006, 02:00 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
The permissions and ownership of ntfs and vfat (fat32) partitions are set when the device is mounted. They are set for the entire partition. You can use the "umask" option to affect the permissions of both files and directories. Or you can use "fmask" to set the file permissions and "dmask" to set the directory permissions. For globally writable partitions, it is a good idea not to enable the execute bit on files, but this bit has a different purpose for directories. It allows directories to be entered.

You can also change the ownership and group ownership with the "uid" and "gid" options respectively.

As mentioned in the above post, the "man mount" man page contains more information.
 
Old 12-18-2006, 04:52 AM   #4
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
all this above all applies, but:
I can't see any entry for /DATA is fstab, do you?

if it is a vfat partition you caould use something like this in /etc/fstab:
Code:
/dev/hd[abcd][1-9]   /DATA   vfat   defaults,auto,rw,uid=root,gid=users,umask=0117   0   0
(/dev/hd[abcd][1-9] must be replaced with the correct partition device e.g. /dev/hdc1)

this will mount the partition automatically on boot as
rw-rw---- root users into /DATA
 
Old 12-18-2006, 12:50 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Please continue here
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
change permissions of the second hard drive jmding Linux - Hardware 6 12-19-2006 03:42 PM
Hard Drive Permissions djljjm Linux - Newbie 3 04-18-2005 03:35 PM
Hard Drive Permissions djljjm Linux - Newbie 1 04-18-2005 11:29 AM
Change permissions on ntfs drive PieEater Linux - Newbie 2 09-11-2004 09:26 AM
hard-drive permissions Airburned Linux - General 4 07-13-2003 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:07 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