Ubunut palm card reader automatic mounting

Source: Internet
Author: User
Read the chinalinuxzend How to automatically mount a USB flash disk through udev

1. Use card reader to virtualize SD into a USB flash drive
2. Create the file 10_usbkey.rules in the/etc/udev/rules. d directory. The content of the file is as follows:
Kernel = "sda1", subsystem = "Block", run + = "/root/usbmount. Sh"
3. Then, create the file usbmount. Sh in the/root directory. The content is #! /Bin/bash

Log =/var/log/usb-hotplug.log

Lap = $ (date -- rfc-3339 = NS)
Echo "$ lap: $ devpath requesting $ action" >>$ log

If [$ action = "add"]
Then
Mount-T vfat-O umask = 000, noatime, async, codePage = 936, iocharset = gb2312
/Dev/sdb1/Media/USBkey
# Use fdisk-L to view sdb1
#/Media/USB key Customization
Elif [$ action = "Remove"]
Then
Umount-L/Media/USBkey
Fi

4. OK. Haha

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.