LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Question on ownership and permission (https://www.linuxquestions.org/questions/linux-general-1/question-on-ownership-and-permission-406153/)

satimis 01-21-2006 09:42 AM

Question on ownership and permission
 
Hi folks,

How to retain the ownership and permission of data transferred with CD from Box-1 to Box-2. The data are originally owned by User with r/w permission. After burning the data on the CD they become read only. Copying them to Box-2 all files become read only by User and owned by Root. To get the data back to their original state involves certain work in running "chown" and "chmod".

Is there an easy way making use of CD as transfer medium retaining their orignal state, not via local network ? TIA.

B.R.
satimis

linmix 01-21-2006 09:45 AM

I'm not 100% sure about this, but I remember seeing a setting in k3b to keep the original owner settings. Have a look under advanced settings when you open the burn dialogue.

haertig 01-21-2006 01:03 PM

You could use tar to create a tarfile, burn the tarfile to cd, then untar it at the destination.

satimis 01-22-2006 03:36 AM

Hi haertig,

Tks for your advice.

If I understand your advice correctly, I shall run

# tar -jcf -p tarball.jz2 /path/to/data_folder

burn the tarball on CD and untar it directly on CD after mounting

# cd /mnt/cdrom
tar -jxf tarball.bz2 -C /mnt/hdax

hdax = the partition for keeping the data (to be mounted first)

If I'm wrong please correct me. TIA

Furthermore if I want to tar the whole partition, say "home", whether to run;

# tar -jcf -p tarball.bz2 /home/*
I don't expect to include the path "/home/" on the tarball.

B.R.
satimis

satimis 01-22-2006 03:45 AM

Hi linmix,

Tks for your advice.

Sorry I don't have k3b installed. Most time I use command line to create ISO image and to burn as well. mkisofs has an option (-R) to retain some additional metadata. But ISO9660 filesystem does not support same file ownership and permission attributes.

B.R.
satimis

linmix 01-22-2006 10:11 AM

That's where rockridge comes in. As far as I know that will do the job for you.

haertig 01-22-2006 11:31 AM

Quote:

Originally Posted by satimis
# tar -jcf -p tarball.bz2 /home/*
I don't expect to include the path "/home/" on the tarball.
satimis

The above syntax, I am not sure of. To leave "/home/" off I think you might need to the following. That's the way I've done it.
Code:

# cd /home
# tar -jcpf tarball.bz2 .

Notice that I also moved the -p option before the -f option. I think the way you had it you would create a tarfile named "-p" not "tarball.bz2". The -f option takes the next thing as the desired output filename.

But I think linmix actually has the best answer. The Rockridge extensions are supposed to preserve permissions and such. I forgot about that. Never really delved into it much actually, but now I remember reading about it since linmix mentioned it. My tar method would work, but linmix's idea might be easier and better. Research into rockridge. I'll be doing that myself after I finish typing this post. I'd forgotten about it.

satimis 01-23-2006 08:24 AM

Hi linmix,

Tks for your further advice.

Quote:

That's where rockridge comes in. As far as I know that will do the job for you.
I have been searching around on "man mkzftree", "man mkisofs", etc. including googling around for examples in applying -ZF options to compress the directories and files, to create ISO image and to burn as well as to decompress the directories and files. But I could not find them. Could you please shed me some light. Pointers would be appreciated.

TIA

B.R.
satimis

satimis 01-23-2006 08:28 AM

Hi haertig

Quote:

That's the way I've done it.
Code:

# cd /home
# tar -jcpf tarball.bz2 .

.....
Tks for your advice and other comment.

B.R.
satimis

linmix 01-23-2006 10:28 AM

Quote:

Originally Posted by satimis
Hi linmix,

Tks for your further advice.

I have been searching around on "man mkzftree", "man mkisofs", etc. including googling around for examples in applying -ZF options to compress the directories and files, to create ISO image and to burn as well as to decompress the directories and files. But I could not find them. Could you please shed me some light. Pointers would be appreciated.

TIA

B.R.
satimis

I have no idea how this is implemented though the cli. I always use k3b and the options can be easily set there.

tkedwards 01-23-2006 06:41 PM

If you look through man mkisofs you'll see you can turn on rockridge with the -R or -r options and there are options in there for specifying the uid and gid of the files on the CD. Generally though you'll find that the ownership and even permissions on the files is usually a local thing - it doesn't translate well when moving files between systems. Just like on Windows you have to remember to remove the 'read only' attribute in Properties of any files you copy off the CD you often need to do the same in Linux.

satimis 01-23-2006 08:29 PM

Hi tkedwards,

Tks for your advice.

Quote:

.....Generally though you'll find that the ownership and even permissions on the files is usually a local thing - it doesn't translate well when moving files between systems. Just like on Windows you have to remember to remove the 'read only' attribute in Properties of any files you copy off the CD you often need to do the same in Linux.
I burnt /home/ of a FC3 box on CDs. /home/ was on its own partition. Then running LFS LiveCD I copied the CDs on a partition of a new HD which has 6 partitions. I'm prepared to build LFS-->BLFS on the new HD applying LFS LiveCD as host. Later I discovered all data after transferred from the CDs onto the partitions became "read only" and permission changed from User to Root. Now I need to reinstate their original state, i.e. Write/Read, User, etc. Either I have to do it manually or to recopy the data from /home/ of the FC3 box onto the partition.

I'm trying to solve my problem. Running FC3 to duplicate /home/ to the partition of the new HD to be mounted as slave, etc.? Could you or folks on the forum please shed me some light. TIA

B.R.
satimis

tkedwards 01-23-2006 09:26 PM

You'd probably need to use tar like others have suggested if you really want to preserve the permissions as that's one of the things its designed for - archiving. You'd still need to make sure that the uid and gid of the relevant users where the same on both the Fedora and LFS system, or you'll still need to run
Code:

chown -R username:username /home/username
for each user.

satimis 01-24-2006 01:31 AM

Quote:

Originally Posted by tkedwards
You'd probably need to use tar like others have suggested if you really want to preserve the permissions as that's one of the things its designed for - archiving. You'd still need to make sure that the uid and gid of the relevant users where the same on both the Fedora and LFS system, or you'll still need to run
Code:

chown -R username:username /home/username
for each user.

Hi tkedwards,

Noted with tks.

satimis

linmix 01-24-2006 11:29 AM

If your intention was to move a whole partition, partimage would have been an easy and effective sollution. It will create a tar.gz or tar.bz file for you and even split it into manageable chunks if you need it to. It's primarily used as a backup utility, but would suit this purpose fine.


All times are GMT -5. The time now is 07:48 AM.