Mount an NTFS hard disk in Linux

Source: Internet
Author: User
English!
1. Install NTFS support

For Yum users:

[Mirandam @ Charon ~] $ Sudo Yum install fuse-libs ntfs-3g ntfsprogs-gnomevfs

Users without yum, download fuse, fuse-lib and ntfs-3g (ntfsprogs and ntfsprogs-gnomevfs are optional) from fedora extras. save them to a separate directory (NTFs ). they are less than 1 MB download.

[Mirandam @ Charon downloads] $ CD NTFS
[Mirandam @ Charon NTFS] $ sudo rpm-IVH fuse * NTFS *

No kernel version checking is required, so long as you are using a fc6 kernel.

2. Check your partitions

Use fdisk to list partitions. Most ATA hard drives will be/dev/hda. Drives may also show up as/dev/HDB,/dev/SDA depending on your configuration.

[Mirandam @ Charon ~] $ Sudo/sbin/fdisk-lu/dev/hda | grep NTFS
/Dev/hda1*63 33559784 16779861 7 HPFs/NTFS
/Dev/hda2 33559785 67119569 16779892 + 7 HPFs/NTFS
/Dev/hda3 67119570 100679354 16779892 + 7 HPFs/NTFS

Usually the first will be a drive "letter": C drive, next D, etc. Hence/dev/hda1 is my C:/drive used by windows.

3. Create mount points

For every partition in step 2 that you wish to access, you will need a "mount point ". A mount point is just a directory. common directories are:/Media/AND/mnt /. use whichever, but be consistent.

[Mirandam @ Charon ~] $ CD/Media/
[Mirandam @ Charon media] $ sudo mkdir c_drive d_drive e_drive

You do not have to use these names, if you prefer to create folders such as movies, documents, or WINXP, any name will work (without spaces ).

4. Mount partitions

Using NTFS-3G, We can mount the NTFS partition read-write, however it is recommended for novices as read-only. the following mounts and sets the permissions so all users can read the contents of each partition.

[Mirandam @ Charon ~] $ Sudo Mount/dev/hda1/Media/c_drive-T ntfs-3g-r-o umask = 0222
[Mirandam @ Charon ~] $ Sudo Mount/dev/hda2/Media/d_drive-T ntfs-3g-r-o umask = 0222
[Mirandam @ Charon ~] $ Sudo Mount/dev/hda3/Media/e_drive-T ntfs-3g-r-o umask = 0222

Read/write access: the above is for read-only access. In order to mount read/write, you must use the-RW-O umask = 0000. Example:

[Mirandam @ Charon ~] $ Sudo Mount/dev/hda1/Media/c_drive-T ntfs-3g-RW-O umask = 0000

Highly recommended: Please run man mount to understand what umask = does.

5. Update/etc/fstab

Every time fedora boots, the partitions must be mounted. to automatically mount, you must edit/etc/fstab.

Open/etc/fstab in an Editor: (use nano instead of gedit if you do not have a GUI)

[Mirandam @ Charon ~] $ Sudo gedit/etc/fstab

Add these lines to the end of the file:

/Dev/hda1/Media/c_drive ntfs-3g Ro, defaults, umask = 0222 0 0
/Dev/hda2/Media/d_drive ntfs-3g Ro, defaults, umask = 0222 0 0
/Dev/hda3/Media/e_drive ntfs-3g Ro, defaults, umask = 0222 0 0

Read/write access: the above is for read-only access. In order to mount read/write, you must use the RW, defaults, umask = 0000. Example:

/Dev/hda1/Media/c_drive ntfs-3g RW, defaults, umask = 0000 0 0

Done!
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.