LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-17-2012, 12:39 PM   #1
stevenvw
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Rep: Reputation: Disabled
howto: copy files/folder(entire directory) from linux harddrive to ntfs formatted dri


Hello,

I have a harddrive that is formatted with a linux partition (the partition was my data partition). However, the main harddrive on the computer died...I want to copy my data onto a harddrive that is formatted with ntfs so that I can place this in a windows machine instead. I am using a live disc right now, but I cannot copy and paste all the folders/files over because of permission issues, so it seems that I will need to use the terminal to do this...but im not exactly sure how to go about doing this..

I have three harddrives connected to the computer running the live disc, and I would like to copy all the files/folders from my linux formatted disc(sda) to the ntfs disk(sdc)
It would also maybe be a good idea to reformat sdc (with ntfs of course) to make sure that there are no extra partitions/folders/files before copying the directory of sda??

the linux hd is "sda"
and the destination disc is "sdc"


any help is appreciated,
thanks
 
Old 10-17-2012, 01:08 PM   #2
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 12.04/14.04, Scientific Linux 6.3/6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,799

Rep: Reputation: 157Reputation: 157
To get around permission issues, you need to be root (using either sudo or su)... when transferring the files.

If you want to use the data again within Linux, you would want to stay on a Linux filesystem. It it doesn't matter, it would be safer to move to a FAT32 partition (assuming the files don't exceed 4GB each). Using Linux to format and write a large number of files to NTFS is a potentially risky proposition (NTFS support in Linux is reverse engineered).

If you have a home network, and another machine, you might want to install a new Linux OS (or boot with a Live CD that supports Samba), share the Linux partition or drive you want to export the data from, and copy the files over the network to the Windows machine...

I, for one, don't trust Linux's ability to manipulate NTFS in anything resembling a stable way, any more than I would trust Windows to write EXT4 partitions (with the proper 3rd party drivers)...

It begs the questions,... What kind of data is it? How large are the files? And,... Where do you intend to use it?

Last edited by JaseP; 10-17-2012 at 01:11 PM.
 
Old 10-17-2012, 04:09 PM   #3
stevenvw
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
ok, first: I don't plan to keep using the data in windows...this computer was pretty much being used for file storage (over the network). This was the only linux machine that was being used, the data was all from windows computers

second: I plugged in the 'data' hard-drive from the Linux machine with the ext4? partition(sda) as well as an spare blank drive(sdc) into another computer that I have (running Ubuntu live-disc right now) If its a little shaky with ntfs I have no issue with going to fat32 (i just want to copy all the files/folders onto a partition that is natively recognized in windows) because of permissions issues I cannot copy and paste these folders without being root, so I am stuck using the terminal and sudo

the data is mainly financial information and documents, pictures etc, so the 4GB file size should not be an issue


I am a complete noob when it comes to Linux and using the terminal, so I would need step-by-step instructions to ever be able to do this...:/ The only thing that I was able to figure out was which computer was sda/sdb/sdc (and thats about all I know..)
 
Old 10-17-2012, 05:35 PM   #4
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.0, 14.1, current
Posts: 417

Rep: Reputation: 52
You are going to need to find out the partitioning of your hard-drive (sdc). The default ntfs mounted disk doesn't allow you to write. You need to mount it with ntfs-3g. These means:
Quote:
root@server:/# df -hT
Filesystem Size Used Avail Use% Mounted on
/dev/root 33G 28G 2.9G 91% /
/dev/sda2 19G 12G 5.6G 68% /home
/dev/sdc1 10G 2G 8G 20% /ntfs-disk
tmpfs 492M 0 492M 0% /dev/shm
This will list the mounted devices. Umount your device and mount it back with ntfs-3g.
Quote:
umount /ntfs-disk
mount -t ntfs-3g /dev/sdc1 /ntfs-disk
You should be able to write now.
 
Old 10-19-2012, 02:53 PM   #5
stevenvw
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
formatted to fat32

Ok, to make life a little easier I just took the ntfs disk, popped it into a windows machine and reformatted the entire disk as fat32

so now all I need to do is simply copy the files over on the disc with fat32...each disc has only one partition on it also which should help keep life a little simpler as well..

So now I'm ready to copy the data over, but I'm not sure which commands to use anymore...would you be able to tell me exactly what has to be typed in (including where to type sude etc...sorry, I feel really stupid right now, and I just want to make sure that I am doing this right
thanks
 
Old 10-19-2012, 05:44 PM   #6
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,253
Blog Entries: 11

Rep: Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289
Code:
cd ~
rsync -avzp . /ntfs-disk
should copy your /home/$user directory contents over to /ntfs-disk

Code:
man rsync
 
Old 10-19-2012, 06:57 PM   #7
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
#1
stevenvw,
copy the stuff to a fat (32/16etc) partition on anything handy and put that on your ntfs partition/disk as I don't think fat recognises permissions. Alternatively change the permissions on the original with chmod eg, 'chmod 777 /dev/whatevever'

Fred.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to copy an entire directory structure except certain files? thanhvn Programming 9 01-27-2012 11:41 AM
Copy an entire folder tree pshankland Linux - Newbie 3 09-28-2010 03:48 AM
want to copy an inode folder from acdrom to a home directory (folder). nhbob Linux - Newbie 8 12-20-2009 11:12 AM
How to copy files from an entire directory tree using terminal commands??? lusius188 Linux - General 3 04-10-2006 11:23 AM
Using wget to copy entire ftp directory stuartmunro Linux - Newbie 7 06-17-2005 07:06 PM


All times are GMT -5. The time now is 09:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration