1. USB장치를 리눅스 서버에 꼽는다.
2. USB장치를 마운트할 마운트 포인트를 생성한다.
# mkdir /mnt/usb
(modprobe명령어로 ide-scsi모듈을
로드한다.)
# modprobe ide-scsi
# lsmod | grep ide-scsi
3. 리눅스에서 대부분
USB장치는 /dev/sda 또는 /dev/sdb 또는 /dev/sdc등의 장치명을 사용하는데 현재 리눅스서버에서 사용되고 있지 않은 장치명을 USB장치명으로 사용할수 있다.
어떤 장치명에 할당되었는가를 확인하기 위하여 다음과 같이 "fdisk -l"을
실행해 본다.
# fdisk -l
Disk /dev/sda:
21.5 GB, 21474836480 bytes
255 heads, 63
sectors/track, 2610 cylinders
Units =
cylinders of 16065 * 512 = 8225280 bytes
Disk
identifier: 0x000dcf45
Device
Boot Start End Blocks
Id System
/dev/sda1 * 1 2474
19865600 83 Linux
/dev/sda2 2474 2610
1099193+ 82 Linux swap / Solaris
Disk /dev/sdb: 8103 MB, 8103395328 bytes
256 heads, 21 sectors/track, 2944 cylinders
Units = cylinders of 5376 * 512 = 2752512 bytes
Disk identifier: 0xc3072e18
Device Boot
Start End Blocks
Id System
/dev/sdb1
* 1 2944
7912500 c W95 FAT32 (LBA)
또는 dmesg 로 장치를 확인한다
usbcore: registered new interface driver btusb
usb 1-1: USB disconnect, address 2
usb 1-1: new full speed USB device using uhci_hcd and address 3
usb 1-1: New USB device found, idVendor=043e, idProduct=70d6
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: USB Flash Drive
usb 1-1: Manufacturer: LG Electronics
usb 1-1: SerialNumber: AA00000000003651
usb 1-1: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi3 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 3:0:0:0: Direct-Access LGE USB Drive 1100 PQ: 0 ANSI: 0 CCS
sd 3:0:0:0: Attached scsi generic sg2 type 0
sd 3:0:0:0: [sdb] 15826944 512-byte logical blocks: (8.10 GB/7.54 GiB)
sd 3:0:0:0: [sdb] Write Protect is off
sd 3:0:0:0: [sdb] Mode Sense: 43 00 00 00
sd 3:0:0:0: [sdb] Assuming drive cache: write through
sd 3:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
4. USB장치가
/dev/sdb1장치를 사용하는 것을 확인했으므로, 해당 장치를 마운트한다.
# mount -t vfat
/dev/sdb1 /mnt/usb
5. 사용이 끝나면 마운트를 해제한다.
# umount /mnt/usb
* USB 드라이브에서 한글
깨짐 현상 복구
mount -t vfat
-o iocharset=cp949 /dev/sda1 /mnt/usb
* 부팅 시 자동으로
인식하기
vi /etc/fstab
/dev/sda1 /mnt/usb auto noauto,iocharset=cp949,user 0 0
6.lsmod로 mount 시 module 사용 상태 확인
mount 전
# lsmod
Module
Size Used by
vfat
8744 0
fat
41836 1 vfat
usb_storage
47064 0
btusb
15032 0
bluetooth
78336 1 btusb
rfkill
16220 1 bluetooth
iptable_nat 6068
0
nf_nat
18008 1 iptable_nat
iptable_mangle 3400
0
ip6t_REJECT 4620
2
nf_conntrack_ipv6 17548 2
ip6table_filter 3168
1
ip6_tables 11144
1 ip6table_filter
ipv6
239428 28 ip6t_REJECT,nf_conntrack_ipv6
ppdev
8200 0
parport_pc 22748
0
parport
29300 2 ppdev,parport_pc
i2c_piix4
11968 0
i2c_core
23160 1 i2c_piix4
pcnet32
28000 0
mii
4120 1 pcnet32
floppy
47700 0
BusLogic
61932 2
mount 후
# mount -t vfat /dev/sdb1 /mnt/usb
# lsmod
Module
Size Used by
vfat
8744 1
fat
41836 1 vfat
usb_storage
47064 1
btusb
15032 0
bluetooth
78336 1 btusb
rfkill
16220 1 bluetooth
iptable_nat 6068
0
nf_nat
18008 1 iptable_nat
iptable_mangle 3400
0
ip6t_REJECT 4620
2
nf_conntrack_ipv6 17548 2
ip6table_filter 3168
1
ip6_tables 11144
1 ip6table_filter
ipv6
239428 28 ip6t_REJECT,nf_conntrack_ipv6
ppdev
8200 0
parport_pc 22748
0
parport
29300 2 ppdev,parport_pc
i2c_piix4
11968 0
i2c_core
23160 1 i2c_piix4
pcnet32
28000 0
mii
4120 1 pcnet32
floppy
47700 0
BusLogic
61932 2
'System > Linux' 카테고리의 다른 글
[이만용의 Open Mind] 프로그래밍 지형도를 바꾸는「파이썬」 (0) | 2011.02.07 |
---|---|
linux - 정규 표현식 (0) | 2011.02.06 |
TCP wrappers (0) | 2011.01.25 |
리눅스 - xinetd과 서비스 (0) | 2011.01.25 |
리눅스 - xinetd (0) | 2011.01.25 |