How to Access Windows Files in Ubuntu

One of the biggest difficulties migrating to Ubuntu is losing access to your windows files. Fortunately, it is not too difficult to overcome this...but read the warnings before trying this out. All that is needed is to mount the windows partition after you boot into Ubuntu. Of course, the first problem is determining which partition contains the windows files.

[edit] Steps

  1. Install gparted (System → Administration → Synaptics Package Manager → search for gparted, mark it for installation and, when it installs, run it from System → Partition Editor). Look for an NTFS partition – it is likely to be the one windows is on.
  2. Having located the partition, write down the name – it will look something like /dev/hda2. Do this carefully – this is no time for dyslexia. Now check to see if this is the partition by manually mounting it and looking at the files.
  3. Open a terminal (Application → Accessories → Terminal) and make yourself root by typing sudo -s and pressing enter. You will be prompted for the root password and will then become root. Being root assumes that you know what you are doing – you could easily cause disaster if you make a mistake, so concentrate. Carefully type this line at the prompt and press enter
mkdir /mnt/windows

  1. You may replace /mnt/windows with /mnt/windrv or any other name you prefer. Now, having created the directory that is going to hold your windows files, type the following command carefully at the prompt and press enter
mount -t ntfs /dev/sda2 /mnt/windows -o "umask=022"

  1. Make sure you replace /dev/sda2 with the name of the windows partition you wrote down. Now access the mounted drive and ensure that you can read the files by going to Places → Computer and navigating to /mnt/windows. If you can see your files, you are all set. If not, you've mounted the wrong drive, unmount it using umount /dev/sda2, making sure that you use the correct name for your drive.


[edit] Tips

  • Now, you will probably want to have the computer boot up and automatically mount the windows drive so you can save files back and forth seamlessly. This is easily achieved via a script that loads at startup. The commands in the script will have to be run with root permissions, so you will have to save the file in /etc/init.d. You are going to use the same command you used manually. Most of the other lines in the script are comments.
  • Start a text editor as root by typing gedit /etc/init.d/mountwinfs.sh. Copy the lines below into the text editor and save it as /etc/init.d/mountwinfs.sh.
!/bin/bash
BEGIN INIT INFO
Provides:          mountwinfs
Required-Start:    $local_fs
Required-Stop:
Default-Start:     S
Default-Stop:
Short-Description: Mount the windows file system
Description:       Mount the windows file system

END INIT INFO
mount -t ntfs /dev/sda2 /mnt/windows -o “umask=022″

  • Do not forget to replace /dev/sda2 with the name of the windows partition you wrote down. Also, don't forget to replace /mnt/windows with whatever you decided to call the directory. Save the file.
  • The file will be owned by root. You need to set permissions for the file, so it can be executed as follows.
chmod +x mountwinfs.sh

  • Now you need to convince Ubuntu to run this file at startup. This is done using the command below.
update-rc.d mountwinfs.sh defaults

  • This command will create links to start the script at runlevels 2, 3, 4, 5 and links to stop it at runlevels 0, 1, 6 (halt, single user and reboot runlevels)
  • Now to test what you have done...close all windows and restart the computer. Open the file browser (Places → Computer), navigate to /mnt/windows and make sure you can see your files.
  • Your final task is to make a link to /mnt/windows on your desktop. Doing this through your file manager is not easy, since you are not root and you only "own" files at your home directory and below. As before, open up your terminal (Application → Accessories → Terminal) and make yourself root by typing sudo -s and pressing enter. You will be prompted for the root password and will then become root. Enter the following command to create the link to your folder.
ln -s /mnt/windows ~/Desktop

  • You should now have ready access to your windows files every time you log in.


[edit] Warnings

  • Always back your important files up before making changes to your system.
  • Always verify your backup before trusting it.
  • Leave yourself plenty of time to recover - never do this before a deadline.


Embed this: Republish this entire article on your blog or website.

Was this article accurate? Yes No

Edit This Page E-mail this to a Friend Printable version
Discuss This Page Thank the Authors Write an Article
Categories:Operating Systems

Authors

John Kummailil, Anonymous, BR, RMunsonNJ
Thanks to all authors for creating a page that has been read 636 times.

Related wikiHows

Hide These Ads - Why?


Hide These Ads - Why?
Show Ads

Navigation

Editing Tools

My Pages