Posted 31.05.2004 | Updated 23.05.2006 | Contributed by Andy Mallett
There comes a time in every Linux convert's career when the mounting of MS Windows partitions becomes a necessity. Perhaps some data needs to be transferred, or perhaps it's simply the challenge of just being able to do it.
A knowledge of file systems, both Linux and Microsoft, would be an advantage here and the reader is directed to PC Operations | Disk Preparation for some excellent background info on Windows file systems.
In the following scenario, I took a box running Red Hat Linux 9.0 and added a second hard disk, which contained Windows 98 on a FAT32 primary partition and a FAT32 logical drive in the extended partition.
|
|
I needed to access some files on the LD of Disk #2 so I whacked it into the spare drive cradle and fired up Linux.
As illustrated above, Windows uses drive letters to identify primary partitions and logical drives, whereas Linux uses numbers. Linux also uses two extra partitions, one for booting and the other for swapping stuff in and out of memory. Windows uses files on the primary partition for these same purpose. The boot and swap partitions in Linux are generally invisible to the user during normal use, as is the extended partition under Windows.
So we know that Linux will identify the physical Windows partitions as /dev/hdc1 and /dev/hdc5. However these drives must be mounted under Linux before they can be used. Mounting allocates a Linux directory to each Windows drive, usually in the /mnt directory of the Linux file system.
To confirm the Linux letter allocations to the various physical drives and partitions, log on as root and type:
fdisk -l (small L)
A lot of Linux distributions claim not to support the FAT32 file system, although I have found that mounting FAT32 drives as VFAT or FAT seems to work fine. Firstly create a directory inside /mnt, one for each partition to be mounted.
I created the directory /mnt/ddrive
Finally the mount command. Type the following to map the Windows logical drive (D:) to the above directory:
mount -t fat /dev/hdc5 /mnt/ddrive
And there you go. After mounting, files are transferred to and from the Windows partitions via their mounted directories.
Why does Linux jump to hda5? Well hd1, hd2, hd3 and hd4 are reserved for the potential maximum of four Windows Primary partitions..
Want to mount Windows NTFS partitions? Here's the lowdown..
|
|