How To Access Windows Drives From Linux?
This one's a quick how-to about mounting Windows drives from Linux(Fedora 7).
From the Fdisk manual pages:
"Hard disks can be divided into one or more logical disks called partitions. This division is described in the partition table found in sector 0 of the disk. There may be reasons of security, ease of administration and backup, or testing, to use more than the minimum number of partitions".
You would have seen C Drive, D Drive, E Drive, etc on Windows. They are also known as logical disks and partitions. Users wanting to migrate to Linux often install dual operating systems on their desktop computers. Many of you would have installed both Windows and Fedora GNU/Linux on your computers. When you boot Windows you don't see the Linux drives and when you boot Linux you don't see Windows drives.
You can access the Windows drives from Linux using fdisk and mount commands. The procedure to set this up is very easy on Fedora 7. I did it in only two steps.
The fdisk manual page says, "fdisk (in the first form of invocation) is a menu driven program for creation and manipulation of partition tables. It understands DOS type partition tables and BSD or SUN type disklabels". Let's use the intelligence of fdisk.
Step 1: Type the below command in the Terminal as root
fdisk -lEdit: It is the letter 'L' in lowercase. Some users thought it was 1(numeric one). There is a space between fdisk and -l.
You will see tabular data like below.

We only want information from Device and System columns. In the first row, we see a device /dev/sda1 with the file system HPFS/NTFS. This is the Windows XP C drive. Let's access this drive using the mount command. The mount command helps us to attach the Windows C Drive to any directory on the Linux file system.
Step 2:
mount /dev/sda1 /mntThis will attach the Windows C drive to the /mnt directory. Now you can see the files and folders in your Windows C Drive at /mnt. You can add an entry in your fstab file to mount the Windows directory every time you boot Linux.









cant delete or edit the files inside windows partition
i am using the fedora core 7... i have enabled the permanent booting by editing using the gedit as u said.. but when i tried to edit or delete the files in the windows partition i m unable to do so also i m unable to cut copy paste inside the windows drives.. please do help.....
Did you perform the steps
Did you perform the steps what you did before? Let's see what happened this time.
Can you paste the output of fdisk -l?
Just for brevity, did you mean permanent mounting when you said "i have enabled the permanent booting by editing using the gedit"? Are you able to see the mounted Windows drives from Linux?
With warm regards,
Sudheer
in my /etc/fstab i ve pasted
in my /etc/fstab i ve pasted like this only.. should i modify anything in this...
/dev/sda1 /mnt/cdrive ntfs-3g ro,defaults,umask=0222 0 0
/dev/sda5 /mnt/edrive ntfs-3g ro,defaults,umask=0222 0 0
ro makes it read only.
ro makes it read only. Replace those lines in your /etc/fstab with
/dev/sda1 /mnt/cdrive ntfs-3g defaults,umask=0222 0 0/dev/sda5 /mnt/edrive ntfs-3g defaults,umask=0222 0 0
Once done umount and remount the drives and see if you have write access to the NTFS drives.
umount /mnt/cdriveumount /mnt/edrive
mount /mnt/cdrive
mount /mnt/edrive
With warm regards,
Sudheer
even after i perform this process am unable to perform t
this is the etc/fstab file.. i m unable to perform th write operation in any drives.........
LABEL=/1 / ext3 defaults 1 1
LABEL=/home /home ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda9 swap swap defaults 0 0
/dev/sda1 /mnt/cdrive ntfs-3g defaults,umask=0222 0 0
/dev/sda5 /mnt/ddrive ntfs-3g defaults,umask=0222 0 0
/dev/sda6 /mnt/edrive ntfs-3g defaults,umask=0222 0 0
Try GUI and rw mode
ntfs-3g has a graphical interface where you can toggle the read and write modes. Check with it once. Another thing you can try is to add rw in your /etc/fstab.
Example:
/dev/sda1 /mnt/cdrive ntfs-3g rw,defaults,umask=0222 0 0I haven't tested this before. I'm interested to see the outcome.
With warm regards,
Sudheer
Re: Try GUI and rw mode
i ve tried the command that u gave in fstab but i ve not got the needful
then i restarted the machine. even after that i m unable to do the write operation.. and wat is that GUI of ntfs 3g. how to go for it???? please to help me....
Try This
Try adding this entry into your fstab
/dev/sda1 /mnt/cdrive ntfs-3g rw,nosuid,nodev,allow_other,umask=0000 0 0
then issue command:
umount /dev/sda1
Then the following:
mount -a
Note: option rw indicates that the mount is read/write capable, but umask=0222 sets the permissions on the mount to read and execute for user,group,all. This means you will need to change file permissions in order to write to the drive. umask=0000 should make the mount read,write,execute by user,group,all
For instance, I mounted an external harddrive using the ntfs filesystem. The following is using umask=0222
root@Vocom ~]# mount -t ntfs-3g /dev/sdc5 /media/test -o rw,noexec,nosuid,nodev,allow_other,umask=0222
[root@Vocom ~]# ls -la /media
total 28
dr-xr-xr-x 1 root root 4096 2008-04-08 18:34 test
See the dr-xr-xr-x?
Following is using umask=0000:
[root@Vocom ~]# mount -t ntfs-3g /dev/sdc5 /media/test -o rw,noexec,nosuid,nodev,allow_other,umask=0000
[root@Vocom ~]# ls -la /media
total 28
drwxrwxrwx 1 root root 4096 2008-04-08 18:34 test
now it is drwxrwxrwx.
Also, I find using fstab for testing to be cumbersome. I recommend you iron out the mounting method you are going to use by umount and mount commands, then when you have it mounted how you like, add the line to fstab
One other thing. If you wish for more security, replace the noexec,nosuid,nodev options with uid=. Replace user with your current user name. Then use umask=0077. This will lock out group and other access, allowing only your username to access the mount.
"man mount" could shed some light on other mounting methods.
You have to either umount
You have to either umount and mount your NTFS drive after changing the entry in /etc/fstab or restart your computer. Make sure you are doing either of it after saving changes to your /etc/fstab.
Also check this comment to see how to access the NTFS GUI configuration tool.
http://lampcomputing.com/node/39#comment-66
With warm regards,
Sudheer
i ve performed all the steps
i ve performed all the steps as u said.. and the windows drive is mounted properly each and every time i boot in... the problem is that i am only able to enjoy its contents and not to modify it.. for example, there is a movie file.. i m able to view the movie.. copy that movie file and able to put it to my linux drive.. but i m not allowed to either to delete or rename or cut it....
this is the output of fdisk -l...
[root@localhost ~]# fdisk -l
Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 653 5245191 7 HPFS/NTFS
/dev/sda2 654 4865 33832890 f W95 Ext'd (LBA)
/dev/sda5 654 2124 11815776 7 HPFS/NTFS
/dev/sda6 2125 2222 787153+ 83 Linux
/dev/sda7 2223 3000 6249253+ 83 Linux
/dev/sda8 3001 3131 1052226 82 Linux swap / Solaris
/dev/sda9 3132 4865 13928323+ 83 Linux
Disk /dev/sdb: 2048 MB, 2048901120 bytes
64 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 992 1999749+ b W95 FAT32
[root@localhost ~]#
please guide me...
getting error
[root@localhost ~]# gedit /etc/fstab
-bash: gedit: command not found
wat should i do 2 mount the drives permanently..
i m a fedora core 7 user
You haven't installed gedit.
You haven't installed gedit. Use the below command it install gedit:
yum install geditAnd then append the mount point and drive information to it.
An example configuration looks like:
/dev/sda2 /mnt/windows ntfs defaults,nls=utf8,umask=007,gid=46 0 1Where /dev/sda2 is your Windows NTFS drive, /mnt/windows is the mount point.
With warm regards,
Sudheer
Re: You haven't installed g edit
hi sudheer, as u said i ve installed gedit and performed the operations u said.. it really worked..
Thanks 4 ur support... Expecting same support for all the requests from me in future....
Hi Senthil, I am glad I
Hi Senthil,
I am glad I could help.
With warm regards,
Sudheer
How can i acess linux drives in windows
Hi Sudheer,
I want to acess linux files in windows.what should i have to do?
i am using windows 2000 and fedora 4 please let me know how can i do this
Hi Samir,If you running
Hi Samir,
If you are running Windows and Linux on different computers, run Samba on Linux to share files across the network. If you have a dual boot, the question can be better answered by Windows experts. If that is the case, you will probably need a software to read ext2/ext3 file systems from Windows.
On another note, Fedora Core 4 is too old. Upgrade to Fedora 8 immediately. I guess your Windows is also quite old.
With warm regards,
Sudheer
Workaround
There is a workaround you can try. First install Windows. Then install Linux. Mount your Windows drive on Linux. Whether you boot Windows or Linux save your files to this shared drive. This way you will be able to access your files from both Linux and Windows on a dual boot system.
Hi, When i ran the fdisk
Hi,
When i ran the fdisk command i can see the drives, but when i mount sda i see the errors below .
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3892 31262458+ 7 HPFS/NTFS
/dev/sda2 3893 8193 34547782+ 7 HPFS/NTFS
[root@localhost /]# mount /dev/sda1 /mnt/win
mount: fs type ntfs not supported by kernel
[root@localhost /]# mount /dev/sda2 /mnt/win
mount: fs type ntfs not supported by kernel
Please help me out
Thanks
You will need to install the
You will need to install the ntfs kernel module. Try the below steps:
yum install kmod-ntfs -yRestart the computer
Try to mount the drive again
Let us know what happens.
With warm regards,
Sudheer
about fedora
i want to access window drives from fedora7 how can i?please reply soon.
Re: about fedora
I recommend you to actually read the article and comments below. There is enough information already published which helps you to access Windows drives from Fedora 7. If you have any specific questions for which you are unable to find answers to, feel free to comment. Somebody who knows the answer will hopefully reply soon.
Cheers
mounting drives
when i write #mount /dev/sda1/mnt/
it give me error that no /dev/sda1/mnt/ found.
so plz help me
Re: mounting drives
There is a space between /dev/sda1 and /mnt
Mr. sudheer recently I have
Mr. sudheer recently I have installed fedora core 6 in my laptop which has windows xp. now i want to mount my drive in windows through fedora. I tried two steps that were used by in your earlier blogs but somehow i don't know why they are not working me. i used the following two steps:
step1: # fdisk _l
step2: # mount/dev/sda1 /mnt
after pressing enter key in step 2 it says there is no directory like /dev/sda1.
plz note i have placed a space between /sda1 and/mnt. still its not working. plz help me.
Re: Mr. sudheer recently I have
Hey Ankit,
Step 1 is: fdisk -l
[fdisk space dash letter L in lower case]
fdisk -l prints the list of devices. In your computer the Windows drive may be other than /dev/sda1. Please go ahead and type fdisk -l and paste the output here.
Also, I strongly recommend you to upgrade to Fedora 8. Fedora 6 is now obsolete. You may also try to mount the NTFS drives from GUI as suggested by meagnostic. And hey, you don't have to call me Mr. Sudheer. Sudheer is just fine.
With warm regards,
Sudheer
hi sudheer i tried the above
hi sudheer i tried the above two steps. when typed fdisk -l it showed all the drives but when i typed the second command it mount/dev/sda1/mnt it says there is no no such directory or file.I tried it fedora core 6.
There is a small mistake in the mount command
Hi Ankit,
Everything you have doing is right, but there is a small change in the mount command. You have to give a space after mount and another space after /dev/sda1. Please do check out. The command should look like this, mount /dev/sda1 /mnt
how to mount 2 drives
1.I want to mount 2 drives that is both C & E drives
2. I had mounted the /dev/sda1 on /mnt
3.where should I mount the /dev/sda2 second drive on
AND
4.Can I see linux files from windows also !!!!!!!!!!
Thanks for your advice Mr.Sudheer
Re: how to mount 2 drives
Create another directory in /mnt
#mkdir /mnt/drive2
Mount the second drive to /mnt/drive2
#mount /dev/sda2 /mnt/drive2
This will enable you to see files stored on the Windows drive when you boot Linux but not vice versa. If you want to access files stored on Linux drives when you boot Windows, you have to look for a Windows application that does it.
fdisk problem for fedora7
as i am new user for linux...i think this site will help me a lot for linux.....
now while i read this page and try to do following have error....what is wrong here....
[root@localhost asif]# fdisk -l
bash: fdisk: command not found
[root@localhost asif]#
Re: fdisk problem for fedora7
I think you have used 'su' instead of 'su -'.
If you are logged in as user type
1. $su - and hit enter
2. Enter root password and hit enter
3. #fdisk
Here is what I did to test fdisk on my computer.
[snip]
[sudheer@localhost ~]$ fdisk -l
bash: fdisk: command not found
[sudheer@localhost ~]$ su
Password:
[root@localhost sudheer]# fdisk
bash: fdisk: command not found
[root@localhost sudheer]# su -
[root@localhost ~]# fdisk
Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
[root@localhost ~]#
[/snip]
mounting FAT 32 drives
How do I mount FAT 32 drives so that any user can edit their contents?
mount -tvfat /dev/sda1 /mnt
mount -tvfat /dev/sda1 /mnt
Re: mounting FAT 32 drives
The same way as you mount NTFS drives.
#mount /dev/sda1 /mnt
Where /dev/sda1 is your FAT32 drive and /mnt is the mount point. Your users can access /mnt to read from and write to the drive.
Accesing NTFS drives permanently
Sudheer,
I used the commands you´ve mentioned, but after reboot NTFS partition get unmount. Kindly tell me how to access the drives permanently.
Even after reboot these drives should present.
Re: Accesing NTFS drives permanently
Hi,
You have to edit the /etc/fstab file and add the entries to mount the Windows drives at startup.
On the terminal type the below
Step 1: $su -
Enter the root password
Step 2: # gedit /etc/fstab
Step 3: Add these lines to the end of the file
/dev/sda1 /mnt/cdrive ntfs-3g ro,defaults,umask=0222 0 0
Where /dev/sda1 is your device name and /mnt/drive is your mount point.
Step 4: Save the file and restart the computer
Let me know if this helps.
Dear Sudheer I´ve done
Dear Sudheer
I´ve done that, but after reboot I am getting error at startup ¨Local File system Mounting - Failed¨ & mounting Other File system - Failed
Re: Dear Sudheer I´ve done
Sorry about it.
Please make sure you have ntfs-3g installed.
# yum install ntfs-3g
Once done restart your computer and see if it works. If you still receive the error message, replace the older addition in /etc/fstab with
/dev/sda1 /mnt ntfs-3g defaults,locale=en_US.UTF-8,ro 0 0
Also try Sriram's suggestion posted at http://lampcomputing.com/node/39#comment-66
Let me know what happens.
I´ve installed ntfs-3g &
I´ve installed ntfs-3g & edited Fstab file Still the error is same while booting it says ¨local filesystem mounting - failed¨
Every time I need to manually mount the partitions
Re: I´ve installed ntfs-3g &
What do you see when you type #fdisk -l?
Remove the line you added to /etc/fstab and try the alternate solution posted at http://lampcomputing.com/node/39#comment-66
linux
1.how can i access windows drives on linux suse operation system
as u given i have tried
#mount /dev/sda1 /mnt
but its not working
2.Can i access windows installation files on linux
Re: linux
1. You have to first find out the device name for your NTFS/FAT partition. #fdisk -l prints all the device names and corresponding file systems. In the example above /dev/sda1 is the device name with HTPS/NTFS file system. When you mount /dev/sda1 to /mnt your Windows drive will be accessible at /mnt.
What is the message you receive when you type #mount /dev/sda1 /mnt?
If your windows drive is of NTFS partition you may need an additional package - fuse. Make sure fuse is installed on your computer.
2. What exactly do you mean by Windows installation files? When you mount the Windows partition, you can access all the files and directories in that drive.
Re: Windows drives on Fedora
[snip]
Hey sudheer !!
I have tried commands ,which u have suggested on the both posts of urs .
When i start with Fdisk or Fdisk-1 i get the message " unknown command "
" Life is all about learning and unlearning things.For all that learing never ends ,but life does end "
[/snip]
Shekar,
You have to use the fdisk command as root.
1. Open the Terminal
2. Type: su -
3. Enter root password
3. Type: fdisk -l
When you type su - the system will prompt you to type the root password. Only root can execute the fddisk command. Also, note that all the alphabets in "fdisk" are in lowercase.
Re:
There is an easier way to access windows file systems on Linux Fedora 7.
Go to add / remove software.
Seach for NTFS, install ntfs-3g and related dependencies.
the version (ntfs-3g-1.913-2.fc7.rpm)
Once you have completed the installation go to, main menu -> system tools -> NTFS configuration tool.
Add the relevant NTFS partition ( ex. /dev/sda2 ) and also click the write permission, in case if you feel you will not only access files on windows partition but also, make changes to the same.
This is another way to enable NTFS partition only, and does not apply for FAT32 file systems. If you have other versions of windows file systems other than NTFS, then you have to follow the process as sudheer had suggested.
ntfs-config
For the sake of completeness of the help document.
Open the terminal and type:
#yum install ntfs-config -yAlternatively,
1. Click Applications2. Click Add/Remove Software
3. Enter your root password and click OK
4. Click Search tab
5. Type ntfs-config in the search bar and click Search
6. Put a check mark next to ntfs-config-*. The version number varies for Fedora Core 6 and Fedora 7.
7. Click Apply
8. Follow the on screen instructions to complete the installation
9. Once you install ntfs-config navigate to Applications>System Tools>NTFS Configuration Tool
10. Click Advanced Configuration. Select Writable if you want write access to NTFS drive. Click Close. If you choose write access to NTFS dirve, you will be able to create new files and directories, edit existing files and directories and delete them on your NTFS drive.
ntfs-configuration will set up the /etc/fstab file for you. Go, have a beer.
Dear Sudheer, I m also
Dear Sudheer,
I m also getting same error. I have done exactly what you have mentioned here.
Re: Dear Sudheer, I m also
What is the exact text of the error message? Do you have a dual boot set-up on your computer?
Shekar,
Any updates?
Mounting windows drives accessible to Linux
Yes .
I have a dual boot in place , the screen is off course from fedora. This screen is evoked when i hit ESC button while the system is booting .
" Life is all about learning and unlearning things.For all that learing never ends ,but life does end "
Re: Mounting windows drives accessible to Linux
It seems you are stuck with step 1. Click Applications, Accessories, Terminal. You will see something like this on the screen:
[sudheer@localhost ~]$
Type su - and hit enter. Enter the root password.
On my screen it appears like this:
[sudheer@localhost ~]$ su -
Password:
[root@localhost ~]#
Notice the prompt changing to # from $. If you see # on the prompt, you are the root and have access to all commands. When you see $, you are a regular user and you don't have access to administrative commands.
Type: fdisk -l
Please note it is letter 'l', rhymes with yell. All the alphabets are in lowercase. Continue with the steps from the article. Let me know what happens.
Mounting windows drives accessible to Linux
Sure ,
But how do i reset the root password.
Because during the installation i don't remember if it asked for one .
" Life is all about learning and unlearning things.For all that learing never ends ,but life does end "
Post new comment