Linux locale manually mounts the kernel

Source: Internet
Author: User

We recommend a very good Linux locale system with great learning value. Here I will mainly explain the application of the Linux locale System, including the background knowledge of the Linux locale package. 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 

I686 above can see the C kernel is what version, so as to determine their desired 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 

The RPM package Windows partition is downloaded.

1. Manual mounting

In Linux locale, you can also read Windows partitions, including fat32 and ntfs. First, you need to know the name of the hard disk partition in Linux locale. For example, Linux locale disks in Windows are generally hda1, d disks are hda5, and E disks are hda6. For details, see the relevant documentation.

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

By default, Debian Linux and Mandriva Linux locale are zh_CN.gb2312, while Ubuntu Linux and Fedora Linux locale are 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 Linux 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 mounting

To enable the Linux locale 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

 
 
  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.

 
 
  1. [Root @ localhost ~] # Fdisk-l view partition information
  2. Disk/dev/sda: 320.0 GB, 320072933376 bytes
  3. 255 heads, 63 sectors/track, 38913 cylinders
  4. Units=CylindersOf 16065 *512=8225280Bytes
  5. Device Boot Start End Blocks Id System
  6. /Dev/sda1*1 13 104391 83 Linux
  7. /Dev/sda2 2551 38912 292077765 f W95 Ext 'd (LBA)
  8. /Dev/sda5 2551 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 the NTFS partition [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. Detailed discussion on Linux User Creation commands
  2. Linux Xsupplicant package installation Description
  3. Linux Makefile
  4. In-depth discussion on Linux partition Solutions
  5. Knowledge about Linux SNMP and RRD database updates

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.