Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
exact copy from FAT32 to EXT3

Reply  
Thread Tools
DiGiTY's Avatar
Member with 322 posts.
 
Join Date: Oct 2006
13-Sep-2008, 05:10 AM #1
exact copy from FAT32 to EXT3
I got a FAT32 drive and I want to essentially copy all the files and folders over to a EXT3 drive preserving their date and time. How can I accomplish this using Ubuntu/Linux or Windows?
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
13-Sep-2008, 09:46 AM #2
Hi DiGiTY,

For the purpose of explanation, let's assume you have the latest Ubuntu 8.04 Live CD, i.e. Hardy Heron, and have booted it up in an environment where both of your disks - i.e. FAT32 (or vfat) and Linux (ext3) drives are available when you give the sudo fdisk -l command from a Terminal (command line) window.

First, you would need to become the root user and issue the command:
$ sudo -i
# fdisk -l
Then you would need to make the directory mount points for mounting both the FAT32 and the ext3 file systems:
# mkdir /mnt/fat32
# mkdir /mnt/ext3
Then you would need to mount each file system from the data output by the fdisk -l command, like the following (where you supply the partition device names to mount - i.e. sxxx and hxxx):
# mount -v -t ext3 /dev/sxxx /mnt/ext3
# mount -v -t vfat /dev/hxxx /mnt/fat32

One method I would definitely favor would be the following use of the tar command from the Linux Live CD environment, assuming Linux root user:

# (cd sourcedir; tar -cf - .) | (cd targetdir; tar -xf -)

The sourcedir would be the full path name on the FAT32 drive from the mount point, i.e. /mnt/fat32/... where ... is the name of the topmost directory you want to copy, and similarly for the targetdir - i.e. /mnt/ext3/...

Give this method a shot before you try anything else, as it is the easiest way to get what you want (caveat: if it works - and I think it will, but have not tried it).

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
TerryNet's Avatar
Computer Specs
Moderator with 48,403 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
13-Sep-2008, 10:55 AM #3
In Linux the cp command has a 'preserve' option to preserve such things as timestamps.

Maybe I'm not understanding all the issues, but it seems like cp with the proper arguments would do the job.
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
13-Sep-2008, 12:34 PM #4
Quote:
Originally Posted by TerryNet View Post
In Linux the cp command has a 'preserve' option to preserve such things as timestamps.

Maybe I'm not understanding all the issues, but it seems like cp with the proper arguments would do the job.
Hi TerryNet,

The cp command will work, but you have to give it the following arguments:
$ cp -rp ./* <destination>

The -r argument is necessary to recursively include directory contents.

-- Tom
DiGiTY's Avatar
Member with 322 posts.
 
Join Date: Oct 2006
13-Sep-2008, 06:52 PM #5
so what's the difference between using "# (cd sourcedir; tar -cf - .) | (cd targetdir; tar -xf -)" and "cp -rp ./* <destination>"? are the results different? is one faster than the other (I am moving 1 TB of data)?

does the tar option actually archiving the files to the destination or copying the actual files and folders?
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
14-Sep-2008, 10:27 AM #6
Hi DiGiTY,

The difference is that the first form (tar) will work over a network whereas cp is local to your system - though you can either use rcp instead of cp over a network, and can certainly mount remote file systems over a network to use the cp command. Note: no tar archive is stored permanently for this operation - I assume you have 1 GB or more RAM to do the operation locally - is that correct? The less memory you have, the longer it will take to transfer 1TB, so make sure you have shutdown any unnecessary executables when you are performing the transfer of data - and you might just disconnect from the Internet if this is a local operation whether over a LAN or just within your computer system from disk to disk.

Use scp, which uses ssh, for a secure copy over a network.

Most, if not all Unix/Linux administrators would probably prefer using the tar command for a job a large as yours, though some might not. The results should be the same in any case (i.e. no file data lost moving the files to a differently formatted file system), though if I wanted an "exact" copy I would create a partition at least the size of the data you are moving onto another disk, and use the dd command to do the copy to a like fat32 formatted file system (assuming the Linux Live CD model as I stated). That way the disk segments are copied precisely and you can control the block size that is transmitted (since you are moving 1TB of data). See the man page for dd for more information.

The tar command will preserve everything and uses a pipe to do the job while the (r)cp command(s) need(s) the explicit parameter -p to preserve the file attributes - tar is basically more flexible and reliable between file systems. If you forget the -p or -r parameter using any of the cp commands - you don't get what you wanted.

The thing that would concern me the most in your case is what if the transfer is interrupted (say due to a power outage) when you attempt the copy? Is your system backed up with UPS - uninterruptable power supply? Just make sure you have enough space at the destination storage, and hopefully all goes well regarding continuous power during the operation. It would be nice to use a backup system or method that can at least take a snapshot, and resume the operation if it is interrupted since your data set is so large (1TB).

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
DotHQ's Avatar
Member with 449 posts.
 
Join Date: May 2008
Location: Ohio USA
Experience: Advanced
14-Sep-2008, 11:29 AM #7
I would suspect the tar would use extra overhead to first tar the data and then to extract that data from the temp tar file.
I would go with cp or rcp for this particular task. If not on a private network the scp should be used, but it will be slower for sure.
__________________
"May you buld a ladder to the stars and climb on every rung" - Bob Dylan
"In this age of Fiberglass I'm searching for a gem" - Bob Dylan
Net Music Talk Forums Fourms .com Net Cooking Talk DotHQ .com
DiGiTY's Avatar
Member with 322 posts.
 
Join Date: Oct 2006
14-Sep-2008, 07:32 PM #8
well it's 900 GB of data i'm transferring from one drive to another. the fastest method would be ideal especially if it keeps timestamps in tact
avisitor's Avatar
Computer Specs
Senior Member with 1,712 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced
14-Sep-2008, 07:44 PM #9
I'd assume cp is faster. A block level transfer is fastest, though, but not possible for this application.

You could benchmark it on, say 1GB of files, and see which is faster. I have a hunch it'll be cp, but the actual difference shouldn't be that great.
__________________
Austin

Please refresh, I edit my posts often.
DiGiTY's Avatar
Member with 322 posts.
 
Join Date: Oct 2006
15-Sep-2008, 05:53 PM #10
"cp -rpufv ./ /media/DAISY" seems to be working just fine (the update option is used because I previously moved 400 GB of data over already for test purposes). so far the files AND folders timestamps are preserved
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:58 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.