Friday, 16 September 2011

Mounting USB On Linux

[root@charon fc4]# uname -rm
2.6.11-1.1369_FC4 i686

I selected '2.6.11-1.1369_FC4' 'i686' for my Athlon-XP computer. Both parts MUST match.

[root@charon fc4]# rpm -ivh kernel-module-ntfs-2.6.11-1.1369_FC4-2.1.22-0.rr.6.0.i686.rpm
Preparing... ########################################### [100%]
1:kernel-module-ntfs-2.6.########################################### [100%]

To allow access to NTFS partitions you must (1) check how many partitions
you have, (2) create mount points, (3) mount partitions, and (4) update fstab
to mount at next boot.

Check Partitions

Check how many NTFS partitions you have:

[root@charon fc4]# fdisk -lu /dev/hda | grep NTFS
/dev/hda1 * 63 16771859 8385898+ 7 HPFS/NTFS
/dev/hda2 16771860 33543719 8385930 7 HPFS/NTFS
/dev/hda3 33752628 67312349 16779861 7 HPFS/NTFS

Usually the first will be C drive, next D, etc.

Create Mount Points

Instead of /media/, you can also use /mnt/, both will work, but make
sure to make the correct edits in all places.

[root@charon fc4]# cd /media/
[root@charon media]# mkdir c_drive
[root@charon media]# mkdir d_drive
[root@charon media]# mkdir e_drive

You don't have to use these names, if you prefer to creat folders such as
movies, documents, or winxp, any name will work (without spaces).

Mount Partitions

Run 'man mount' to fully explain what "-r -o umask=0222" does.

[root@charon media]# mount /dev/hda1 /media/c_drive/ -t ntfs -r -o umask=0222
[root@charon media]# mount /dev/hda2 /media/d_drive/ -t ntfs -r -o umask=0222
[root@charon media]# mount /dev/hda3 /media/e_drive/ -t ntfs -r -o umask=0222

Update /etc/fstab
Open '/etc/fstab' in an editor and add these lines to the END of the file:

/dev/hda1 /media/c_drive ntfs ro,defaults,umask=0222 0 0
/dev/hda2 /media/d_drive ntfs ro,defaults,umask=0222 0 0
/dev/hda3 /media/e_drive ntfs ro,defaults,umask=0222 0 0

No comments:

Post a Comment