Do you want to know the truth about the Linux system? Do you want to know what is inherent in the Linux system, I will only give you a full introduction to Linux. Today we will introduce how to mount Windows partitions in Linux.
1. Manual mounting
In Linux, you can also read Windows partitions, including fat32 and ntfs. First, you need to know the name of Hard Disk Partition in Linux. 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, enter the following command in 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
For example, if the screen output is/dev/hda1: 8463 m (PCP), you can use this command to view the program name of the process: ps 8463 and then use this command to end the process: kill-9 8463 to unmount the partition normally.
2. automatic mounting in Linux
To enable the Linux system to automatically mount windows partitions at startup, you can write the preceding command to the/etc/fstab file. The following is an example:
- # /etc/fstab: static file system information.
- #
- #[file system] [mount point] [type] [options] [dump] [pass]
- proc /proc proc defaults 0 0
- /dev/hda9 / ext3 defaults 0 1
- /dev/hda13 none swap sw 0 0
- /dev/hdc /media/cdrom iso9660 ro,user,noauto 0 0
- /dev/fd0 /media/floppy auto rw,user,noauto 0 0
- /dev/hda10 /mnt/debian ext3 defaults 0 0
- /dev/hda1 /mnt/C ntfs utf8,umask=022 0 0
- /dev/hda5 /mnt/D vfat utf8,umask=0 0 0
- Modify host name and IP settings in Linux
- Linux has successfully fixed many bugs.
- Linux system management has won various honors
- Ubuntu Linux systems can be used without any knowledge
- More stable and secure Linux systems