Click to See Complete Forum and Search --> : Faile to Preserve Ownership


mooreted
07-04-2003, 01:21 AM
I am trying to create a shell script for backing up files to my other hard drive. I have MDK 9.1 on one hard drive and Winblows 2000 Pro using FAT32 on the other hard drive. I can move files to the Winblows drive with Konqueror but I can't seem to do it from the shell. Of course I don't really know what I'm doing yet. I use the command:

mv *.* /mnt/win_c/backups/programs/

I get this error"

failed to preserve ownership for <filename> Operation not permitted.

I can copy the files using cp but I can't move the files using mv.

What am I doing wrong?

Thanks,
Ted.

endoalpha
07-04-2003, 01:54 AM
native window filesystems, (not including NTFS, as writing to NTFS is unstable and dangerous) do not have permissions. I guess linux is smart enough not to move the files without preserving permissions, but cping is o.k. because you keep the original files and permissions. It's not a good idea to back up stuff to a FAT filesystem, because when you restore these files, they will be world readable,writeable, and executable.

terribleRobbo
07-04-2003, 03:02 AM
For backups, segment them into large chunks (eg, games, work/school, etc.) and tar.gz them.

To add to a tarball, type:

tar -cf games.tar games/*

(Replace games with whatever you want.)

And then zip it by typing:

gzip games.tar


I think you can do both at the same time by typing:

tar -czf games.tar.gz games/*

mdwatts
07-04-2003, 07:51 AM
As terribleRobbo suggested, tar/gzip them first and then copy/move to the fat32 partition. That way they will preserve the permissions if and when you need to restore.

mooreted
07-04-2003, 08:11 AM
I love Linux. It keeps stopping me from shooting myself in the foot!

My system emailed me a security alert and it said that I had just changed some files to world writable and left some ports open. The more I use Linux the more I love it.

Thanks for the great advice. It figures that Winblows would do it's best to screw up my security measures.

Have a good day,
Ted.

mdwatts
07-04-2003, 09:25 AM
Originally posted by mooreted
It figures that Winblows would do it's best to screw up my security measures.


It's just that the fat32 filesystem does not support the same file permissions as the Linux filesystems.

NTFS sorta does, but not fat32.

terribleRobbo
07-04-2003, 12:23 PM
Originally posted by mdwatts
It's just that the fat32 filesystem does not support the same file permissions...

Heck, last time I looked, it didn't really support _any_ file permissions...

Policies...? Maybe... Hmm...

mooreted
07-05-2003, 01:19 AM
Yep, Fat32 does not allow setting file permissions. I think the idea of gzipping my backups is a good way to go.

Thanks for all the help,
Ted.