This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Mounting USB storage devices and Windows partitions

By Rickford Grant on April 22, 2004 (8:00:00 AM)

Share    Print    Comments   

Nowadays, tiny portable storage devices that go by names such as PenDrive, JumpDrive, ClipDrive, DiskOnKey, and so on, have become quite popular. Because of their small size, these "flash drives" are very handy when you have to transfer fairly large, but not gigantic, amounts of data from computer to computer (from work to home, for example). They come in a variety of sizes from 16MB to 2GB and are becoming less and less expensive (especially in the 16MB to 256MB bracket).

If you are a dual booter, meaning that you have both Windows and Linux installed on your hard disk, you may want to transfer files back and forth between your Windows and Linux partitions or disks. This is useful, for example, if you want to copy some of your Windows fonts to your Linux system. To do this, you have to mount your Windows partition or drive. The process of setting up your system so that you can easily mount your Windows partition or drive is essentially the same as the one you learned for mounting USB drives.

Locating your Windows partition or drive

Just as with USB storage devices, the first thing you have to do is locate your Windows drive or partition with the Hardware Browser. Go to your Main menu and select System Tools > Hardware Browser, and then type your root password when requested to do so. Once the Hardware Browser opens up, click Hard Drives in the left panel.

Next, look for your Windows partition, which will most likely be hda1. Check under the Type column to see what the file system format is for the partition. If it is fat16 or fat32, you will have no problem. If, however, it is ntfs (which is the default file system for Windows NT, 2000, and XP) you are out of luck and will have to forgo this process, as Linux doesn't let you, as of yet, mount NTFS partitions -- and not without good reason. Linux kernel support for NTFS is still buggy, thus endangering the integrity of such partitions or drives. [Editor's note: This is not strictly true -- see the Linux-NTFS Project and Paragon NTFS for Linux.]

If you have a FAT16 or FAT32 partition, jot down the information for that partition -- for example, /dev/hda1 fat32. Once you've done that, you can go on to edit the fstab file.

Open a Terminal window, become root, and then type gedit /etc/fstab and press Enter. When the fstab file opens in Gedit, add a new entry to the bottom of the list by typing:

/dev/hda1 /mnt/windows vfat defaults,users,noauto 0 0

Of course, if your device location is different, change the entry accordingly. You might also want to change noauto to auto. If you do this, a desktop icon for your Windows partition or drive will appear each time you log in, thus eliminating the mount step each time you start your machine. When all is as you want it, click the Save button, and quit Gedit.

Now create the mountpoint that you listed in your fstab entry. Go back to your Terminal, which should still be in root mode, type mkdir /mnt/windows and press Enter.

You can mount your Windows partition or drive in essentially the same manner as was described for USB storage devices. Right-click anywhere on your desktop, and then, in the pop-up menu, select Disks > windows. A desktop icon for your Windows partition or drive will then appear.

Double-clicking your Windows partition desktop icon will open a Nautilus window. You can then drag files to and from the Windows partition. If you changed noauto to auto in your Windows partition fstab entry, you won't have to do anything the next time you start up your machine, as your Windows partition will be mounted automatically on startup, and the Windows partition desktop icon will appear automatically.

Unmounting your Windows partition or disk is done in the same manner as unmounting USB storage devices. Close any open Nautilus windows for the partition, and then right-click the desktop icon for the Windows partition or drive and select Unmount Volume from the pop-up menu.

 

Share    Print    Comments   

Comments

on Mounting USB storage devices and Windows partitions

There are no comments attached to this item.

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya