USBメモリをUSBポートに刺すと、勝手にSCSIデバイス (sda1) として認識されます
grape:~ # dmesg ・・・ usb 5-3: new high speed USB device using ehci_hcd and address 3 SCSI subsystem initialized Initializing USB Mass Storage driver... scsi0 : SCSI emulation for USB Mass Storage devices usb-storage: device found at 3 usb-storage: waiting for device to settle before scanning usbcore: registered new driver usb-storage USB Mass Storage support registered. Vendor: I-O DATA Model: USB Flash Disk Rev: 5.00 Type: Direct-Access ANSI SCSI revision: 00 usb-storage: device scan complete SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB) sda: Write Protect is off sda: Mode Sense: 23 00 00 00 sda: assuming drive cache: write through SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB) sda: Write Protect is off sda: Mode Sense: 23 00 00 00 sda: assuming drive cache: write through sda: sda1 Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0 Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0 subfs 0.9
grape:~ # mkdir /mnt/usbfm grape:~ # mount -t vfat -o codepage=932,iocharset=utf8 /dev/sda1 /mnt/usbfm/ grape:~ # ls /mnt/usbfm . .. 新規テキスト ドキュメント.txt grape:~ # umount /mnt/usbfm/
grape:~ $ sudo mkfs.vfat -v -c -F 32 /dev/sda1
"-F" は FAT16、"-F 32" は FAT32
# cat /etc/auto.master # # $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $ # # Sample auto.master file # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # For details of the format look at autofs(5). /misc /etc/auto.misc --timeout 60 #/smb /etc/auto.smb #/misc /etc/auto.misc #/net /etc/auto.net
# cat /etc/auto.misc # # $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $ # # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # Details may be found in the autofs(5) manpage cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom # the following entries are samples to pique your imagination #linux -ro,soft,intr ftp.example.org:/pub/linux #boot -fstype=ext2 :/dev/hda1 #floppy -fstype=auto :/dev/fd0 #floppy -fstype=ext2 :/dev/fd0 #e2floppy -fstype=ext2 :/dev/fd0 #jaz -fstype=ext2 :/dev/sdc1 #removable -fstype=ext2 :/dev/hdd usbfm -fstype=vfat,codepage=932,iocharset=utf8 :/dev/sda1
# chkconfig --level 35 autofs on # chkconfig --list | grep autofs autofs 0:off 1:off 2:off 3:on 4:off 5:on 6:off
# /etc/rc.d/autofs restart Shutting down service automount done Starting service automounter done # ls /misc/usbfm/ . .. 新規テキスト ドキュメント.txt