LINUx下面挂载NTFS格式的硬盘

英文的哦!
1. Install NTFS Support

For yum users:

[mirandam@charon ~]$ sudo yum install fuse fuse-libs ntfs-3g ntfsprogs 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 1MB 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!
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值