Access Your Windows Files

From openSUSE


Contents

Background

On a dual boot system with Windows, you often need to exchange data between the systems. Up to this moment, there is no perfect solution. The problem is, Windows and Linux use different file systems and on both systems the support for the other ones are not fully working. In addition the system for granting users access to the files are different between Windows and Linux.

In general, you should use a separate partition for your exchange data to protect both your Linux and Windows system data from being modified accidentally. The question is which file system you want to use for this partition.

The only file system, which is fully supported in both worlds, is FAT32 (FAT12 and FAT16 are also supported, but outdated). FAT32 is lacking any support for restricting user access rights and is limited to files smaller than 4GB. If you can live with this, a separate partition with FAT32 is the best solution for exchanging data.

If you need to use files bigger than 4GB (e.g. DVD images) you can either use ext2 or NTFS as file system of your exchange partition. Then you can use the captive NTFS driver with Linux to use an NTFS partition you created within Windows or use Explore2fs or Ext2 IFS from within Windows to access an ext2-partition you created with Linux. Google will reveal more projects with the same purpose.

A completely different approach would be to use the commercial VMware, which also allows to exchange data between host and guest operating system.

Normal Installation

You should backup your data first, especially if you have to resize any partitions during this process!

Free Space on Your Disk

After SUSE takes you to the install list of options that can be changed, you will need to do a custom partitioning. When you get into the partitioning scheme layout screen you will see the hda drive listed and below it, one partition called the hda1. It should say ntfs or fat32 somewhere. That is the one to click on and choose resize below in the buttons. Then you will be able to slide a slider and tell it how much room to make available for SuSE.

Create New Partitions

If you didn't yet create a separate partition from within Windows, just add one now along the new ones for Linux. Call the mount point e.g. /windows/data. If you already installed SUSE, this is still possible via yast2 System-> Partitioning, but much more difficult, as you have to change your partition layout.

Don't use a primary partition for your FAT32 exchange partition or Windows can be confused. Use a logical partition inside your extended partition instead (e.g. /dev/hda5).

As you can severly damage your system, think twice, if you really want to mount your Windows system partition /dev/hda1! Create a second mount point (e.g. /windows/system) in this case. I strongly recommend to only mount your exchange partition (/dev/hda5 in our example).

Mount Options

How the partition is actually mounted within Linux is influenced by the mount options. Select your exchange partition->Edit->Fstab Options and enter them under "Arbitrary option value". This can also be done after installation directly with an editor (your installation settings will be written to the file /etc/fstab) or via yast2 System->Partitioning.

I use the following options:

utf8,codepage=850,dmask=000,fmask=111,shortname=winnt

"utf8" will allow the use of special characters (e.g. umlauts), "codepage" is needed for the character mapping of short DOS names (see the list of code pages), dmask is needed to allow every user to see directory contents, fmask allows every user to read and write files (but not to execute any files residing in the exchange partition), "shortname" cares for the correct upper and lower case conversion of short and long DOS names. See "man mount", "man umask" and "man chmod" for further details.

The resulting /etc/fstab line for my exchange partition looks like this:

/dev/hda5 /windows/data vfat utf8,codepage=850,dmask=000,fmask=111,shortname=winnt 0 0

The columns have the following meaning (see "man fstab" for further details):

"/dev/hda5" is the physical partition. You can just choose it within yast or find it with the command "fdisk -l /dev/hda".

"/windows/data" is the mount point, where you will find your Windows data in the linux file system hierarchy. Yast will create this directory for you, otherwise use "mkdir -p /windows/data".

"vfat" is the file system type to use for a FAT32 partition.

"0 0" tells the system to not check the file system during boot.

Preparing Installation by Hand

If yast fails to free space for Linux and your exchange partition, you can try the following:

It is assumed that Windows was already on the main drive (hda) and lives on the first partition (hda1). Defragment the Windows partition (if it is FAT/FAT32, please do NOT defrag NTFS) and then run chkdsk /f on it and reboot twice into Windows (chkdsk makes two passes, the second one is done invisibly). If you don't then SUSE may not let you proceed to resize that partition. There are no reports of data loss for recent versions of SUSE Linux even if you skip the steps above.

Don't forget to turn off programs that are running in the background in Windows before you start defragging. Also, after defragging is done, pull up a command prompt (the C: prompt in the black square window...check in Program Menu in Accessories and maybe Sytem). Type in: chkdsk /f and it will warn you that it cannot acquire a lock on the drive. Then it asks if you want chkdsk to run the next time the system is restarted. Say yes. Then restart the system. You will see a message screen about chkdsk. DO NOT TYPE ANYTHING!!! DO NOT TOUCH YOUR KEYBOARD or you will have to go through all of it again. :-P

After it has run chkdsk and it goes into Windows, just tell Windows to restart and boot into Windows again. On boot, it will run the second invisible pass of chkdsk. After it has booted completely, tell Windows to restart and have the SUSE cd in the drive ready to install.

External links

Passed QA check: Fsundermeyer 12:29, 15 June 2009 (UTC)