QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1478|回复: 3

REDHAT9.0使用U盘和MP3(SCSI)之全程攻略

[复制链接]
发表于 2005-11-16 09:03:35 | 显示全部楼层 |阅读模式
在REDHAT9.0中使用U盘(USB)和MP3对我这个菜鸟来说一直是个老大难.在LINUX社区中看了些贴子,介绍的不是很全面.一知半解,不能解决我的MP3的挂载问题.连好MP3和电脑,看到连接状态正常,和在WINDOWS中一样,但不能识别使用.经过摸索思考,终于如愿以偿.咱们老百姓啊,今个真高兴,真高兴呀,真高兴.嘿嘿.OK.言归正传,为学习研究之便,将过程以添加注释方式原封不动展示如下:
[root@catinsunshine root]# mount /dev/hda9 /mnt/harddiskf   #这是我的WINDOWS中个F盘,FAT32格式,挂载到/mnt/harddiskf目录下
[root@catinsunshine root]# mkdir /mnt/usb                   #建立USB文件夹,以便将U盘内容挂载到此文件夹做准备
[root@catinsunshine root]# dmesg|grep -i usb              #dmesg显示启动信息. 执行结果为空.没有USB设备加载信息.
[root@catinsunshine root]# modprobe usb-uhci             #以下两条命令加载USB的驱动模块.
[root@catinsunshine root]# modprobe usb-storage           #usb-uhci/usb-storage为USB的驱动模块.可用lsmod查看加载的模块内容
[root@catinsunshine root]# fdisk -l /dev/sd?              #显示U盘加载后对应硬盘上的设备文件.

Disk /dev/sda: 125 MB, 125682176 bytes             #显示对应的位置为sda设备文件
4 heads, 60 sectors/track, 1022 cylinders
Units = cylinders of 240 * 512 = 122880 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   ?   3242233   7998524 570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(3242232, 3, 49)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(7998523, 0, 19)
Partition 1 does not end on cylinder boundary.
/dev/sda2   ?    702874   8769658 968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(702873, 0, 3)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(8769657, 1, 22)
Partition 2 does not end on cylinder boundary.
/dev/sda3   ?   7791173  15857957 968014096   79  Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(7791172, 3, 6)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(15857956, 3, 37)
Partition 3 does not end on cylinder boundary.
/dev/sda4   ?         1  15155111 1818613248    d  Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(15155110, 1, 36)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order
[root@catinsunshine root]# fdisk -l dev/sda             #dev前没加/,sda后没加空格致命令运行错误.常见错误.
[root@catinsunshine root]# fdisk -l /dev/sda            #正确的命令

Disk /dev/sda: 125 MB, 125682176 bytes
4 heads, 60 sectors/track, 1022 cylinders
Units = cylinders of 240 * 512 = 122880 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   ?   3242233   7998524 570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(3242232, 3, 49)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(7998523, 0, 19)
Partition 1 does not end on cylinder boundary.
/dev/sda2   ?    702874   8769658 968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(702873, 0, 3)
[root@catinsunshine root]# fdisk -l                #显示所有已经加载的设备文件

Disk /dev/sda: 125 MB, 125682176 bytes
4 heads, 60 sectors/track, 1022 cylinders
Units = cylinders of 240 * 512 = 122880 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   ?   3242233   7998524 570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(3242232, 3, 49)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(7998523, 0, 19)
Partition 1 does not end on cylinder boundary.
/dev/sda2   ?    702874   8769658 968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(702873, 0, 3)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(8769657, 1, 22)
Partition 2 does not end on cylinder boundary.
/dev/sda3   ?   7791173  15857957 968014096   79  Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(7791172, 3, 6)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(15857956, 3, 37)
Partition 3 does not end on cylinder boundary.
/dev/sda4   ?         1  15155111 1818613248    d  Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(15155110, 1, 36)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1             1      1020   8193118+   b  Win95 FAT32
/dev/hda2          1021      4865  30884962+   f  Win95 Ext'd (LBA)
/dev/hda5          1021      2295  10241406    b  Win95 FAT32
/dev/hda6          2296      2958   5325516    b  Win95 FAT32
/dev/hda7          2959      3220   2104483+  82  Linux swap
/dev/hda8   *      3221      3570   2811343+  83  Linux
/dev/hda9          3571      4865  10402056    b  Win95 FAT32
[root@catinsunshine root]# mount -t msdos /dev/sda1 /mnt/usb      #加载系统格式错误.不是MSDOS
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       or too many mounted file systems
[root@catinsunshine root]# mount -t msdos /dev/sda2 /mnt/usb      #试用设备文件sda2,结果失败
mount: ?????
[root@catinsunshine root]# cd /mnt/usb                         #进入文件夹/mnt/usb,可用 mkdir /mnt/usb建立.
[root@catinsunshine usb]# ls                                 #ls显示usb文件夹内容.结果为空.加载MP3失败.
[root@catinsunshine usb]# cd ..                               #退出usb进入mnt文件夹
[root@catinsunshine mnt]# modprobe scsi_mod                   #加载scsi_mod驱动模块**成功关键.我的MP3是SCSI硬盘**
[root@catinsunshine mnt]# modprob sd_mod                     #加载sd_mod 驱动模块,不清楚这个模块的作用.看网上有加的.
bash: modprob: command not found                           #modprobe少加了一个e,命令运行错误.
[root@catinsunshine mnt]# modprobe sd_mod                    #正确命令
[root@catinsunshine mnt]# cat /proc/scsi/scsi                     #用cat命令查看文件内容.
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: GENERIC  Model: USB DISK DEVICE  Rev: 1.00    #O?看到USB DISK DEVICE,莫非这就是MP3?
  Type:   Direct-Access             ANSI SCSI revision: 02    # 果然是SCSI硬盘.失败,现在才知道MP3的是SCSI格式的.汗!
[root@catinsunshine mnt]# lsmod                              #显示已加载的模块
Module                  Size  Used by    Not tainted
msdos                   8140   0  (autoclean)
sd_mod                 13516   0  (autoclean)             #sd_mod模块    | 最关键的四个模块  
usb-storage            69332   0                         #usb-storage模块 | 看来前的努力没白费   
scsi_mod              107160   2  [sd_mod usb-storage]     #scsi_mod模块   |  回忆一下加载命令:
usb-uhci               26348   0  (unused)                #usb-uhci模块   |   modprobe 模块名   
usbcore                78784   0  [usb-storage usb-uhci]
nls_iso8859-1           3516   1  (autoclean)
nls_cp437               5116   1  (autoclean)
vfat                   13004   1  (autoclean)
fat                    38808   0  (autoclean) [msdos vfat]
i810_audio             27720   1  (autoclean)
ac97_codec             13640   0  (autoclean) [i810_audio]
soundcore               6404   2  (autoclean) [i810_audio]
mousedev                5492   1  (autoclean)
input                   5856   0  (autoclean) [mousedev]
parport_pc             19076   1  (autoclean)
lp                      8996   0  (autoclean)
parport                37056   1  (autoclean) [parport_pc lp]
autofs                 13268   0  (autoclean) (unused)
ipt_REJECT              3928   6  (autoclean)
iptable_filter          2412   1  (autoclean)
ip_tables              15096   2  [ipt_REJECT iptable_filter]
ext3                   70784   1
jbd                    51892   1  [ext3]
[root@catinsunshine mnt]# fdisk -l /dev/sd?                    #再看一下               

Disk /dev/sda: 125 MB, 125682176 bytes
4 heads, 60 sectors/track, 1022 cylinders
Units = cylinders of 240 * 512 = 122880 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   ?   3242233   7998524 570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(3242232, 3, 49)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(7998523, 0, 19)
Partition 1 does not end on cylinder boundary.
/dev/sda2   ?    702874   8769658 968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(702873, 0, 3)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(8769657, 1, 22)
Partition 2 does not end on cylinder boundary.
/dev/sda3   ?   7791173  15857957 968014096   79  Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(7791172, 3, 6)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(15857956, 3, 37)
Partition 3 does not end on cylinder boundary.
[root@catinsunshine mnt]# fdisk -l /dev/sda4                 #sda1~3都不行,蒙个sda4试一下   

Disk /dev/sda4: 1862.2 GB, 1862259965952 bytes          #倒,还真有货唉!看来有戏.
4 heads, 60 sectors/track, 15155110 cylinders
Units = cylinders of 240 * 512 = 122880 bytes

     Device Boot    Start       End    Blocks   Id  System
/dev/sda4p1   ?   3242233   7998524 570754815+  72  Unknown
Partition 1 does not end on cylinder boundary.
/dev/sda4p2   ?    702874   8769658 968014120   65  Novell Netware 386
Partition 2 does not end on cylinder boundary.
/dev/sda4p3   ?   7791173  15857957 968014096   79  Unknown
Partition 3 does not end on cylinder boundary.
/dev/sda4p4   ?         1  15155111 1818613248    d  Unknown
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order
[root@catinsunshine mnt]# mount -t vfat /dev/sda4 /mnt/usb  #MP3是fat32格式的,用vfat标示类型.我再蒙!
[root@catinsunshine mnt]# cd usb                       #哇噻,没有错误提示耶!快进去看看!
[root@catinsunshine usb]# ls                           #显示文件
linux  music                                           #耶,嘿嘿,哈哈.天啊,我终于看到你了.成功了!


Ok.回过头来回顾一下,几个关键所在:
root@catinsunshine root]# dmesg|grep -i usb
[root@catinsunshine root]# modprobe usb-uhci
[root@catinsunshine root]# modprobe usb-storage
[root@catinsunshine mnt]# modprobe sd_mod  
[root@catinsunshine mnt]# modprobe scsi_mod
[root@catinsunshine mnt]# cat /proc/scsi/scsi
[root@catinsunshine root]# fdisk -l /dev/sd?
[root@catinsunshine mnt]# fdisk -l /dev/sda4
[root@catinsunshine mnt]# mount -t vfat /dev/sda4 /mnt/usb
总结.一般来说如果,连接USB,redhat 不能识别是因为驱动模块没有加载.其中最关键的四个模块为:
usb-uhci/usb-storage/sd_mod/scsi_mod.

有个小问题如下:
控制中心-->信息-->SCSI 内容显示如下.(但在USB设备里看不到内容)
Attached devices:
Host:scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: GENERIC Model: USB DISK DEVICE Rev: 1.00
  Type: Direct-Access              ANSI SCSI revision:02

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2005-11-16 16:21:17 | 显示全部楼层
晕,昨晚辛苦一夜,连个回复的也没有.我当时为解决这问题,头都大了.到处找资料.算了,我自己顶一下吧.
回复

使用道具 举报

发表于 2005-11-18 00:26:39 | 显示全部楼层
我用 FC2 都已经感到跟不上时代了!
老兄,要与时俱进!
这种问题到了 kernel-2.6 上就不再是问题了!
回复

使用道具 举报

发表于 2005-11-19 18:18:00 | 显示全部楼层
但是我一挂我的读卡器就。。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-23 18:29 , Processed in 0.106415 second(s), 17 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表