permission problem

Place to discuss Debian Linux and Debian based distributions
Post Reply
Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

permission problem

Post by Ice9 » Sat May 12, 2007 8:32 am

I have an external usb drive which I used to rsync my mp3 and music videos collection to.
That was with my previous pc.
Now that I have my new box I would like to continue to sync my collection with the same external drive, only rsync gives me permission errors, something about rsync chgrp: Operation not permitted.

When I look at the mp3's on the external drive, owner is yc and group is root.
the mp3's on my pc have owner yc group yc.

I tried to chown the files on the external drive but it keeps telling me that I do not have sufficient permissions to do that.
Tried it as root as well as regular user, and tried to let the drive automount when I switch it on and tried to mount it manually as root too.

Any ideas how I could force the group change?

thanks.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Sun May 13, 2007 3:15 am

I think you need to make the user and group numbers match.

But could you post the mount options it is using also?

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Sun May 13, 2007 5:11 am

erm, I feel like a total moron posting this but there's no entry in fstab for the external drive???
the mount point is /media/disk, the device is /dev/sdg1 and the filesystem is vfat

I'm pretty convinced I have to match the UID and GID but I can't because I haven't got the permissions, both as root and as user.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sun May 13, 2007 10:03 am

If the file system is vfat then you can not use "chown" or "chmod" to change file permissions. FAT/32 simply doesn't have any mechanism for permissions. So, the permissions and owners are emulated when the file system is mounted and they are applied across the entire file system. On my system (Fedora) the default ownership on an automounted file system is set to the user who is currently logged on at the console. If nobody is logged on the ownership is set to root when automounted.

If you didn't want to change any configuration files you could unmount the file system and mount it manually with whatever options you wanted:

# umount /dev/sdg1
# mount /dev/sdg1 /mnt

or when you do the mount command set the ownership and permissions:

# mount /dev/sdg1 /mnt -o uid=500,gid=500,dmask=0000,fmask=0111

This would set the owner and group to your ID (assuming your ID is 500, see /etc/passwd or use the "id" command) and it would set the directory permissions to 777 (rwx) and file permissions to 666 (rw).

On my system the default permissions can be changed by modifying the /etc/udev/rules.d/50-udev.rules file. The hal daemon actually does the mounting and as you already know the desktop environment you use also has an effect on automounting:

http://voidmain.is-a-geek.net/forums/vi ... php?t=1912

EDIT: Now I am confused. I just stuck my thumb drive in and mounted it vfat and for some reason "chmod" actually works and appears to change the permissions on the files/directories just as it would on an ext2/ext3 partition. I don't get it. This has never worked before and it "shouldn't" work. I have no idea what is going on there.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Sun May 13, 2007 1:04 pm

I wasn't aware of the fat32 limitations regarding permissions so I reformated the whole drive to one big ext3 partition.
rsync-ing everything back to the drive atm.
Thanks for the help though, I have this mobile drive which is fat32 as well and which I use to carry my media files around so I might run into the same kind of problems with that drive ...

Post Reply