Copy mismatch while copying RHEL DVD to folder


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Copy mismatch while copying RHEL DVD to folder
# 1  
Old 04-22-2015
Copy mismatch while copying RHEL DVD to folder

Hi,

Here is this weird thing happening here. I mounted RHEL 6.6 DVD on a directoy
Code:
/a

, I am trying to copy it's content to another folder by using command:
Code:
cp -pr /a/* /new/folder

But while I run
Code:
ls -lrt

on both locations it show me difference in number of files. Any specific reason for that. Also I ran diff on both location and it didn't give me anything. To add more I found difference in sizes of Packages folder also, where numbers of files are uniform. Smilie
# 2  
Old 04-22-2015
Size of what? The size of a folder in ls is filesystem-specific, and not really meaningful. Directory entries on a CD/DVD are very different from on a Linux partition.

* may be skipping some files, it does not match any file beginning with . For that matter, ls does not list any file beginning with . either (unless you force it with -a).

Sometimes I use this trick:

Code:
tar -C /a/ -cf - . | tar -C /new/folder -xvf -

-C to tar means "change directory" so you can change its point of view before archiving or extracting files... Then you pipe it straight into another tar to extract it.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 04-22-2015
I was talking about the Packages folder's size which is present inside RHELDVD mount /a
You are correct about the size but I was thinking how number of files, subdirectories inside a folder vary.

Quote:
Originally Posted by Corona688
Size of what? The size of a folder in ls is filesystem-specific, and not really meaningful. Directory entries on a CD/DVD are very different from on a Linux partition.

* may be skipping some files, it does not match any file beginning with . For that matter, ls does not list any file beginning with . either (unless you force it with -a).

Sometimes I use this trick:

Code:
tar -C /a/ -cf - . | tar -C /new/folder -xvf -

-C to tar means "change directory" so you can change its point of view before archiving or extracting files... Then you pipe it straight into another tar to extract it.
# 4  
Old 04-22-2015
Well, which files are missing?
# 5  
Old 04-23-2015
See the difference in total of files after ls -lrt command. I was referring to this only.
CPied location:
Image
Image

DVD Mount location:

Image
Image

As you're telling that may be because there is difference of file structure in two.

---------- Post updated at 06:41 AM ---------- Previous update was at 05:14 AM ----------

I read it somewhere, the total points to number of file system blocks that the directory's files occupy.

Last edited by nixhead; 04-23-2015 at 07:21 AM..
# 6  
Old 04-23-2015
Is that all? You can ignore that. How many blocks it takes is very filesystem-dependent, and CD/DVD filesystems are strange enough a hard drive filesystem is going to be radically different.

If you wanted to, you could back up the entire DVD to hard drive bit-by-bit, filesystem and all, as an ISO file. dd if=/dev/cdrom of=/path/to/filename.iso bs=4M
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Lesser bandwidth while copying files from 1 RHEL server to abother.

I am facing an issue of getting lesser band width while copying file from RHEL server to another RHEL machine.In our system , there are 4 no of RHEL 5.9 Enterprise server and 2 network interface in each servers are bonded. Out of 4, 2 machines (Server A and Server B) are with in same network and... (2 Replies)
Discussion started by: Anjan Ganguly
2 Replies

2. Shell Programming and Scripting

How to copy files with the same filenames as those in another folder to that same folder?

Hello All A similar question like this was asked before but I need to change part of the question. I've two folders, Folder A contains some image files in 150 subfolders; Folder B contains text files in 350 subfolders. All image files in Folder A have the same filename as the text... (5 Replies)
Discussion started by: chlade
5 Replies

3. Red Hat

Error throwing while installing vsftpd package in rhel 6. using rhel 6 dvd.

Hi all, Im studying rhcsa as of now, so yum installation and dependencies are messing me to not workit out. i have dual os, win 7 & rhel 6. i have tried this installation of vsftpd package with rhel 6 dvd in VM rhel 6 in win 7 as well as host rhel 6.still the same issue. below error... (6 Replies)
Discussion started by: redhatlbug
6 Replies

4. Shell Programming and Scripting

copy folder and its contents to another folder

Hi experts, I am coming to you with this basic question on copying a folder and its content from one location to another folder using PERL script. This is my requirement. I have a folder AB under /users/myhome I want to copy AB and its contents to /user/workspace. Finally it should... (1 Reply)
Discussion started by: amvarma77
1 Replies

5. Homework & Coursework Questions

Copying Folder, C program

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Copying all the normal files from 1 folder to another on a unix platform. I pass in 1 or 2 arguments, the folder... (0 Replies)
Discussion started by: MW99
0 Replies

6. Shell Programming and Scripting

Split folder into dvd size

Hello everyone, I have a big folder in a linux server that contains dozen of big files (total folder size ~ 50 GB) I have a couple of files of 2.5 GB and some others from 100 MB to 1 GB. (that said it's obvious that it's impossible having two 2.5 GB files in one dvd) The purpose is to... (7 Replies)
Discussion started by: cabrao
7 Replies

7. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

8. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

9. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies
Login or Register to Ask a Question