linux--Auto-mount the win directory

Source: Internet
Author: User

1. Under Ubuntu View Windows disk information, Ctrl + ALT + t open terminal, enter the following command:
sudo fdisk-l  
The information is as follows:
[Email protected]:~$ sudo fdisk-l [sudo] password forCryhelyxx:disk/DEV/SDA:1000.2GB,1000204886016bytes255Heads theSectors/track,121601Cylinders, Total1953525168Sectors Units= Sector of1* += +bytes Sector size (logical/physical): +Bytes/4096bytes I/o Size (minimum/optimal):4096Bytes/4096bytes Disk identifier:0xf7b8cd85Device Start point end block number Id system/DEV/SDA1 * the   251674289   125837113+7hpfs/ntfs/ExFAT Partition1does not start on physical sector boundary. /dev/sda2251674351  1848662464   798494057F W95 Extension (LBA) Partition2does not start on physical sector boundary. /dev/sda31952178176  1953523711      672768    theLinux Switching/Solaris/dev/sda41848664064  1952177735    51756836    theLinux/dev/sda5251674353   677412854   212869251    7hpfs/ntfs/ExFAT Partition5does not start on physical sector boundary. /dev/sda6677412918  1103151419   212869251    7hpfs/ntfs/ExFAT Partition6does not start on physical sector boundary. /dev/sda71103151483  1528889984   212869251    7hpfs/ntfs/ExFAT Partition7does not start on physical sector boundary. /dev/sda81528890048  1848662464   159886208+7hpfs/ntfs/ExFAT Partition Table entries is notinchdisk order [email protected]:~$

I know my Ubuntu under the Windows partition has SDA1, Sda5, Sda6, Sda7, sda8, because my Windows partition has C, D, E, F, G disk
2. Then create the folder for the disk you want to mount, and then enter the following command to create the corresponding folder:
sudo mkdir/media/C  /media/D  /media/E  /media/F  /media/g  

3. Modify the Fstab file, path:/etc/fstab, according to the partition information to implement Ubuntu boot automatically mount Windows hard disk partition
(1) Open the Fstab file and execute the command:
sudo vim/etc/fstab  

Wherein, VIM is the editor, of course, can also gedit, sublime and other commonly used editors to open fstab files
(2) After opening the Fstab file, add the following information at the end (PS: The information to be added here corresponds to the disk information of your Windows, which is consistent with the information above):
/DEV/SDA1/MEDIA/C ntfs-3g silent,umask=000  /dev/sda5/media/d ntfs-3g silent,umask= 0 0 0  /dev/sda6/media/e ntfs-3g silent,umask=000  /dev/sda7/media/f ntfs-3g Silent, umask=000  /dev/sda8/media/g ntfs-3g silent,umask=00 0  

4. After adding information to the Fstab file, save the exit, restart the computer, enter the Ubuntu system, you can see the Windows disk automatically mounted successfully, as follows:

5. If you cannot mount automatically after a reboot, and click Windows Disk Eject to mount the disk, to mount as root, execute the following command to give the Fstab file permission:
sudo chmod u+rwx/etc/fstab  
where the above parameter u represents the current user, rwx represents read/write/Run permissions
6. Restart your computer to take effect, you can implement the automatic mount of Windows disk partition under Ubuntu system. OK, Enjoy it!!!

linux--Auto-mount the win directory

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.