User Tools

Site Tools


howto:automountusbstorage
Tautan Sumber

Apa yang dilakukan ini?

Instruksi ini menunjukkan bagaimana mengkonfigurasi Anda untuk diam-diam me-mount Eee kartu yang berbeda SD dan thumb drive USB di lokasi pilihan Anda. Mereka akan dipasang pada startup jika sudah mereka dimasukkan atau dipasang ketika Anda memasukkan mereka, tapi tanpa GUI dialog deteksi. The GUI masih akan menunjukkan untuk setiap perangkat yang tidak secara khusus dikonfigurasi.

Sebagai contoh, Anda bisa memiliki satu kartu SD penuh permainan yang secara otomatis mount dirinya di bawah / home / user / games dan lain digunakan untuk foto yang akan me-mount di bawah / home / user / foto.

Anda kemudian dapat swap antara kartu yang dibutuhkan, tetapi Anda harus meng-unmount secara manual dari baris perintah sebelum melepaskan mereka untuk menghindari kerusakan data Anda. Ada juga akan ada ikon tray untuk perangkat dimasukkan dan terpasang.

Instruksi berikut dapat diulang beberapa kali untuk mengkonfigurasi berbagai perangkat yang akan dipasang di lokasi yang berbeda

Cari tahu nomor seri perangkat Anda

  1. Masukkan Anda kartu SD atau USB thumb drive

Buka terminal (Ctrl-Alt-T dalam mode Easy, jalankan konsole Lanjutan). Semua tindakan di bawah ini dilakukan di jendela terminal. Anda dapat mencatat beberapa akhir perintah dengan ”&”. Hal ini membuat mereka berjalan di latar belakang, sehingga jika Anda mengatakan menjalankan GUI editor seperti KWrite, Anda bisa mendapatkan kembali terminal prompt untuk perintah lebih lanjut, bahkan dengan KWrite masih berjalan. - Menyimpan isi dari file virtual / proc / bus / usb / perangkat ke file nyata dalam direktori home Anda - cat / proc / bus / usb / perangkat> / home / user / usb_devices.txt - Buka / home / user / usb_devices.txt di editor - kwrite / home / user / usb_devices.txt & - Temukan perangkat Anda dan nomor seri. Carilah bagian mana saya: baris berakhir dengan Driver = usb-storage , beberapa baris di atas Anda akan menemukan nomor seri dari pembaca kartu. Beberapa perangkat juga akan memiliki nama produk Anda mungkin mengenali. Ini adalah nama yang mencegah beberapa dari mereka me-mount dengan benar, mencegah Anda untuk mengaksesnya. Carilah sejalan dengan Produk DISK = USB 2.0 (catatan ini hanya sebuah contoh, dan nama Anda mungkin berbeda atau tidak ada sama sekali).

T:  Bus=05 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  2 Spd=480 MxCh= 0
  D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
  P:  Vendor=0cf2 ProdID=6225 Rev= 1.00
  S:  Manufacturer=ENE
  S:  Product=UB6225
  S:  SerialNumber=146030377350
  C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=498mA
  I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
  E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
  E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Note: You could also run this command from the terminal prompt:

grep -A 1 Product /proc/bus/usb/devices

This will show just the “Product” and “SerialNumber” lines of the above process.

Configure device detection

  1. Make note of the serial number, or just keep the file open for cut and paste.
  2. Edit /etc/udev/rules.d/50-xandros-udev.rules. You need to be root to do it:
    sudo kwrite /etc/udev/rules.d/50-xandros-udev.rules &
  3. Find the comment
    # usb, removable storage
  4. Immediately after this comment, so that it will replace the Asus dialog, add the following line, changing the serial number to match your device and optionally changing the name sdcard1 (in both places)
    BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="146030377350", NAME="sdcard1", OPTIONS+="last_rule", RUN+="/bin/mount /dev/sdcard1"
  5. Make sure the above line is correct, especially taking care the number and placement of ”=” signs is matching. Probably the best thing to do is to copy and paste the line above, then change sdcard1 if required.

Create mount point directory

  1. Execute:
    mkdir /path/to/mount/point

    eg:

    mkdir /home/user/games
  2. If you want to create a mount point outside your /home/user directory you will have to add “sudo ” to the beginning of the command above.

Configure mount point

  1. Edit /etc/fstab. This, too, has to be done as root, so do:
    sudo kwrite /etc/fstab &
  2. Add a new line at the end
    /dev/sdcard1              /home/user/games    vfat    rw,uid=user
  3. If your device is formatted with a file system different to FAT32, substitute “vfat” with the appropriate label: ntfs for NTFS, ext2 for ext2, ext3 for ext3, and so on. You can have a look at the file system used by looking at the virtual file /etc/mtab while the device is still plugged in and mounted (it will be if you didn't remove it since you started this procedure).
    sudo cat /etc/mtab
  4. Now you can save and close all the files you have been editing, before:

Testing your new config

  1. Restart your Eee
  2. Device should now be mounted in correct location
  3. To remove the device, execute:
    sudo umount /path/to/mount/point

    then physically remove.

  4. IMPORTANT: If you don't do the above before removing the device (or shutting down or suspending) then you'll corrupt your data. It may also be wise to execute a sync command beforehand as well (this should flush any delayed writes to all disks). I suggest creating a desktop icon that runs it.

Automatic umount

For instructions on how to set up an automatic umount see http://wiki.eeeuser.com/howto:properumountstorage [

howto/automountusbstorage.txt · Last modified: 2013/02/18 01:45 by gerrardz