hard drive permissions

Nils Kassube kassube at gmx.net
Sat Nov 22 06:45:08 UTC 2008


Douglas Pollard wrote:
> Nils Kassube wrote:
> > Douglas Pollard wrote:
> >> Hi All,    I had to replace the second hard drive on a single boot
> >> system. I have Ubuntu  8.04 on the first drive.  I partitioned the
> >> second drive using the live Ubuntu cd.  The drive belongs to root
> >> and I, as user, cannot add and remove files.  I kinda know how to
> >> change permissions on a file, but have not figured out how to change
> >> a drive. Everything I'm reading refers to changing permissions on a
> >> file but I am working with a drive.  Can I get some help here.
> >
> > In this situation I usually suggest to make a directory on the disk
> > for the user and then change the ownership of the directory for that
> > user. You can do it like this:
> >
> > sudo mkdir /media/disk/$USER
> > sudo chown -R $USER:$USER /media/disk/$USER
> >
> > You may need to change the path where the disk is mounted but you can
> > leave the "$USER" part unchanged because the shell will replace it
> > with your login name.
>
> Ok, been away from this a few days,  working on video but I am fast
> running out of disk space.  Put in as per your direction, Nils,  It
> aparently went in alright as the new prompt came up.
>
> sudo mkdir /media/disk/$USER   sudo chown -R $USER:$USER
> /media/disk/$USER  Changed user to doug my user name.  The drive
> permissions / in places 250GB media drive / properties and finally
> pemissions.  Both owner and groups belong to root.
>
> I guess what I am missing is the path where the disk is mounted I don't
> understand can you help me with this. Doug

Your partition should be mounted somewhere automatically. Usually that 
would be /media/disk or /media/disk-1 etc. if it has an ext2 or ext3 file 
system. You can check it with the command "df -h" in a terminal. Look for 
the column "size" to find out the 250GB partition. At the end of that 
line you can see the path where it is mounted. If it isn't "/media/disk", 
replace the real path in the commands. E.g. if it is "/media/sdc7" the 
commands would be

sudo mkdir /media/sdc7/$USER
sudo chown -R $USER:$USER /media/sdc7/$USER

However if the path IS "/media/disk", I suppose you missed the point that 
there is a directory on the partition now which is owned by you. The top 
directory of the partition is still owned by root but the new directory 
is owned by you.


Nils




More information about the ubuntu-users mailing list