Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-17-2012, 01:39 PM   #1
LQ Newbie
Registered: Oct 2012
Posts: 3

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


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,
Old 10-17-2012, 02:08 PM   #2
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 02:11 PM.
Old 10-17-2012, 05:09 PM   #3
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, 06:35 PM   #4
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.0, 14.1, current
Posts: 418

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:
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.
umount /ntfs-disk
mount -t ntfs-3g /dev/sdc1 /ntfs-disk
You should be able to write now.
Old 10-19-2012, 03:53 PM   #5
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
Old 10-19-2012, 06:44 PM   #6
LQ 5k Club
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,598
Blog Entries: 15

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

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

Rep: Reputation: 166Reputation: 166
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'



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

All times are GMT -5. The time now is 01:44 AM.

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