LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-28-2007, 11:09 PM   #1
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Rep: Reputation: 20
How to copy directories


I am trying to copy my home folder to my Windows partition for safe keeping and so I can back it up along with Windows. So far I'm having no luck.

I created a folder in my Windows c: directory into which I want to put my /home directory.

My most recent command goes something like this...

daryl@24-236-143-115:~$ cp -ir /home /mnt/windows/linux
bash: /$: No such file or directory
 
Old 12-28-2007, 11:18 PM   #2
fuzzyworm
Member
 
Registered: Sep 2003
Location: Stroud, UK
Distribution: Kubuntu, Debian
Posts: 149

Rep: Reputation: 15
There doesn't seem to be anything obviously wrong with the command. Just out of interest, though, could you just type in exactly the command that you typed, without any of the other information, as the error message looks a bit suspect for what appears to be a perfectly legit command.

Also:

What format is the windows partition?
Linux doesn't natively support writing to NTFS drives. This is deliberate, as it avoids losses in journalling data.

Have you checked the case of the folder name - windows may have added a capital letter, which makes no difference in windows, but in Linux, /mnt/windows/linux and /mnt/windows/Linux are two different folders.

Also, you might want to try getting the Windows ext3fs drivers. You might find it easier to do from within windows. There are some free ones around, and some commercial ones. Depending on the importance of the data, it might be worth making sure you get one that fully supports ext3 and journalling.

Hope this is of some help.

Last edited by fuzzyworm; 12-28-2007 at 11:19 PM.
 
Old 12-28-2007, 11:38 PM   #3
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20
24-236-143-115:/home/daryl# cp -r /home /mnt/windows/linux
cp: cannot create directory `/mnt/windows/linux/home': Operation not permitted

If I have it right, the syntax is cp -r /source /destination

Case is correct.
I do have Windows formated in NTFS. Is this possibly the problem or definatly the problem?

What is Windows ext3fs drivers for?

The other day I passed by a program to access Linux file system from within Windows. I didn't think it was important at the time. Do you know what that was?
 
Old 12-29-2007, 12:04 AM   #4
kzutter
Member
 
Registered: Nov 2007
Location: Carson City, NV USA
Distribution: Various, but always Debian based
Posts: 70

Rep: Reputation: 15
Quote:
Originally Posted by sofasurfer View Post
I do have Windows formated in NTFS. Is this possibly the problem or definatly the problem?
Definitely a problem.

Quote:
Originally Posted by sofasurfer View Post
What is Windows ext3fs drivers for?

The other day I passed by a program to access Linux file system from within Windows. I didn't think it was important at the time. Do you know what that was?
That is what he means by ext3fs drivers. This will allow you read (e.g. copy) your files from Windows. (However, it requires that your Linux partition is formatted ext2 or ext3)
 
Old 12-29-2007, 12:54 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you modprobe the fuse module and install the ntfs-3g package, you will be able to mount your windows partition in read-write mode. Because of the different permissions that are used by windows, you should use tar to backup your home directory, and then you can backup the tar file when you backup windows. This will also allow incremental backups.
 
Old 12-29-2007, 04:46 AM   #6
fuzzyworm
Member
 
Registered: Sep 2003
Location: Stroud, UK
Distribution: Kubuntu, Debian
Posts: 149

Rep: Reputation: 15
Yeah, Linux won't (by default) allow you to write to an NTFS drive. The safest way to get around this problem, if you have the disk space, is to create a new partition and format it as FAT32, which is writeable to both Linux and Windows.

If you can't, then either enable NTFS writing in Linux (It was disabled for a reason) or ext2 (assuming yours is ext2/ext3) writing in Windows. Note that for the same reason (i.e. the journal) ext3 support in Windows should be approached with care.

My advice would be to either do the FAT32 partition option, or use a Linux backup solution - there are plenty out there.
 
Old 12-30-2007, 09:12 PM   #7
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20
I've never seen an option in Linux to enable or disable NTFS writing. Please explain.

As for your suggestions regarding fat32, they bring up a related but differant subject...

Originally my system WAS fat32 but I converted it to ntfs and I read that if I did this I would be stuck with the ntfs since it was not possible to convert back to fat32. However, I assumed that if I ever wanted to I could reformat as a fat32 and reinstall windows.

Now, onto my current situation...

In order to solve my problem of not being able to write to the windows ntfs from Linux, I reinstalled windowsxp using another hard drive. I attempted to create a fat32 system. The only software I have to format my drives with , and it has always worked well for me, is "PC Beginner System Analyzer.
I wiped the drive clean and the chose to format it. It gave me the choice of NTFS or fat or fat32. I chose fat32but it would not do anything. So I chose fat. I reinstalled windowsxp (don't know weather it was in fat 16 or fat32. Next I reinstalled Debian along side it. And when I got to the Grub part it warned that windows may not be on the menu. Sure enough, when I rebooted, windowsxp was not on the menu.

My question is this. How do I reformat my disk in fat32. Maybe it can't be done after it has been formatted in NTFS. I don't know.
Any thoughts?
 
Old 12-31-2007, 05:37 AM   #8
fuzzyworm
Member
 
Registered: Sep 2003
Location: Stroud, UK
Distribution: Kubuntu, Debian
Posts: 149

Rep: Reputation: 15
Jschiwal gave instructions for making ntfs writeable above.
Quote:
If you modprobe the fuse module and install the ntfs-3g package, you will be able to mount your windows partition in read-write mode. Because of the different permissions that are used by windows, you should use tar to backup your home directory, and then you can backup the tar file when you backup windows. This will also allow incremental backups.
As for why you can't seem to format the disk as FAT32 - I don't know why this would be. Try using the Debian installer to format the disk as FAT32, then cancel the installation and install Windows. Once Windows is installed on the FAT32 partition, you should be able to install Debian.

As for why Windows was not on the boot menu, I can only guess that this was because the system was FAT not FAT32, as it's not a problem I've had before - as long as the Windows system has been bootable, Debian installer has always been able to include it in the GRUB menu. You may need to post something in the GRUB part of this forum to resolve that one.
 
Old 01-01-2008, 09:57 AM   #9
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Coming from...
http://www.linuxquestions.org/questi...5/#post3006202
... in that thread I have asserted that linux is able to read/write to ntfs. Was challenged by sofasurfer to come here and back up my words. So here I am...

As I understand the situation, the idea is to copy linux files to a windows partition so that the windows backup tools can be used to create simple backups.

Standard lecture: you do not want to use windows for this. Use linux to backup windows - much more reliable. That said...

The initial result:
Code:
daryl@24-236-143-115:~$ cp -ir /home /mnt/windows/linux
bash: /$: No such file or directory
... this occurred because the partition was not mounted or the mountpoint had not been created. You would normally check with

ls /mnt
ls /mnt/windows

The cp command should be using the archive option.

The second try:
Code:
24-236-143-115:/home/daryl# cp -r /home /mnt/windows/linux
cp: cannot create directory `/mnt/windows/linux/home': Operation not permitted
... this occurred because you did not mount the windows file-system read/write. You have to use ntfs-3g, which subsequent posts have directed you to try.

(Note: In debian, there is a deb package in the repos for this: sudo apt-get install ntfs-3g, IIRC, should install the tool and activate the fuse module as well.) Installing ntfs-3g is called "enable NTFS writing in Linux"... as fuzzy said.


This leads to some important questions:
For some reason you have chosen not to use this method, why not?
What method are you using to mount?
Is this vanilla ntfs or encrypted or other?

As for your formatting issues with FAT32... you are using a proprietary partition tool to do this. There is no telling what it thinks it is doing, and "always worked before" means nothing. It doesn't work now. This is not a linux issue - suggest just reinstall to ntfs since that is what works (though you can try parted, and format vfat).

However - fuzzyworm's suggestion was not to reinstall windows to fat32. The suggestion was to create a fat32 partition (use parted) - say, 4GiB - and use that as your linux backup. Windows can give it a drive letter and you're away.

This doesn't concern me. I'm here to talk about ntfs in linux. But it does highlight the conclusion, below.

In conclusion, your continued issues stem from failing to follow advise. The advise offered has been sound, but a tad general... this is because you have failed to supply some needed information.

Last edited by Simon Bridge; 01-01-2008 at 10:05 AM.
 
Old 01-01-2008, 05:55 PM   #10
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Code:
cp -a /home/folder  /tmp
isnt it also copying the folder + subdir. ?
 
Old 01-01-2008, 07:42 PM   #11
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
From cp man page:
Code:
 -a, --archive
              same as -dpR
OP is using "cp -r" ... what happens to permissions and symbolic links? I don't think ntfs supports unix file permissions IIRC ntfs-3g has a way around this, but it's "experimental". But this is (partly) why I strongly advise against using windows to backup GNU/Linux or Unix files.

http://en.wikipedia.org/wiki/NTFS
http://en.wikipedia.org/wiki/NTFS_3G

Lets hear from OP before taking this further.
 
  


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
Copy files from different directories fiomba Linux - Software 3 02-11-2005 03:01 AM
Copy one file to multiple directories cmfarley19 Linux - General 9 11-10-2004 12:57 PM
How do I copy home directories back? G-wizz Linux - Newbie 5 06-11-2004 06:20 AM
copy directories and subdirectories Red Squirrel Linux - Newbie 2 03-06-2004 09:18 PM
How to copy one file in all users directories aizkorri Programming 1 09-02-2002 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

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