Friday, January 16, 2009

Copying File from Linux to windows filesystem

Hi all ,
When you want to copy a file from linux ext2 or ext3 filesystem to windows ntfs or fat32 filesystem
Don't copy it directly like using command
cp filename /dev/sda
or
cp filename /dev/hda
It will convert the whole drive to raw data.
So better option is first mount the drive in which you want to copy a file from linux and then copy it mounted directory and then you can unmount the drive.
user@#mkdir temp (make a temporary drive to mount the drive)
If the drive you want to mount is FAT32 then use following command

user@#mount -t vfat /dev/sda /temp

If the drive you want to mount is NTFS then use following command

user@#mount -t ntfs /dev/sda /temp

Now you can see the contents of the drive /dev/sda or /dev/hda in temp folder
Now you can copy the file in temp folder
using
cp filename /temp

When you are done with copying files you can unmount the drive
using

user@#umount temp

And you are done ....

No comments:

Post a Comment