LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to modify Owner of directory - Ubuntu 9.01 (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-modify-owner-of-directory-ubuntu-9-01-a-776203/)

fish_hawk 12-16-2009 04:15 PM

Unable to modify Owner of directory - Ubuntu 9.01
 
Hopefully this is not a blatant re-post of another thread, I did try searching the forums prior to posting this. Anyway, here's my issue:

I have an external hard drive attached via USB to my Ubuntu box, set to a mount point of "/storage/500G". When I do an ls -l on the /storage directory it spits out the following:

dr-xr-xr-x 1 root root 4096 2009-12-16 08:28 500G
drwxrwxrwx 9 matt matt 4096 2009-12-16 15:48 maxtor160

I've tried to do the "chown -R matt:matt "/storage/500G"" command on it, and it thinks about for awhile and acts like it is working, but then when I "ls -l" the directory again the output is identical to the first time I did it. I was expecting the "root root" entry would change to "matt matt".

The problem is that I cannot move files to this directory via the command line since I do not have write permissions on this.

I also tried to do a "sudo chmod 777 -R "/storage/500G"", but this did not have any effect on the permissions.

Can anyone tell me how to change the owner of this directory? I'm afraid I'm about to hose my system if I do any more chown -R commands...

Thanks!

chrism01 12-16-2009 04:50 PM

Close; chown means change owner, chmod means change mode (aka permissions).
Try

sudo -i bash
which should put you in a new shell as root. You should be able to work from there.

Tinkster 12-16-2009 06:52 PM

What file-system(s) do those devices have?

fish_hawk 12-16-2009 07:16 PM

Thanks for the quick response!

Quote:

Try

sudo -i bash
which should put you in a new shell as root. You should be able to work from there.

I gave this a go and still no luck.

Quote:

What file-system(s) do those devices have?


According to Gparted - NTFS, Fdisk from the terminal also mentions HPFS.

Do you think my issue is due to the NTFS?

Thanks,

Tinkster 12-16-2009 07:18 PM

Aye ... you can't chown/chmod NTFS .. you can modify the options
you've used to mount it, though.

How are you going about mounting those drives?
Do they have corresponding /etc/fstab lines?
What does 'mount' issued all by itself tell you about those
two mount-points?



Cheers,
Tink

fish_hawk 12-16-2009 07:28 PM

I have this drive set to mount automatically when plugged in. Here's the fstab entry which i did by UUID. The device is listed as sdd1 in GParted:

UUID=2A18071D1806E7A1 /storage/500G ntfs nls=utf8,umask=0222 0 0


I did the mount command all by itself and here's what it spit out:

root@MLB2:/storage# mount
/dev/sdb1 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
none on /var/lib/ureadahead/debugfs type debugfs (rw)
/dev/sdc1 on /storage/maxtor160 type ext3 (rw)
/dev/sda1 on /media/data3 type ext3 (rw)
/dev/sdb5 on /usr type ext3 (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev )
gvfs-fuse-daemon on /home/matt/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev ,user=matt)
/dev/sdd1 on /storage/500G type fuseblk (rw,nosuid,nodev,allow_other,default_per missions,blksize=4096)

I wish I knew what I did when I set up the fstab... but I just googled it and copied and pasted as best I could!

Tinkster 12-16-2009 07:33 PM

Hmmm... was the smaller device connected on boot?

Chances are that you can get "ownership" of both if you
umount the device, comment the fstab line out, unplug it
and plug it back in ;}


Cheers,
Tink

fish_hawk 12-16-2009 07:35 PM

Yes, I believe both devices were plugged in at boot.

Will the drive mount automatically if I comment out the fstab line?

I'll give it a shot now.

Thanks!!

bret381 12-16-2009 07:47 PM

try changing your fstab to
Code:

UUID=2A18071D1806E7A1 /storage/500G ntfs user,defaults 0 0

Tinkster 12-16-2009 07:50 PM

Quote:

Originally Posted by fish_hawk (Post 3794543)
Yes, I believe both devices were plugged in at boot.

Will the drive mount automatically if I comment out the fstab line?

I'll give it a shot now.

Thanks!!

I'd expect it to since you're a) not listing an fstab line
for the smaller one and b) gvfs took care of it, even mounting
it as yourself.


Cheers,
Tink

fish_hawk 12-16-2009 08:04 PM

Ok. So I unmounted it and commented the fstab line. When I plugged it back in it shows up as an external drive, but nothing shows up in my mount point - which I understand is a result of commenting the fstab line.

I went ahead and changed the fstab line per bret381's recommendation. I remounted the drives and I noticed something did change - instead of

dr-xr-xr-x 1 root root 4096 2009-12-16 08:28 500G

it now reads:

drwxrwxrwx 1 root root 4096 2009-12-16 08:28 500G

was this due to the fstab change? Whatever it was, I can now move files onto this drive via the terminal. WOOHOO!!

Thanks guys - your help is much appreciated!

Tinkster 12-16-2009 08:07 PM

Hmmm ... the original fstab line had a umask of 0222, so yes, the
suggested change did the trick in allowing anyone to write to it
w/o explicitly stating it.


All times are GMT -5. The time now is 06:26 PM.