LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-21-2006, 09:42 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
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
 
Old 01-21-2006, 09:45 AM   #2
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
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.
 
Old 01-21-2006, 01:03 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
You could use tar to create a tarfile, burn the tarfile to cd, then untar it at the destination.
 
Old 01-22-2006, 03:36 AM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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
 
Old 01-22-2006, 03:45 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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
 
Old 01-22-2006, 10:11 AM   #6
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
That's where rockridge comes in. As far as I know that will do the job for you.
 
Old 01-22-2006, 11:31 AM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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.
 
Old 01-23-2006, 08:24 AM   #8
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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
 
Old 01-23-2006, 08:28 AM   #9
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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
 
Old 01-23-2006, 10:28 AM   #10
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
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.
 
Old 01-23-2006, 06:41 PM   #11
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
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.
 
Old 01-23-2006, 08:29 PM   #12
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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

Last edited by satimis; 01-23-2006 at 08:30 PM.
 
Old 01-23-2006, 09:26 PM   #13
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
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.
 
Old 01-24-2006, 01:31 AM   #14
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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
 
Old 01-24-2006, 11:29 AM   #15
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange permission issue. Problems changing ownership. ExCIA Linux - Newbie 6 05-26-2005 04:17 AM
Question about ownership/permissions infornography Linux - Newbie 7 07-28-2004 05:57 AM
Ownership/Permission and Delete Syntax MadDogE134 Linux - Newbie 8 06-09-2004 06:05 PM
scp - peserve file ownership and permission eyt Linux - Newbie 6 10-24-2003 03:41 PM
permission or ownership problems trusouthrnplaya Linux - General 6 03-03-2002 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration