CENTOS7 mounted NTFS removable hard disk

Source: Internet
Author: User
Tags locale mkdir
Centos 7 looks like a removable hard drive that does not directly identify NTFS


So when you insert an NTFS-formatted u disk and move your hard drive, you need to mount it (a removable drive requires additional ntfs-3g)


Switch to Su to perform the following actions:


MKDIR/MNT/USB//Create a directory for mounting USB drive


FDISK-L//View system mount, for example, SDB1 on behalf of your USB disk/removable hard drive


MOUNT/DEV/SDB1/MNT/USB///DEV/SDB1 mount the U disk to the/MNT/USB directory


CD/MNT/USB//into the Mount directory, you can view the U disk/mobile Hard drive content


Umount/mnt/usb or UMOUNT/DEV/SDB1//uninstall U disk



2. mount a removable hard drive


We usually use the mobile hard disk is in NTFS format, Linux by default is not supported NTFS partitions, so you need to install a Third-party plugin under Linux ntfs-3g


Install ntfs-3g


Yum install gcc//install compiler that fails if you compile ntfs-3g without installing GCC
MKDIR/USR/LOCAL/NTFS3G//Create folder ntfs3g for later compile installation ntfs-3g
CD/USR/LOCAL/SRC//linux The default source code packet storage location;

Source Package Compile Installation location:

/usr/local/Software Name


wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz//Download ntfs-3g

TAR-ZXVF ntfs-3g_ntfsprogs-2011.4.12.tgz/

CD ntfs-3g_ntfsprogs-2011.4.12


./configure--prefix=/usr/local/ntf3g//compilation, specifying the installation directory/usr/local/ntf3g

Make&&make Install


Make-Clean && make Distclean//clear temporary files during installation

CD//Back to root directory

Rm-r-F ntfs-3g_ntfsprogs*



Mount


Fdisk-l//View mount information to see if the system recognizes the removable hard drive,/dev/sda1 represents the first partition of the first hard drive,/DEV/SDB1 represents the first partition of the second hard drive


Like mine:

Device boot start end blocks ID system

/dev/sda1.. ... .. .. .. Linux

/dev/sda2

/dev/sda3..


Device boot start end blocks ID system

/DEV/SDB1 2048 625 ... 312 7 Hpfs/ntfs/exfat


CD/MNT//Enter directory
mkdir usb1 USB2 USB3 usb4//Create 4 directories mount each partition of a removable hard disk separately


Mount Command one:
Ntfs-3g/dev/sdb1/mnt/usb1-o Locale=ar_sa. UTF-8, the red part can also be changed to ZH_CN. GBK, it is obvious that the use of some kind of code to mount, to prevent garbled;//mount each partition to the corresponding directory, the following section can not add


Ntfs-3g/dev/sdb2/mnt/usb2-o Locale=ar_sa. UTF-8
Ntfs-3g/dev/sdb3/mnt/usb3-o Locale=ar_sa. UTF-8
Ntfs-3g/dev/sdb4/mnt/usb4-o Locale=ar_sa. UTF-8


Mount Command two:


Mount NTFS-3G/DEV/SDB1/MNT/USB1
......
LS//view mobile hard drive information


Copy, back up files


Cp-r/WEB/MNT/USB1


UMOUNT/DEV/SDB1 or UMOUNT/MNT/USB1//uninstall mounted removable drive


Mount the removable hard drive automatically on the boot


----Edit/etc/fstab


Cp/etc/fstab/etc/fstabbak//edit before the backup, develop this good habit.
Vi/etc/fstab//Edit the file, add the following information at the end of the file, and press G (SHIFT+G) at the end of the jump file
/DEV/SDB1/MNT/USB1 ntfs-3g Defaults 0 0
/DEV/SDB2/MNT/USB2 ntfs-3g Defaults 0 0
/DEV/SDB3/MNT/USB3 ntfs-3g Defaults 0 0
/DEV/SDB4/MNT/USB4 ntfs-3g Defaults 0 0
: wq! Save exit and the system will automatically mount the removable hard drive after reboot



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.