USB mobile hard drive in NTFS format is automatically mounted in Linux

Source: Internet
Author: User
I bought a 1 TB hard drive. because I want to switch with WINDOWS, I can only use the NTFS format. If you install hal and supervisor, you will not talk about it. I. install the software # emergentfs-3g 2. configure and compile the kernel # cd/usr/src/linux # makemenuconfig check Filesystems --- MFilesysteminUserspacesupport # ma

I bought a 1 TB hard drive. because I want to switch with WINDOWS, I can only use the NTFS format.

If you install hal and supervisor, you will not talk about it.

1. install software
# Emerge NTFS-3G
II. configure and compile the kernel
# Cd/usr/src/linux
# Make menuconfig
Check File systems ---> Filesystem in Userspace support
# Make clean & make & modules_install
3. load the kernel module
# Modprobe fuse
Of course, you can open/etc/modules. autoload. d/kernel-2.6 and add fuse.

4. commands for manually mounting NTFS partitions

Then you can mount the ntfs partition:

# Mount-t NTFS-3G-o locale = zh_CN.UTF-8, silent/dev/sdc1/mnt/usb

5. configure/etc/fstab

Add the following lines to/etc/fstab:

/Dev/sdc1/home/crob/1 TDisk NTFS-3G auto, user, rw, locale = zh_CN.UTF-8, silent 0 0

6. non-root users cannot mount the file automatically. the system prompts "only root can do this" solution.

The user option in fstab does not work on ntfs3g. after checking the NTFS-3G official website, I found the following answer:

Http://ntfs-3g.org/support.html#useroption2

Why don't the 'user' and 'users' options work in/etc/fstab?
The 'mount' command doesn' t invoke the NTFS-3G binary with theneeded privilege after it has checked and approved the user isentitled to mount a given device on a specified mount point, herebythe user can't open the device he got the approval in/etc/fstab. this is a problem in the 'Mount' utility.

Solution: Use at least NTFS-3G 1.2506 with setuid-root set andmake sure the user has access rights to the volume and mountpoint.

After the suid parameter is added to emerge ntfs3g, the system still cannot automatically mount the instance. If no permission is available.

The following operations are performed to grant normal users the mount and unmount permissions.

Create a mount user group and edit/etc/group. add the following content:

Mount: *: 1000: username1, username2

Dotc crob # chmod 4710/bin/mount

Dotc crob # chown root: mount/bin/mount

Dotc crob # chmod 4710/bin/umount
Dotc crob # chown root: mount/bin/umount


So far, everything is done. Insert the USB and mount it automatically.
Related Article

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.