Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to mount NTFS partition under Linux

2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to mount NTFS partitions under Linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

NTFS partition, which stands for New Technology File System, is designed for the Windows NT series and is used to replace the File Allocation Table (FAT) file system.

Install ntfs-3g

1. Determine whether ntfs-3g is installed. 1. If the rpm package is installed, you can see it with rpm-qa. If you want to find out whether a software package is installed, use rpm-qa | grep "name of the software or package": [justypc@localhost ~]

2. If installed by yum method, you can use yum list installed to find it. If you are looking for a specified package, add the command to | grep "Software name or package name": [justypc@localhost ~]

Loading new devices can not be recognized automatically in Linux system as in windows system. It needs to be identified and loaded manually. Everything in Linux is a file. Files are organized by a large file tree whose root directory is: /, expand step by step from the root. These documents are spread out through a number of equipment. The command mount (mount) connects the file tree in the device to the file tree in the linux system, which means that the new device can be loaded into the linux system with this command. Similarly, the umount command is used to unmount the device file tree.

The standard form of the mount command is as follows:

Mount-t type device dir

Where type indicates the type of device file system to be mounted, device represents the device to be mounted, and dir represents the mount point of the device on the system.

The common file system types in linux are disk file system, network file system, and proprietary / virtual file system.

It should be noted that devices can only be mounted under root users in linux systems.

Disk file system includes hard disk, U disk, disk array, CDROM, DVD and so on. Common file systems include autofs, coda, Ext2, Ext3, Ext4, VFAT, ISO9660 (CD or CD image), UFS (Unix File System,Unix file system), FAT (File Allocation Table, file allocation table), FAT16, FAT32, NTFS (New TechnologyFile System) and so on.

Network file system: a file system that can be accessed remotely, which is still a local disk file system on the server side, and the client accesses data remotely over the network. Common file system formats are: NFS (Network File System, Network File system), Samba (SMB/CIFS), AFP (Apple FillingProtocol,Apple File Archiving Protocol), WebDAV and so on.

Proprietary virtual file system: a file system that does not reside on disk. Common formats are: TMPFS (temporary file system), PROCFS (Process FileSystem, process file system), and LOOPBACKFS (Loopback FileSystem, loopback file system).

In general, we often mount disk files in the linux system. The following mainly describes how to mount the U disk, hard disk, CD and so on to the linux system.

1. Mounting of disk

The USB disk with USB interface is treated as a SCSI device for linux system. First, switch to the user with root permission. Use the "fdisk-l" command to view the system's disk list before inserting the USB disk. As shown in the following figure, the system has a single hard disk / dev/sda, the size 64.4GB, which is the same as the disk size assigned when the virtual system was created. The Linux system automatic disk is divided into three partitions / dev/sda1, / dev/sda2, / dev/sda5.

After inserting the USB disk, use the "fdisk-l" command again and find that there is one more hard disk / dev/sdb in the disk list, with a capacity of 2G, which is the same as that of the inserted USB disk. At the same time, the system has one more / dev/sdb1 disk partition. This disk partition is the USB disk to be mounted.

Create a new directory as the mounting point for the flash drive. For example, to mount a flash drive to / mnt/usb, you need to create a new / mnt/usb with the following command.

Mkdir / mnt/usb

You can then mount the flash drive to / mnt/usb using the mount command.

Mount / dev/sdb1 / mnt/usb

Enter the command cd / mnt/usb to enter the directory / mnt/usb, and then enter the ls command to view the contents of the flash drive.

After the U disk has been used, in order to avoid damage to the U disk or loss of data, you can use the umount command to unhang the U disk, which is similar to the pop-up U disk operation under windows.

Umount / mnt/usb

2. Mounting of removable hard disk

The mount of a mobile hard disk is actually very similar to that of a U disk. Moving a hard drive in linux is also treated as a SCSI device. First, switch to the user with root authority, and then use the fdisk-l command to view the system hard disk and partition. The results are as follows:

After inserting the removable hard disk, enter the fdisk-l command again, you can see that there is one more / dev/sdb disk in the system, the size is 1T, and the disk is divided into four partitions: / dev/sdb1, / dev/sdb2, / dev/sdb3, / dev/sdb4. This is exactly the same as the inserted removable hard drive.

We can think of four partitions as four flash drives. Create 4 mount points: / mnt/hddisk1, / mnt/hddisk2, / mnt/hddisk3 and / mnt/hddisk4.

Mkdir / mnt/hddisk1

Mkdir / mnt/hddisk2

Mkdir / mnt/hddisk3

Mkdir / mnt/hddisk4

It can also be done with simplified commands.

Mkdir / mnt/hddisk1 / mnt/hddisk2 / mnt/hddisk3 / mnt/hddisk4

Then use the mount command to mount 4 partitions.

Mount / dev/sdb1 / mnt/hddisk1

Mount / dev/sdb2 / mnt/hddisk2

Mount / dev/sdb3 / mnt/hddisk3

Mount / dev/sdb4 / mnt/hddisk4

After the mount is complete, you can go to / mnt/hddisk1, / mnt/hddisk2, / mnt/hddisk3, / mnt/hddisk4 to view the contents of each partition of the hard disk.

Similarly, if the hard drive is not in use, you need to use the umount command to unmount it.

3. CD mount

The CD corresponds to the file / dev/cdrom in the linux system. Before mounting, first switch to the root authorized user, and then create the mount point / mnt/cdrom.

Su root

Mkdir / mnt/cdrom

Then use the mount command to mount the CD.

Mount / dev/cdrom / mnt/cdrom

Img

After the mount is successful, "mount: block device / dev/sr0 write protection, will be mounted read-only" will be displayed.

Then change to the / mnt/cdrom directory and use the ls command to view the files on the CD.

Similarly, after the use is complete, you can unhang the CD with the umount command. For this example, you can use the following command:

Umount / dev/cdrom or umount / mnt/cdrom

It should be noted that the CD is a read-only file. If you need to extract the files in the CD, you cannot do so directly in the mount point directory. You can first copy the files on the CD to another directory, and then unzip it.

This is the end of this article on "how to mount NTFS partitions under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report