分类: LINUX
2006-04-06 16:38:36
[root@shangxinying /]# cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
22 0 1664712 hdc 34 234 536 390 0 0 0 0 -7 1200130 39059382
22 1 1661152 hdc1 21 123 288 320 0 0 0 0 0 320 320
3 0 35407260 hda 7943 27289 185846 120150 3779 7664 34124 907150 -8 1160990 38887402
3 1 10241406 hda1 55 126 289 490 0 0 0 0 0 490 490
3 2 1 hda2 0 0 0 0 0 0 0 0 0 0 0
3 5 8193118 hda5 30 123 257 420 0 0 0 0 0 420 420
3 6 9799618 hda6 55 123 282 600 0 0 0 0 0 600 600
3 7 104391 hda7 25 71 192 380 8 3 22 1480 0 1820 1860
3 8 1020096 hda8 19 96 266 200 4 3 32 90 0 290 290
3 9 514048 hda9 13 41 168 140 0 0 0 0 0 140 140
3 10 514048 hda10 2243 11003 26492 30460 1105 3570 9366 408460 0 80160 438920
[root@shangxinying mnt]# fdisk -l
Disk /dev/hdc: 1704 MB, 1704665088 bytes
64 heads, 63 sectors/track, 825 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 824 1661152+ 6 FAT16
Disk /dev/hda: 36.2 GB, 36257034752 bytes
255 heads, 63 sectors/track, 4408 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1275 10241406 c Win95 FAT32 (LBA)
/dev/hda2 1276 4407 25157790 f Win95 Ext'd (LBA)
/dev/hda5 1276 2295 8193118+ b Win95 FAT32
/dev/hda6 2296 3515 9799618+ b Win95 FAT32
/dev/hda7 3516 3528 104391 83 Linux
/dev/hda8 3529 3655 1020096 83 Linux
/dev/hda9 3656 3719 514048+ 82 Linux swap
/dev/hda10 3720 3783 514048+ 83 Linux
没有找到u盘。
2.加载模块
cd /lib/modules/2.4.x-x/kernel/drivers
insmod sd_mod.o 此为usb驱动
3.再使用fdisk或cat /proc/partitiongs查看结果如下:
[root@shangxinying scsi]# cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
8 0 127232 sda 1 3 8 10 0 0 0 0 0 10 10
8 1 127216 sda1 0 0 0 0 0 0 0 0 0 0 0
22 0 1664712 hdc 34 234 536 390 0 0 0 0 -7 2327970 31164502
22 1 1661152 hdc1 21 123 288 320 0 0 0 0 0 320 320
3 0 35407260 hda 14112 42737 324414 170630 6449 15333 71062 1364060 -8
2286140 30372072
3 1 10241406 hda1 712 126 946 1340 0 0 0 0 0 1340 1340
3 2 1 hda2 0 0 0 0 0 0 0 0 0 0 0
3 5 8193118 hda5 1214 376 1694 3590 0 0 0 0 0 3540 3590
3 6 9799618 hda6 157 123 384 780 0 0 0 0 0 780 780
3 7 104391 hda7 26 71 194 400 12 5 34 3020 0 2790 3420
3 8 1020096 hda8 22 96 290 230 8 4 72 1280 0 1510 1510
3 9 514048 hda9 73 41 648 530 243 2009 18016 165470 0 145740 166000
3 10 514048 hda10 3546 12829 32750 39200 2175 7734 19834 504880 0 149280 544080
[root@shangxinying scsi]# fdisk -l
Disk /dev/sda: 130 MB, 130285568 bytes
8 heads, 32 sectors/track, 994 cylinders
Units = cylinders of 256 * 512 = 131072 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 994 127216 6 FAT16
Disk /dev/hdc: 1704 MB, 1704665088 bytes
64 heads, 63 sectors/track, 825 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 824 1661152+ 6 FAT16
Disk /dev/hda: 36.2 GB, 36257034752 bytes
255 heads, 63 sectors/track, 4408 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1275 10241406 c Win95 FAT32 (LBA)
/dev/hda2 1276 4407 25157790 f Win95 Ext'd (LBA)
/dev/hda5 1276 2295 8193118+ b Win95 FAT32
/dev/hda6 2296 3515 9799618+ b Win95 FAT32
/dev/hda7 3516 3528 104391 83 Linux
/dev/hda8 3529 3655 1020096 83 Linux
/dev/hda9 3656 3719 514048+ 82 Linux swap
/dev/hda10 3720 3783 514048+ 83 Linux
说明已经可以识别u盘了,设备名为/dev/sda1.
4. 挂载:
mount -t vfat /dev/sda1 /mnt/usb
但是这种方式下挂载的u盘上如果有汉字的话可能会显示乱码,可以用下面的命令解决该问题:
mount -o iocharset=cp936 /dev/sda1 /mnt/usb
5.谢载:
umount /dev/sda1
6.如果为了释放kernel资源想卸载模块:
rmmod sd_mod.o