Linux mounting Windows partition Disk

Source: Internet
Author: User

Linux mounting is quite common, So I studied Linux mounting and shared it with you here. I hope it will be useful to you. Linux mounting can improve the ease of use performance. Next we will talk about Linux mounting.

Linux mounting windows hard drive (NTFS/FAT32)

Run the following command on the terminal:

 
 
  1. [root@localhost ~]#uname -r  
  2. 2.6.18-92.el5  
  3. [root@localhost ~]#rpm -q –queryformat “%{ARCH}\n” kernel  
  4. I686 

Above can see Linux Mount system kernel is what version, so as to determine their desired corresponding version of the ntfs patch according to the above information and then enter the corresponding download page http://linux-ntfs.org/doku.php? Id = redhat: start download the patch and the above script prompts me that the information is 2.6.18-92. el5. Because my system is centos5.2, select RedHat Enterprise 5 (Tikanga ).

 
 
  1. 2.6.18-92.1.13.el5 i686 i686-xen x86_64 x86_64-xen FlatCap, Roger Olson  
  2. 2.6.18-92.1.10.el5 i686 i686-xen x86_64 x86_64-xen FlatCap, Roger Olson  
  3. 2.6.18-92.1.6.el5 i686 i686-xen x86_64 x86_64-xen FlatCap, Roger Olson  
  4. 2.6.18-92.1.1.el5 i686 i686-xen x86_64 x86_64-xen FlatCap, Roger Olson  
  5. 2.6.18-92.el5  i686 i686-xen x86_64 x86_64-xen FlatCap, Roger Olson 

Mount Windows partitions in Linux

1. Manual Linux mounting

In Linux mounting, you can also read Windows partitions, including fat32 and ntfs. First, you need to know the name of the hard disk partition under Linux mounting. For example, in Windows, the C drive is generally hda1, the D Drive is hda5, And the e drive is hda6. For details, see the relevant documentation.

To mount Windows partitions, you must first determine that the locale of your Linux system includes the language and character encoding information used by the system ). Common locale in Chinese Linux is zh_CN.gb2312, zh_CN.gbk, zh_CN.gb18030 and zh_CN.UTF-8.

In the default installation, locale for Debian Linux and Mandriva Linux is zh_CN.gb2312, while locale for Ubuntu Linux and Fedora Linux is a zh_CN.UTF-8. It is best not to change locale at will, otherwise there will be a lot of garbled characters. To view the locale of the system, run the following command on the terminal:

Echo $ LANG

Secondly, you need to know the format of your windows partition. This can be seen in the partition attributes of windows, which are generally in the fat32 and ntfs formats.

Suppose your locale is a zh_CN.UTF-8 and you want to mount a windows partition in the/dev/hda1 fat32 format to the/mnt/C directory if this directory does not exist, create a new one manually ), you can enter the following command in the terminal (sudo must be added before this command in Ubuntu): mount-t vfat/dev/hda1/mnt/C-o iocharset = utf8

If your locale is not a zh_CN.UTF-8, change the utf8 command above to gb2312; if the windows partition is in ntfs format, change the vfat command above to ntfs. In this way, only root partitions in ntfs format can be read. If you want normal users to read partitions, you need to add the umask = 022 option, as shown below: mount-t ntfs/dev/hda1/mnt/C-o iocharset = utf8, umask = 022

Similarly, if you want to allow all users to read and modify the mounted partition, you can change umask = 022 to umask = 0. Detaching a partition is much easier: umount/dev/hda1 sometimes prompts that the partition is busy when detaching the partition). You can use the following command to check which process is using this partition: fuser-cu/dev/hda1 if the output on the screen is/dev/hda1: 8463 m (UDF), you can use this command to check the program name of the process: ps 8463 then you can run this command to end the process: kill-9 8463 so that you can unmount the partition normally.

2. Automatic Linux mounting

To enable the Linux mounting system to automatically mount windows partitions at startup, you can write the preceding command to the/etc/fstab file. The following is an example:

 
 
  1. # /etc/fstab: static file system information.  
  2. #  
  3. #[file system] [mount point] [type] [options] [dump] [pass]  
  4. proc /proc proc defaults 0 0  
  5. /dev/hda9 / ext3 defaults 0 1  
  6. /dev/hda13 none swap sw 0 0  
  7. /dev/hdc /media/cdrom iso9660 ro,user,noauto 0 0  
  8. /dev/fd0 /media/floppy auto rw,user,noauto 0 0  
  9. /dev/hda10 /mnt/debian ext3 defaults 0 0  
  10. /dev/hda1 /mnt/C ntfs utf8,umask=022 0 0  
  11. /dev/hda5 /mnt/D vfat utf8,umask=0 0 0 

Install patches on Linux

 
 
  1. [Root @ localhost ~] # Rpm-ivh kernel-module-ntfs-2.6.18-92.el5-2.1.27-0.rr.10.11.i686.rpm
  2. Preparing... ######################################## ### [100%]
  3. 1: kernel-module-ntfs-2.6. ######################################## ### [100%]
  4. [Root @ localhost ~] #/Sbin/modprobe ntfs # loading into the kernel
  5. [Root @ localhost ~] # Dmesg | grep NTFS # display log information. Note the case sensitivity.
  6. NTFS driver 2.1.20 [Flags: R/w module].

Check whether the NTFS module is supported after installation:

 
 
  1. [root@localhost ~]#cat /proc/filesystems  
  2. nodev   autofs 

Check whether the ntfs module is loaded. Then, the driver is loaded and the ntfs partition can be mounted. [root @ localhost ~] # Fdisk-l view partition information

 
 
  1. Disk /dev/sda: 320.0 GB, 320072933376 bytes  
  2. 255 heads, 63 sectors/track, 38913 cylinders  
  3. Units = cylinders of 16065 * 512 = 8225280 bytes  
  4.  
  5. Device Boot      Start         End      Blocks   Id  System  
  6. /dev/sda1   *           1          13      104391   83  Linux  
  7. /dev/sda22551       38912   292077765    f  W95 Ext’d (LBA)  
  8. /dev/sda52551       17848   122881153+   7  HPFS/NTFS  
  9. /dev/sda6           17849       31871   112639716    7  HPFS/NTFS  
  10. /dev/sda7           31872       38912    56556801   8e  Linux LVM 

SATA Hard Disk: sdaX, IDE Hard Disk: hdaX

Start mounting NTFS partitions
[Root @ localhost ~] # Mount-t ntfs/dev/sda5/mnt/d and mount the NTFS partition/dev/sda5 to the/mnt/d directory.

Mount the FAT32 Partition
[Root @ localhost ~] # Mount-t vfat/dev/sda5/mnt/d and mount the FAT partition/dev/sda5 to the/mnt/d directory.

  1. Linux Mount Methods
  2. Linux YUM is built on an ftp server as the source
  3. CentOS VM supports RedHat AS3/AS4/AS5Linux Operating System
  4. Linux and Mac platform Dev branch updated to 5.0.307.5
  5. Ubuntu Linux fish and bear's paw are both really fast

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.