Windows partitions are automatically mounted on Ubuntu.

Source: Internet
Author: User
Save the following as/usr/sbin/autowinfs
Sudo gedit/usr/sbin/autowinfs

#! /Bin/sh
#
# Autowinfs auto mount Windows Disks
#
# Copyright (c) 2005 Jiahua Huang <jhuangjiahua@gmail.com>
# License: gplv2
#
#/Usr/bin/sutowinfs
# It is used to automatically mount Windows partitions on the machine and write to/etc/fstab
# February 18 14:06:12 CST 2005

Mkdir-P/Windows/
Rmdir/Windows/* 1>/dev/null

Grep-V '/Windows/'/etc/fstab>/etc/fstab. SWP

# This script is used in the locale of the UTF-8, if it is the locale of GBK, the following iocharset = utf8 to iocharset = cp936
# It is rare that a separate fdisk-l cannot list partitions, so remove/dev/[Hs] d [A-Z ].
# Fdisk-L/dev/[Hs] d [A-Z] | grep-e 'fat | NTFS '| cut-d'-F1 | cut-D /- f3 | while read wdisks
# Look For NTFS partitions. The auto of the new kernel seems to be a problem, so now we separate NTFs and VFST.
Fdisk-L/dev/[Hs] d [A-Z] | grep 'ntfs '| cut-d'-F1 | cut-D/-F3 | while read wdisks
Do echo "/dev/$ wdisks/Windows/$ wdisks NTFS auto, user, iocharset = utf8, umask = 0 0 0">/etc/fstab. SWP
Mkdir "/Windows/$ wdisks"
Done

Fdisk-L/dev/[Hs] d [A-Z] | grep 'fat' | cut-d'-F1 | cut-D/-F3 | while read wdisks
Do echo "/dev/$ wdisks/Windows/$ wdisks vfat auto, user, iocharset = utf8, umask = 0 0 0">/etc/fstab. SWP
Mkdir "/Windows/$ wdisks"
Done

MV/etc/fstab. SWP/etc/fstab

Mount-

Exit 0

Run the command again.
Sudo chmod + x/usr/sbin/autowinfs
Sudo/usr/sbin/autowinfs

You can.

Related Article

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.