LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2005, 01:26 PM   #1
TruthSeeker
LQ Newbie
 
Registered: Oct 2005
Location: Cartaxo, Portugal
Distribution: Red Hat Enterprise 4 Mostly
Posts: 25

Rep: Reputation: 15
Problem copying large amount of files from IDE external case in Fedora C4


hi

i got some 15gb of files im trying to copy from an external ide case (connected trough usb) drive patitition (ntfs -> i installed linux-ntfs (cant post link :s)) to my home folder. I can read ALL files in original folder trough file brower;
Im logged in as root (otherwise couldnt mount external ide partits).

After copy process im missing some 300 files ~1gb in destination folders, spread by many completly different subfolder/subfolder/files.xpto single files (not a single subfolder). im trying to identify and copy those missing files manually atm. No error displayed any time during process copy.
Apparently it just "forgot" some 300 files during mass copy.

It this 'possible'?
Any ideas?
linux-ntfs 'copy()' bug?
thx

Last edited by TruthSeeker; 10-25-2005 at 03:03 PM.
 
Old 10-25-2005, 03:12 PM   #2
TruthSeeker
LQ Newbie
 
Registered: Oct 2005
Location: Cartaxo, Portugal
Distribution: Red Hat Enterprise 4 Mostly
Posts: 25

Original Poster
Rep: Reputation: 15
Damn! Missing 100 files or so. so many folders i just cant go on. anyone know of an easy way to "compare" the two folders content? so i can identify and copy the missing files?

any1 got any little app that does it or src code? chiuf

ill be out 4 coffe 4 a while.
bbl to continue my file finding and school programming saga.
 
Old 10-25-2005, 03:12 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
If you are using the external drive, it has to have a mount point. A mount point is a directory, off the linux root directory tree somewhere where the disk is mounted.

Launch a console

cd to the mount point of the external:

cd /mnt/usbdrive

run this command:

cp<space>-r<space>*<space>/home/sam/directory

Don't run the command exactly like that, change the last part to where your are copying your files.

I know you can do it. The Portugese are awesome people. You have great capability. I have faith in you.
 
Old 10-25-2005, 06:45 PM   #4
TruthSeeker
LQ Newbie
 
Registered: Oct 2005
Location: Cartaxo, Portugal
Distribution: Red Hat Enterprise 4 Mostly
Posts: 25

Original Poster
Rep: Reputation: 15
Ok, ill try copying it trough the console.
But shouldnt it give the same results anyway?

Oh, and thanks 4 that ego-lifting thing, why do u guys always do that anyway?
Very inspiring. lol

Edit: ive cleaned up what i had in dest folder (so that i dont hav to click 'y' 7000 times) and im copying now. this is gonna take a while...

Last edited by TruthSeeker; 10-25-2005 at 06:54 PM.
 
Old 10-25-2005, 09:05 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
(ntfs -> i installed linux-ntfs
Do you say here that you created an NTFS partition in Linux and tried to copy to that NTFS partition in Linux?

If so, it is common opinion that writing to NTFS in Linux is tricky and unreliable. It would explain the many missing files and the wrong subdirectories etc.

If so, why did you create an NTFS partition in Linux? ext3 is much more suitable.

If not, I don't have a clue either.

jlinkels
 
Old 10-25-2005, 09:17 PM   #6
TruthSeeker
LQ Newbie
 
Registered: Oct 2005
Location: Cartaxo, Portugal
Distribution: Red Hat Enterprise 4 Mostly
Posts: 25

Original Poster
Rep: Reputation: 15
nope only the source is ntfs. i only installed linux-ntfs in order to able to mount it.

thx anyway ^^
 
Old 10-25-2005, 09:54 PM   #7
TruthSeeker
LQ Newbie
 
Registered: Oct 2005
Location: Cartaxo, Portugal
Distribution: Red Hat Enterprise 4 Mostly
Posts: 25

Original Poster
Rep: Reputation: 15
Console copy result:

Copied 7104 files. 7229 total, still missing 125 files... puf!

any can get me C code for getting index of all files in a folder so i can build an app to solve the problem?

i could compare those existing in original folder with those in dest folder and copy those that dont exist. And if i am to use this disk often i really need it.

i know how to get and copy a specific file, dunno how to get all in a specific location tough.
 
Old 10-26-2005, 12:39 AM   #8
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
Since you are running out of options, why not give rsync a try?

Rsync is associated with Samba (see: http://rsync.samba.org/ ) and was originally developed for copying across networks. It works fine on local files and only copies files that have changed. Using ntfs files as a source may cause problems, but it's worth a try.

Using rsync is a lot like using cp:

rsync -r /mnt/source/ /mnt/destination/

That would recursively copy whatever was in /mnt/source to /mnt/destination. In a linux-type filesystem setting, you would usually run it like this:

rsync -a /mnt/source/ /mnt/destination/

where -a is archival and is similar to cp archival copies. Since the concept of preserving the owner, group, permission, etc. does not really apply to ntfs files, the -a option might have unexpected consequences when copying ntfs files.

You could always try -a v.s -r on a small directory and see what happens. In any case, you can always run chown, chgrp and chmod after you're finished.

For more details, see:

man rsync
 
Old 10-26-2005, 02:04 AM   #9
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
OK, try this. Every device has a /dev device file. Look in /etc/fstab and find the device that corresponds to your usb HDD. Then do:

dd if=/dev/usbdevice of=/home/sam/usbpartition.bin bs=4096 conv=notrunc,noerror

Then do:

mkdir /mnt/usbpartition

Then put this in /etc/fstab:

/home/sam/usbpartition.bin<space>/mnt/usbpartition<space>filesystemonusbdrive(ext3,reiserfs,NTFS,msdos,etc)<space>defaults<space>0<space>0

Then do:

mount -o loop /mnt/usbpartition

cd /mnt/usbpartition

See if dd copied everything.

Then do:

cp -r * /home/sam/recoverydirectory

cd /home/sam/recoverydirectory

Check for all files.

I have faith in you. I think this will work, and it shouldn't take very long.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying large files to FAT32 sketch7 Linux - General 11 10-22-2007 10:13 AM
Samba Problem: Fedora crashes when transferring large files TheLizard Linux - Networking 6 05-08-2005 04:19 AM
USB External Hard Disk problem with large files nick1.41 Linux - Hardware 0 05-26-2004 07:33 PM
Samba hangs up at copying many large files ogcu Linux - Networking 1 05-19-2004 01:29 AM
Error copying large files from cdrom patrickyeo Linux - Hardware 1 11-03-2002 06:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:57 PM.

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