[Resolved] Cannot change the ownership of /media/disk

Issues related to hardware problems
Post Reply
rtcary
Posts: 140
Joined: 2005/10/13 18:40:55
Contact:

[Resolved] Cannot change the ownership of /media/disk

Post by rtcary » 2014/03/11 21:02:15

This is the result of ls -ld:
drwxr-xr-x 13 todd root 16384 Dec 31 1969 /media/disk

Due to my not fully grasping how the /media/disk is created and managed by the auto-mounting of the USB, I no doubt am missing something simple. I want the directory to be owned by root, however I get an error when I try. There does not appear to be a stick bit set.

Since the owner is not root, my rsync backup to the auto-mounted USB produces errors: Cannot change owner...

Help...
Todd
Last edited by rtcary on 2014/03/12 22:37:16, edited 2 times in total.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Cannot change the ownership of /media/disk

Post by gerald_clark » 2014/03/11 21:17:30

If the USB drive has a windows filesystem, it has no user.
A psuedo user is assigned at mount time.
Use a drive with a Linux filesystem on it or use compatible rsync options such as "rsync -xr --size-only".

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot change the ownership of /media/disk

Post by TrevorH » 2014/03/11 21:49:49

Sounds more to me like your backup is not running as root. To correctly preserve permissions and ownership it would need to do so.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

rtcary
Posts: 140
Joined: 2005/10/13 18:40:55
Contact:

Re: Cannot change the ownership of /media/disk

Post by rtcary » 2014/03/12 05:17:35

I had run mkfs.vfat /dev/sda1. Is that the problem? Is that making todd the owner?

I am running rsync as root using su to log on as root.

Thank you for the help/suggestions...

Todd

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot change the ownership of /media/disk

Post by TrevorH » 2014/03/12 09:12:32

The problem is that a) it's vfat which has no concept of ownership and b) you have a GUI running which automounts the drive when you insert it and assigns the ownership to the currently logged in user. If the drive was formatted with ext3 or some other linux filesystem that knows about the owner field then the automount would not coerce it to be owned by the currently logged in user. Or if you were not running a GUI with the necessary packages installed to automatically mount it then you could manually mount it and specify the owner yourself.

Personally I'd use a different filesystem unless you have a requirement to read this on a Windows machine or something else that doesn't understand ext3.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

rtcary
Posts: 140
Joined: 2005/10/13 18:40:55
Contact:

Re: Cannot change the ownership of /media/disk

Post by rtcary » 2014/03/12 22:14:30

gerald_clark wrote:If the USB drive has a windows filesystem, it has no user.
A psuedo user is assigned at mount time.
Use a drive with a Linux filesystem on it or use compatible rsync options such as "rsync -xr --size-only".
Gerald -
Thank you for pointing out the commands for me. I have used a particular command line for many years and it always worked...probably because the external disk was formatted as ext4...not sure. Well my switches were -av, and since I have not had to pay any attention to the command for at least ten years, little did I know that -a brings the owner and group across along with permissions. Not good with a fat32 (as you and others were trying to tell me).

Since I would like to be able to read my backup, if the server crashes, on any computer, I kept the fat32 format and changed the command line to

/usr/bin/rsync -rtv --size-only --exclude=".*" -e ssh /home/ /media/disk/home/

All is working, finally, though another question has come up:

I notice that each of the directories are checked, so I assume that the index does not keep information to know if anything within the index has changed?

Sorry for such basic questions, but as you can tell, my Linux box just does some very basic things for me e.g. allows the creation of php applications via Samba and for clients to view them *before* moving the applications the their servers.

Todd

P.S. I admire those of you that work in the Linux environment daily...keeps your skill set polished.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Cannot change the ownership of /media/disk

Post by gerald_clark » 2014/03/12 22:23:17

I don't know what index you are referring to.
The -r option tells it to recursively descend directories.
It must examine each file to check for changes.
It can check the modification time, checksum, or size.
Fat32 filesystems don't have an mtime, so you must choose file size or checksum.

rtcary
Posts: 140
Joined: 2005/10/13 18:40:55
Contact:

Re: Cannot change the ownership of /media/disk

Post by rtcary » 2014/03/12 22:29:58

My ignorance, again. I thought that rsync created a list/index so that it did not have to actually have to read all of the files.

Thank you for calling my attention to the modify time...the absence of it in fat32...yup, I should have remembered that.

Many, many thanks for the assistance.

Is there a way to mark this thread as SOLVED?

Todd

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Cannot change the ownership of /media/disk

Post by gerald_clark » 2014/03/12 22:32:00

Edit the original post and add [ Resolved ] to the subject.
And, you are welcome.

Post Reply