This brief blog entry will note the steps required to properly mount a local NTFS hard-drive within Ubuntu Linux. NTFS is the more advanced file system, compared to FAT32, in the Windows world. It improves performance and is required in order to implement numerous security and administrative features in NT/XP/2000/20003. In this example, you will be mounting the entire physical drive for read access to your ''primary users''. So let us begin...
First, the entire operation should be and will be preformed using termainal (gnome-terminal preferred.) So--Open up terminal on the target machine (in this example, all operations are preformed via SSH targeting my home machine.) [NOTE; Ignore the "$" and the quotes, as they are to symbolize the prompt & terminal]
$ ssh home
Now we need to locate the actual hard disk to mount. While you may already know the partition size and file type, the location may be unknown. fdisk -l will solve this riddle and display all logical partitions available to the target machine..
$ sudo fdisk -l
The results will look similar to...
Disk /dev/hdf: 120.0 GB, 120000000000 bytes
255 heads, 63 sectors/track, 14589 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/hdf1 2 10535 84614355 f W95 Ext'd (LBA)
/dev/hdf2 * 10536 14589 32563755 83 Linux
/dev/hdf5 2 10359 83200603+ 7 HPFS/NTFS
/dev/hdf6 10360 10535 1413688+ 82 Linux swap / Solaris
Ah-ha! /dev/hd5 is our target. Next, add this ''short-cut'' to your file systems table. The fstab file is commonly found on Unix and Unix-like systems and is part of the system configuration. The fstab file typically lists all used disks and disk partitions, and indicates how they are to be used or otherwise integrated into the overall system's file system.
$ sudo vi /etc/fstab
Here we add the following line to make mounting hdf5 easy peasy. Near the end, insert...
# SELF MADE FOR NTF to NiX
/dev/hdf5 /media/hdf5 ntfs ro,users,noauto,uid=1000,gid=1000 0 0
Now for a little explanation of what this line adds to the file system table. First line is the location you discovered above using fdisk -l (/dev/hdf5.) The second chunk of text is the destination mount folder, and in this case we call it /media/hdf5. The rest are options customize to our machine. NTFS is the file system type, RO is for read-only, USERS allow other then root accounts to mount (without the use of sudo), NOAUTO tells the machine to only mount when called for, and last we have permission settings for my main account (czar).
More on the permissions issue... Without the use of uid and gid, the entire mount folder will be set for root access only (default.) So, we figure only our primary account should access the files, and to find out the numbers simply type...
$ id -u czar
$ id -g czar
OK! So time to quit VIM's insert mode (ESC), write (:w) and then quit (:q).
Then make the destination folder....
$ sudo mkdir /media/hdf5
And last, yet certionally most important, mount the drive w/ your primary account.
$ mount /media/hdf5
$ ls -la /media/hdf5
Also See
- Easy Peasy Ubuntu Linux NFS File Sharing - In this brief blog entry I will note the steps it took for me to use the Network File System (NFS) protocol to share files between another Linux computer.
- Easy Peasy Wireless w/ Ubuntu Debian Linux - In this brief blog entry I will reference the steps it takes to provide a wireless network connection, that is functional on both Linux 2.6 and Windows, using a Belkin Wireless G USB Network Adapter.
- Easy Peasy SMB on LAN Windows Mount - This brief blog entry will show you how to mount a local area Windows XP folder.
- How-To Mount WIndows Partitons (DOS, FAS, & NTFS) - The Linux kernel provides full read/write support for FAT32 and the older FAT filesystems. Full NTFS read-only support is natively available in the kernel as well, along with a small (which is no more experimental but limited) write support.


notes
Note that I needed to do mount as
sudo mount...
and to get read write access change that ro to an rw.
and that czar is a user name logged in
but it worked great!