Change Permissions on a new hard drive to allow

mtyoung tuxman at knology.net
Tue Jan 9 20:18:48 UTC 2007


James,

Thanks for the answer, wish I'd seen it sooner. Now I just need to learn 
what "-R a+rw *" means. Hopefully the link will will help.

MTYoung

James Gray wrote:
> On Tuesday 09 January 2007 14:13, mtyoung wrote:
>   
>> I recently added a new hard drive (/dev/sdb1)to a dual boot system. The
>> new drive works fine from XP, but in Ubuntu I can only read. In XP I use
>> "Ext2 IFS version 1.10c" to access the Ext3 drive.
>> http://www.fs-driver.org/extendeddl.html
>>
>> The drive was formatted as NTFS originally, then changed to Ext3.
>>
>> Owner and Group are Root, Owner has all privileges, Group and Others can
>> read and execute only.
>>
>> How do I change the permissions for a hard drive?  Everything I find is
>> for directories and files.
>>     
>
> Easy :) First of all, I assume you're referring to the drive mounted 
> at /media/Ext2Docs200:
>
> cd /media/Ext2Docs200
> sudo chmod -R a+rw *
>
> That gives EVERYONE on your system full read and write access to everything on 
> that drive.
>
> Short answer, a hard drive is a file, just like basically everything else in 
> Linux/Unix.  In fact your hard drive is /dev/sdb1 (which is a special type of 
> file called a block device).  Once you mount the hard drive into the file 
> system (at /media/Ext2Docs200) you need to manage the files on that hard 
> drive as normal - IOW, with "chmod", "chgrp" and "chown".
>
> FWIW, I'd advise changing the group to something other than "root".  That way 
> you can allow access to users who are not part of the "root" group without 
> having to make it world-read/writeable.  Something like this:
>
> sudo groupadd docs
> sudo gpasswd -a <your_UID> docs
> sudo chgrp -R docs /media/Ext2Docs200
> sudo chmod -R u+rw,g+rw,o-rwx /media/Ext2Docs200
>
> Voila.  Now you are a member of a new group "docs".  The permissions on 
> the /media/Ext2Docs200 are:
> Owner=root, full (RW) access
> Group=docs, full (RW) access
> Other= -  , no access at all
>
> Then to add permissions for other users, just add them to the "docs" group 
> with "gpasswd" in the same way as above.  Have a read of "man chmod" as you 
> may want to make the group ID bit on the directories to force new files to 
> have a consistent group ownership. Here's a good permissions primer:
> http://oldfield.wattle.id.au/luv/permissions.html
>
> James
>   




More information about the ubuntu-users mailing list