Mounting NTFS on linux (if not auto mounted)

November 2, 2008 at 3:14 am (Linux installation) (, , , )

This article is about linux distribution which support NTFS but not automount them. ex: Ubuntu (<7), fedora (>4) etc. More newer ones will have drives mounted on /mnt or /media

Many people complain about cannot able to access windows NTFS partitions in linux. Here’s some help.

Open your console/command line, and type:

su –

passwd:(enter your passwd here)

this will login you as admin inside commandline. Now type,

fdisk -l

this will show a list of drives (mounted/unmounted) — indentify your windows drives by size (in kB – in Blocks column) and note down the device name under device column. If you have more than one HDD, the fdisk output gives them different letters starting from a,b. ex: primary hard partitions will start from sda, here i have shown only the output for my second hard drive which is sdb).

for example:

Device Boot      Start         End         Blocks                   Id           System
/dev/sdb1               1        1305         10482381             c           W95 FAT32 (LBA)
/dev/sdb2            1306     16708     123724597+         f           W95 Ext’d (LBA)
/dev/sdb3   *      16709     16721   104422+              83          Linux
/dev/sdb4           16722     19929    25768260            8e          Linux LVM
/dev/sdb5            1306      9137      62910508+          7            HPFS/NTFS

note down the /dev/sdb5 in a paper along with the drive name (identified by size), which is a NTFS partition.

now goto /mnt and make a directory

cd /mnt && mkdir (whatever name you call the drive)

ex: mkdir malshan

now we need to open rc.local file, any command written here will be executed at boot

gedit /etc/rc.d/rc.local

if you don’t have gedit type,

kwrite /etc/rc.d/rc.local

in the window, add this line to end (append)

mount (device) (folder you created)

ex: mount /dev/sdb5 /mnt/malshan

will mount the drive to /mnt/malshan, now you can just

cd /mount/malshan && ls to see the contents; after rebooting

(Note that you can type mount /dev/sdb5 /mnt/malshan in command line to mount it now, but that’s temparaly)

follow same procedure for other drives, after mkdir different folders (ex: malshan2). ex:

mount /dev/sdb6 /mnt/malshan2 , add to rc.local.

Note that, mounted drives are considered as normal linux folders and files.

if you need to mount an iso image, you can use

mount -t iso9660 -o loop (imagefile) (mount folder) ex:

mount -t iso9660 -o loop /mnt/storage/fedora9_live.iso /media/fedora

if your linux doesn’t auto run pen drives, (no pop up) check /media folder, where normally CD’s, DVD’s or flash drives are auto mounted.



1 Comment

  1. Save my windows-infected flash drive using linux « Malshan’s Linux Blog said,

    […] this should create a short cut in new versions. Try removing virus process again. For more use of mounting, see here. […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: