LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how can i mount my windows hard drive in the Linux ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-mount-my-windows-hard-drive-in-the-linux-655609/)

screwdriver 07-14-2008 05:08 AM

how can i mount my windows hard drive in the Linux ?
 
i have two hard drives in my computer. one is sata hard drive and another one is IDE. i have installed the windows XP in the sata hard drive and the redhat linux enterprise 5 in the IDE hard drive. my SATA hard drive is in NTFS format. now i want to mount my windows hard drive in linux. how can i do it?

emi_ramo 07-14-2008 05:13 AM

Serve it as Samba and mount it from server to a directory.

rikijpn 07-14-2008 05:14 AM

man mount
 
Did you try
Code:

sudo mount -t ntfs /dev/sda1 somedir
?
You could add something similiar in your fstab so it can be mounted automatically since boot time,etc. Also, you might try checking the manuals of mount.

linuxlover.chaitanya 07-14-2008 05:56 AM

Samba? Why do you need samba server when machine is in dual boot?
This has been explained before on how to mount ntfs windows partitions in linux.
If you are not using a newest version of kernel then you might want to install ntfs-3g from www.ntfs-3g.org.
If your package manager allows to install it, then you might want to use it rather than compiling from source.

kdrlx 07-14-2008 06:00 AM

For adding to /etc/fstab (assuming your ntfs drive is sda1)
1. Create a directory to use as mount point eg. /media/win_drive
2. Append the following at end of file --

/dev/sda1 /media/win_drive ntfs-3g user 0 0

Explanation --
/dev/sda1 - your partition. you can use "sudo fdisk -l" to check yourpartitions
/media/win_drive - directory used to mount the partition
ntfs-3g type of filesystem
user - one of the many options used to mount. This one means anyone can mount it.
0 - is used by dump (a backup utility) to decide if a filesystem should be backed up. If zero then dump will ignore that filesystem.
0 - is used by fsck (the filesystem check utility) to determine the order in which filesystems should be checked.
If zero then fsck won't check the filesystem.

Use nano or vim to edit /etc/fstab

emi_ramo 07-14-2008 06:07 AM

Sorry, I missunderstood. I thought screwdriver wanted to access it via network from another machine on XP.

student04 07-14-2008 07:23 AM

Quote:

Originally Posted by screwdriver (Post 3213750)
i have two hard drives in my computer. one is sata hard drive and another one is IDE. i have installed the windows XP in the sata hard drive and the redhat linux enterprise 5 in the IDE hard drive. my SATA hard drive is in NTFS format. now i want to mount my windows hard drive in linux. how can i do it?

To mount the device:
Code:

# mkdir /mnt/windows
# mount -t ntfs /dev/sda1 /mnt/windows

To UNmount the device:
Code:

# umount /mnt/windows
I suppose I would check out that ntfs-3g driver, too...

emi_ramo 07-14-2008 07:34 AM

ntfs-3g is must for NTFS. ntfs is simply obsolete and dangerous. You'll be able only to read carefully, and not always. Just install ntfs-3g and confirm that :)

screwdriver 07-14-2008 07:45 AM

student04,

i tried your solution.but it said "unknown file system type ntfs". don't know what to do ...waiting for your reply

emi_ramo 07-14-2008 07:54 AM

Quote:

i tried your solution.but it said "unknown file system type ntfs". don't know what to do ...waiting for your reply
it should be
Code:

mount -t ntfs-3g /dev/your_partition_name /path/to/free/dir
where your_partition_name should be something as sda1 and /path/to/free/dir /media/windows. But you need to install ntfs-3g. To do so... ¿which distro are you using (debian,redhat,suse,etc.)?

screwdriver 07-14-2008 08:02 AM

well i am using the red hat Linux enterprise 5. will u also give me the solution to mount the drive if the drive is in fat32 format?

emi_ramo 07-14-2008 08:15 AM

fat32 is much easier:
Code:

mount -t vfat /dev/your_partition_device /path/to/mount
where your_partition_name should be something as sda1 and /path/to/free/dir is an existing directory, such as /media/windows .

I don't use Redhat, so I don't know at all how is named the package manager (yum?). But if you know it, you'll probably fast find out ntfs-3g and easily install it.

emi

student04 07-14-2008 08:26 AM

Quote:

Originally Posted by emi_ramo (Post 3213880)
ntfs-3g is must for NTFS. ntfs is simply obsolete and dangerous. You'll be able only to read carefully, and not always. Just install ntfs-3g and confirm that :)

I've always only had the desire to read from my NTFS partitions (too nervous to write to them). You're saying this is safer for reading, too?

Quote:

Originally Posted by screwdriver (Post 3213895)
student04,

i tried your solution.but it said "unknown file system type ntfs". don't know what to do ...waiting for your reply

Try my above but substitute "ntfs" with "ntfs-3g". If that does not work you must install it with the package manager included with RedHat (as everyone is hinting towards).

Assuming you already made the directory /mnt/windows:
Code:

# mount -t ntfs-3g /dev/sda1 /mnt/windows
Check out the bottom part of NTFS-3G's homepage at http://www.ntfs-3g.org/, section "Usage".

I don't remember the syntax for installing package with the command line, but try:
Code:

# yum install ntfs-3g
Otherwise look through your menus to find the package manager, and search for this. Then try the mounting command again.

-AM

screwdriver 07-14-2008 08:30 AM

emi,
now it says mount point media/windows does not exists.

student04 07-14-2008 08:44 AM

Quote:

Originally Posted by screwdriver (Post 3213933)
emi,
now it says mount point media/windows does not exists.

So create it. The mount point is a directory on your system somewhere. 'mount' cannot mount to a non-existent directory.

emi_ramo 07-14-2008 08:45 AM

Quote:

now it says mount point media/windows does not exists.
Well, this directory must exist. You can create it (being root) with
Code:

mkdir -p /media/windows
After that, probably you'll want to have your partition always mounted when switching on your linux machine. And probably you'll want to have access (read and write) to the partition for your users, not only root. Right? Well, youll need to add this line to /etc/fstab :

Code:

/dev/sda1 /media/windows ntfs-3g users,auto    0  0
You can add this with your preferred editor or just executing:

Code:

echo "/dev/sda1  /media/windows  ntfs-3g  users,auto  0 0" >> /etc/fstab
Beware: if you put only one >, then you'll overwrite existing info.

emi

jiml8 07-14-2008 11:44 AM

/media is usually used for removable drives and media. I wouldn't put a mountpoint for a hard drive partition there, unless the HD was a USB drive. It doesn't matter that much, of course, because in *nix you can mount anything anywhere, but putting it in /media leaves the possibility of a name collision with udev.

Just put the mountpont in /mnt.

shridhar005 07-14-2008 01:11 PM

Try
Quote:

login as root
man mount
This will help .

John VV 07-14-2008 11:23 PM

i would go with emi_ramo BUT DO NOT USE /media
use /mnt/windows
my fedora setup is a dual boot with xp
first run ( depending on your os ( fedora redhat ..)
Code:

~]$ su -
~]# yum install ntfs-3g

then
~]# mkdir /mnt/windows
--if windows is on the first drive
to find out run
~]# su -
~]# fdisk -l
--
windows should be sda1
~]# gedit /etc/fstab
----
and add
/dev/sda1 /mnt/windows ntfs-3g defaults 0 0
to the end and add one empty line , just hit enter to do this and save
reboot
you will need to be root to save to /mnt/windows C:\\
also DO NOT use fat32 it is from 1996 windows 95-2b
and is hopelessly outdated

linuxlover.chaitanya 07-15-2008 12:29 AM

I would not want to give write permissions to users though for security reasons.
Those users wanting to write to the partition can su and then write instead. This could be safer than giving the users the permissions.


All times are GMT -5. The time now is 08:09 AM.