SDB:Access your Windows files
tagline: From openSUSE
|Tested on openSUSE||Recommended articles||Related articles|
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. It is because Windows and Linux have different (mainly security) mechanisms. So each of these operating systems cannot support the other's file system fully.
In openSUSE, installation will detect an installation of Windows and will set up to mount Windows' partition(s) if installed. But for a point of safety, you should use a separate partition for your exchange data to prevent both your Linux and Windows system data from being modified accidentally. The question is which file system you should 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. For NTFS partition, you can use ntfs-3g package in openSUSE. For ext2 partition, you can use some tools, like Explore2fs, Ext2 IFS, Ext2Fsd or Ext2Read. But please note, there are some functional differences between these ext2 tools. For example, LVM2 support, ability of copying files/folders recursively, portability or ext4 support are different respectively.
How to prepare a partition for exchanging data
If your machine does not have a partition for exchanging data, you should do following procedure.
Shrinking existing paritions
If your machine does not have a free space in partition table, you should shrink existing partitons before creating of new partition. If you have it, skip this section and proceed to #Create/Format a new partition.
For shrinking Linux (ext2/ext3/ext4 etc.) partition, you can use the openSUSE rescue media provided at openSUSE download page. Rescue media can be booted from itself just like as installation media. After booting from rescue media, select "openSUSE" menu (at bottom-left) -> "system" -> "GParted". In GParted window, click the partiton which you want to shrink, select "Partition" menu -> "Resize/Move". In "Resize/Move" window, increase the "Free space following" value. This size will be a free space. If you cannot increase it, it indicates that your partition is fully used. Try to remove unnecessary files using file manager ("openSUSE" menu -> "system" -> "Thunar file manager") and try again. After increasing "Free space following" value, click "Resize/Move" and "Apply". After shrinking, you can reboot openSUSE again.
For shrinking Windows (FAT/NTFS etc.) partition, you can do this from Windows itself. Please see Microsoft Technet article for example.
Create/Format a new partition
New partition can be created by YaST (for Linux file system) or by Windows tool (for Windows file system). After starting YaST, select "system" -> "partitioner" and follow instructions.
Don't use a primary partition if you want to format this partition as FAT32 or Windows can be confused. Use a logical partition inside your extended partition instead (e.g. /dev/sda5).
As you can severly damage your system, think twice, if you really want to mount your Windows system partition /dev/sda1! Create a second mount point (e.g. /windows/system) in this case. I strongly recommend to only mount your exchange partition (/dev/sda5 in our example).
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" 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.