LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-05-2007, 08:10 PM   #1
nataly
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Rep: Reputation: 0
Exclamation Copy files from windows to linux partition


I installed Linux and Windows in the same computer and i would like to access files on the Windows partition. I know that i must use the mount command.

My question is what command should i write after i mount the windows partition, to copy the windows files on linux, not just see them. Is it possible to do that?

P.S. I can read and copy linux partitions from windows using "Linux Reader", but i want to do the exact opposite!!!
 
Old 10-05-2007, 08:47 PM   #2
mjmwired
Member
 
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 39
Which version of Linux?

Run 'man mount' for more information.

If Windows is using NTFS (XP, 2000, Vista?), google for 'ntfs-3g' support in your Linux distribution.
If Windows is using FAT32 (98, Me, older), that is automatically supported run 'man mount' and look for 'vfat'.
 
Old 10-06-2007, 09:42 AM   #3
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
After you have mounted the drive?

From the command line, the cp command will copy from windows to linux. You also can click/drag from a graphical desktop such as KDE or Gnome.
 
Old 10-06-2007, 10:42 AM   #4
nataly
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by jiml8 View Post
After you have mounted the drive?

From the command line, the cp command will copy from windows to linux. You also can click/drag from a graphical desktop such as KDE or Gnome.
Can you please write the full cp command that i must use? I am new at linux and i am now trying to learn some things so i have a problem with that
 
Old 10-06-2007, 11:24 AM   #5
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Rep: Reputation: 30
as the root user type
# fdisk -l
It will show all partitions of your disk.(hda1,hda2...)

You can easily identify the partition in which windows has installed (ntfs/vfat), may be hda1
# mkdir /mnt/windows (if there is no such directory)

# mount /dev/hda1 /mnt/windows
or
# mount -t ntfs /mnt/windows
this will mount your windows file system

# ls /mnt/windows

# cp /mnt/windows/ /home/username/
 
Old 10-09-2007, 10:37 AM   #6
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by nataly View Post
Can you please write the full cp command that i must use? I am new at linux and i am now trying to learn some things so i have a problem with that
To learn how to use any of the commands that are commonly available from the command line, use the man command.

Thus, man cp will give extensive directions on the usage of the cp command.

Generally, you'll do something like this:

cp filename /path/to/destination/filename

in order to copy. But there are lots of options and wildcards are supported. So studying man is the best thing to do.
 
Old 10-09-2007, 11:08 AM   #7
devn
Member
 
Registered: Mar 2007
Location: Bangladesh
Distribution: Suse, Solaris
Posts: 40

Rep: Reputation: 15
Quote:
Which version of Linux?

Run 'man mount' for more information.

If Windows is using NTFS (XP, 2000, Vista?), google for 'ntfs-3g' support in your Linux distribution.
If Windows is using FAT32 (98, Me, older), that is automatically supported run 'man mount' and look for 'vfat'.
I guess you should look for what type of file system you are looking to mount.
If its NTFS, look for ntfs kernel drivers for your linux. If your partition is FAT32, your kernel should already support it natively.

If you are using Fedora or redhat flavour, you could try out this script:

Code:
#!/bin/bash
#
# Copyright 2003-2004 FlatCap (Richard Russon)
# This file may be copied under the terms of the GNU Public License:
#   http://www.gnu.org/licenses/gpl.html
#
# Determine which NTFS RPM the user needs.
#
# This file is available online from:
#   http://data.linux-ntfs.org/rpm/whichrpm
#
# whichrpm should be used in conjuection with the NTFS RPM instructions:
#   http://www.linux-ntfs.org/content/view/127/63/
#
# ChangeLog:
#
# 1.11 - 15 Apr 2007 - Richard Russon (FlatCap)
#     - Identify RHEL5 and CentOS5
#
# 1.10 - 20 Mar 2006 - Richard Russon (FlatCap)
#      - Identify Fedora 5 (Bordeaux)
#
# 1.9 - 8 Mar 2006 - Richard Russon (FlatCap)
#     - Identify CentOS 4 (RHEL4 clone)
#
# 1.8 - 3 Dec 2005 - Richard Russon (FlatCap)
#     - Update links to point at the new website
#
# 1.7 - 6 Jul 2005 - Richard Russon (FlatCap)
#     - Identify Fedora Core 4 Xen kernels
#     - Contrib has moved to main pages
#
# 1.6 - 13 Jun 2005 - Richard Russon (FlatCap)
#     - Identify RedHat Enterprise 4 (Nahant)
#     - Identify Fedora Core 4 (Stentz)
#
# 1.5 - 24 Nov 2004 - Richard Russon (FlatCap)
#     - Direct 64-bit users to the contrib page
#
# 1.4 - 18 Oct 2004 - Richard Russon (FlatCap)
#     - Identify RedHat Enterprise 4 Beta
#
# 1.3 - 02 Aug 2004 - Richard Russon (FlatCap)
#     - Identify RedHat Enterprise
#
# 1.2 - 02 Aug 2004 - Richard Russon (FlatCap)
#     - Identify Fedora Core 2 and Fedora Core 3 test versions
#     - Bugfix: More verbose on errors
#
# 1.1 - 03 Dec 2003 - Richard Russon (FlatCap)
#     - Bugfix: multiple kernels gave misleading results
#
# 1.0 - 09 Nov 2003 - Richard Russon (FlatCap)
#     - Initial version
#     - Identifies RH7,8,9 and FC1

# Intialisation

VER="1.11"
RDT="15 April 2007"
REL=
DOWN=

if [ "$1" = "-v" ]; then
	VERBOSE="true"
fi

vecho()
{
	if [ "$VERBOSE" = "true" ]; then
		echo $*
	fi
}


# Welcome

vecho
vecho "This is the 'whichrpm' script, v$VER, released $RDT"
vecho "It will try to work out which NTFS RPM you need."
vecho
vecho "The latest version can be downloaded from:"
vecho "    http://www.linux-ntfs.org/content/view/127/63/"
vecho

# First determine which vendor we have: RedHat or Fedora

RH_REL=/etc/redhat-release
FC_REL=/etc/fedora-release

if [ -f $FC_REL ]; then
	VENDOR="Fedora"
	REL=`cat $FC_REL`
else
	if [ -f $RH_REL ]; then
		VENDOR="RedHat"
		REL=`cat $RH_REL`
	fi
fi

if [ -z "$REL" ]; then
	echo "Error:"
	echo "Unfortunately, I can't find either /etc/redhat-release, or"
	echo "/etc/fedora-release  Without either of these files, I can't work out"
	echo "which distribution you have."
	echo "Giving up."
	echo
	exit 1
fi

# See if we have a download for this version

case $REL in
	"Fedora Core release 5 (Bordeaux)")
		vecho "You are using Fedora 5 (Bordeaux)"
		DOWN="http://www.linux-ntfs.org/content/view/187/89/"
		;;
	"Fedora Core release 4 (Stentz)")
		vecho "You are using Fedora 4 (Stentz)"
		DOWN="http://www.linux-ntfs.org/content/view/129/65/"
		;;
	"Fedora Core release 3 (Heidelberg)")
		vecho "You are using Fedora 3 (Heidelberg)"
		DOWN="http://www.linux-ntfs.org/content/view/130/66/"
		;;
	"Fedora Core release 2 (Tettnang)")
		vecho "You are using Fedora 2 (Tettnang)"
		DOWN="http://www.linux-ntfs.org/content/view/133/69/"
		;;
	"Fedora Core release 1 (Yarrow)")
		vecho "You are using Fedora 1 (Yarrow)"
		DOWN="http://www.linux-ntfs.org/content/view/134/70/"
		;;
	"Fedora Core release"*)
		echo "I don't recognise this version of Fedora Linux.  Please check you have the"
		echo "latest version of the 'whichrpm' script."
		;;
	"Red Hat Linux release 7.0 (Guinness)" |	\
	"Red Hat Linux release 7.1 (Seawolf)"  |	\
	"Red Hat Linux release 7.2 (Enigma)")
		echo "Unfortunately, you are running an old version of RedHat Linux."
		echo "There aren't any NTFS RPMs for this version.  I recommend that you consult"
		echo "the RedHat website for instruction on how to upgrade your kernel."
		;;
	"Red Hat Linux release 7.3 (Valhalla)")
		vecho "You are using RedHat 7.3 (Valhalla)"
		DOWN="http://www.linux-ntfs.org/content/view/139/75/"
		;;
	"Red Hat Linux release 8.0 (Psyche)")
		vecho "You are using RedHat 8.0 (Psyche)"
		DOWN="http://www.linux-ntfs.org/content/view/138/74/"
		;;
	"Red Hat Linux release 9 (Shrike)")
		vecho "You are using RedHat 9 (Shrike)"
		DOWN="http://www.linux-ntfs.org/content/view/137/73/"
		;;
	"Red Hat Enterprise Linux "??" release 3 (Taroon"*)
		vecho "You are using RedHat Enterprise 3 (Taroon)"
		DOWN="http://www.linux-ntfs.org/content/view/136/72/"
		;;
	"Red Hat Enterprise Linux "??" release 4 (Nahant"*)
		vecho "You are using RedHat Enterprise 4 (Nahant)"
		DOWN="http://www.linux-ntfs.org/content/view/135/71/"
		;;
	"Red Hat Enterprise Linux "*"Tikanga"*)
		vecho "You are using RedHat Enterprise 5 (Tikanga)"
		DOWN="http://www.linux-ntfs.org/content/view/257/92/"
		;;
	"CentOS release 4"*)
		vecho "You are using CentOS release 4"
		DOWN="http://www.linux-ntfs.org/content/view/135/71/"
		;;
	"CentOS release 5"*)
		vecho "You are using CentOS release 5"
		DOWN="http://www.linux-ntfs.org/content/view/257/92/"
		;;
	"Red Hat Enterprise Linux"* |	\
	"Red Hat Linux"*)
		echo "Unfortunately there aren't any NTFS RPMs for the version of RedHat Linux"
		echo "that you are running."
		;;
	*)
		echo "I can't identify which distribution you are running."
		;;
esac

if [ -z "$DOWN" ]; then
	echo "Giving up."
	echo
	exit 1
fi

# determine which kernel version and type we have

KVER=`uname -r`

case $KVER in
	*smp)
		vecho "You have an Multi Processor (SMP) kernel"
		SECTION="Multi Processor"
		SUFFIX='-smp'
		VERSION=`echo $KVER | sed 's/smp$//'`
		;;
	*BOOT)
		vecho "You have a Specialist kernel"
		SECTION="Specialist"
		SUFFIX="-BOOT"
		VERSION=`echo $KVER | sed 's/BOOT$//'`
		;;
	*xen0)
		vecho "You have a Specialist kernel"
		SECTION="Specialist"
		SUFFIX="-xen0"
		VERSION=`echo $KVER | sed 's/xen0$//'`
		;;
	*xenU)
		vecho "You have a Specialist kernel"
		SECTION="Specialist"
		SUFFIX="-xenU"
		VERSION=`echo $KVER | sed 's/xenU$//'`
		;;
	*bigmem)
		vecho "You have a Specialist kernel"
		SECTION="Specialist"
		SUFFIX="-bigmem"
		VERSION=`echo $KVER | sed 's/bigmem$//'`
		;;
	*hugemem)
		vecho "You have a Specialist kernel"
		SECTION="Specialist"
		SUFFIX="-hugemem"
		VERSION=`echo $KVER | sed 's/hugemem$//'`
		;;
	*)
		vecho "You have a Single Processor kernel"
		SECTION="Single Processor"
		SUFFIX=""
		VERSION=$KVER
		;;
esac

# determine which architecture the kernel is

ARCH=`rpm -q --queryformat '%{ARCH}' kernel$SUFFIX-$VERSION`

vecho "You have an $ARCH kernel"
vecho

# Summarise

vecho "Go to this page:"
vecho "  $DOWN"
vecho
vecho "and lookup Version '$VERSION' in the 'NTFS RPMs' table."
vecho "Then find the '$ARCH$SUFFIX' column - it will be in the '$SECTION' section."

vecho
vecho "Summary..."
echo
echo "Web Page: $DOWN"
echo "Version:  $VERSION"
echo "Section:  $SECTION"
echo "Arch:     $ARCH$SUFFIX"
echo
Or visit http://www.linux-ntfs.org (http://www.linux-ntfs.org/doku.php?id=downloads (the download page))
to download the correct rpm for your kernel and arch.

I guess it should resolve your problem.

then mount your partition using this command (if your partition is /dev/hda1):

Code:
mkdir /mnt/win
mount /dev/hda1 /mnt/win
++++++++++++++++++++++++++++++++++++++++++++++

Then
Code:
cd /mnt/win
cp <your file names go here> <your destination directory name here>
++++++++++++++++++++++++++++++++++++++++++++++

Last edited by devn; 10-09-2007 at 11:10 AM.
 
  


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 files to Windows partition and how to access USB port? BootLaptop Linux - Software 5 07-25-2007 12:08 AM
Copy files from Windows partition to Linux partition Shibumgeorge Linux - Software 3 04-20-2007 10:08 AM
better say, enter windows and copy some files, and the partition is NTFS juangabriel1786 Linux - General 3 01-20-2006 11:49 AM
Copy files to Windows partition DavidW567 Linux - Software 5 11-16-2004 06:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02: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