14.10. Accessing a Windows Partition
I have a dual-boot system with Red Hat Enterprise Linux and Windows 98. Is
there a way to access my Windows partition while I am running
Linux?
You can access another partition on your system (for example, a
Windows partition), in two different ways.
You should first determine where your Windows partition is located
by determining what physical hard disk your Windows partition is located
in (such as the primary master IDE drive or the the first SCSI
drive). To find this information, you can use the
Hardware Browser, which lists detailed information
about the hardware in your Red Hat Enterprise Linux system.
To start the Hardware Browser, choose
=> =>
. Figure 14-1 shows
Hardware Browser in action.
Select from the panel and
find your Windows partition from the Disk
Information displayed. Windows partitions normally use the
FAT or FAT32 file system type. This file system type can be mounted and
read within Linux; however, if your Windows partition uses NTFS, then
you cannot mount and read from it as Red Hat Enterprise Linux does not support NTFS
file systems. Note the Device information for your
Windows partition, as this is the device that you mount to access your
Windows data.
Once you have determined where your Windows partition is located
on your hard drive, log in as root (type su and
then enter the root password) at a shell prompt.
Create a directory in which the Windows partition is mounted by
typing the following command. For example:
Before you can access the partition, you must mount it in the
directory you just created. As root, type the following command at a
shell prompt (where /dev/hda1 is the Windows
partition you found via Hardware Browser):
mount -t vfat /dev/hda1 /mnt/windows |
You may then logout of root user mode and access your Windows data
by changing into the mounted Windows partition:
To automatically mount a Windows partition every time you boot
your Red Hat Enterprise Linux system, you must modify the /etc/fstab
file, which configures all file systems and disk device mounting
options.
At a shell prompt,
su - to root, following the above example.
Next, open the /etc/fstab in a text editor by
typing (for example):
Add the following on a new line (replacing
/dev/hda1 with the Windows partition you found via
Hardware Browser):
/dev/hda1 /mnt/windows vfat auto,umask=0 0 0 |
Save the file and exit your text editor.
The next time the system is rebooted, the /etc/fstab
file is read, and the Windows partition is automatically mounted in the directory
/mnt/windows. To access the partition at a shell prompt,
type the command cd
/mnt/windows. To navigate through directories or files
with spaces, surround the name of the directory or file with quotation
marks, as in ls "Program Files".