Home » Questions » Computers [ Ask a new question ]

Can't change permission/ownership/group of external hard drive on Ubuntu

Can't change permission/ownership/group of external hard drive on Ubuntu

I have an external hard drive connected to my Linux box. I wanted to setup a web server to access files on it, but the permission on all files and directories on the drive are rwx for the owner which is my local login, and the group is the root group.

Asked by: Guest | Views: 338
Total answers/comments: 2
Guest [Entry]

"Check the filesystem type it's using first with df -T:

sys@p:~$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
ext3 ext3 19222656 1050948 17195164 6% /
tmpfs tmpfs 1684988 0 1684988 0% /lib/init/rw
udev tmpfs 10240 64 10176 1% /dev
tmpfs tmpfs 1684988 0 1684988 0% /dev/shm

If it's mounted on /mnt/external for example you will see that in the far right column. You can see the filesystem type in the second column. If it's NTFS, you'll want NTFS-3G (probably already installed, if not sudo apt-get install ntfs-config then gksu ntfs-config). Linux already has FAT support for read & write although they do not support permissions.

If you want an NTFS partition mounted with ownership applied to a specific user/group, specify it in the mount switches:

mount -o uid=username,gid=groupname /dev/sdc /path/to/mount

If you change to ext3 as suggested above, you can use chown:

chown -R user *
chown -R user ."
Guest [Entry]

"I did this and it worked:

sudo umount /dev/sda3 /media/windows1
sudo umount /dev/sda5 /media/windows2

and then

sudo mount -o rwx /dev/sda3 /media/windows1
sudo mount -o rwx /dev/sda5 /media/windows2

Note that I am Using Ubuntu 11.10 and sda3 is my Windows C:, sda5 is G:."