分类: LINUX
2006-05-27 14:08:25
Here are the steps to be done in order to transfer files from a Linux filesystem (JFS/XFS/Reiserfs/EXT3/whatever you prefer) to a Windows filesystem (NTFS).
Table of contents |
More detailed instructions here:
For this reason, you have to use Windows to create an image you'll write over.
Say, you're going to copy 5 gigabytes of files to your NTFS partition. You must create a 5 gigabyte file to your NTFS partition, using your Widows. In Linux (or any unix system in general), you would do it with a
dd if=/dev/zero bs=1m count=5000 of=filecommand, but in Windows, it's not that simple.
You can create it in any way you want ― the contents of the file do not matter. If you can't think of anything, I recommend using to compress a couple of anime episodes together.
When you have created the big file, rename it as something.tar.gz. Ensure the filename ends with .tar.gz (dot tee ay ar dot jee zed).
The file may be bigger than the source files together, but it must not be smaller.
If your subject is an EXT2 / EXT3 filesystem, you can for a shareware Windows program that lets you read those filesystems in Windows. For the other ones mentioned, there's no such choice.
So, ironically, in order to mount a JFS/XFS/Reiserfs/whatever filesystem to copy files to Windows, you must boot into Linux.
In order to boot into Linux, you need to have Linux installed somewhere. I won't cover Linux installation & starting in this document ― I'll just assume you have it somewhere. If you're lazy and lucky, a non-permanent Linux installation such as a "livecd" is probably enough.
The tricky part is that your NTFS driver in Linux must have been compiled with WRITE SUPPORT -- otherwise it won't write anything.
Try mounting your NTFS partition (remember to be root!):
mkdir /mnt/d mount /dev/hda5 -t ntfs /mnt/d -o rwReplace /dev/hda5 with your partition location. If the mount command fails and you didn't type anything wrong, you don't have NTFS support at all. Do a modprobe ntfs and try again. If it still fails, you need to compile the NTFS driver. See below.
If the mount command worked without problem, next do this:
grep /dev/hda5 /proc/mountsIf the line you get contains "rw,", you can skip the following chapter and read about how to write.
Notes:
When you're in the menuconfig (make menuconfig),
If you compiled NTFS as a non-module, you need to reboot now.
After done, unload the old NTFS driver:
rmmod ntfsIf it complains it's busy, unmount all NTFS mounts (umount -a -t ntfs) and try again.
modprobe ntfsNow go back to the mounting test.
For the sake of clarity, we'll use now these assumptions. Adjust the instructions in your mind if these are not exactly your cases:
Use this command:
cd /mnt/b1/anime/FMA tar cvfz - *.avi | dd conv=notrunc of=/mnt/d/Animet/FMA.tar.gzThis should work. Did you get error messages? Sorry, I can't help you there. You'll have to resolve it yourself.
So what happened?
Note that using dd, and specifically its conv=notrunc option is important here. The normal '<' and '>' ways of redirecting the stream don't work, because NTFS writes rely on the file size not changed.
I won't cover colinux installation here, but I'll cover the steps to transfer files using this method:
Thanks to Paul Jackson for the conv=notrunc information.