Username: Password:

Linux下将E680i作为u盘使用
来源: ChinaUnix博客  作者: ChinaUnix博客   发布时间:2008-04-24 08:23:45

将E680i以“大容量存储”模式使用usb电缆联接到linux主机后,在linux主机上使用fdisk -l能够显示出联接的任何硬盘,包括E680i的内存和flash卡。
blueice:~# fdisk -l
Disk /dev/hda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        1824    14651248+  83  Linux
/dev/hda2   *        1825        3649    14659312+   7  HPFS/NTFS
/dev/hda3            3650        5472    14643247+  83  Linux
/dev/hda4            5473       19929   116125852+   5  Extended
/dev/hda5            5473        5722     2008093+  82  Linux swap / So
laris
/dev/hda6            5723        8762    24418768+  83  Linux
/dev/hda7            8763       13626    39070048+  83  Linux
/dev/hda8           13627       16666    24418768+   c  W95 FAT32 (LBA)
/dev/hda9           16667       19929    26210016   83  Linux
Disk /dev/sda: 50 MB, 50331648 bytes
16 heads, 8 sectors/track, 768 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         768       49148    6  FAT16
Disk /dev/sdb: 1030 MB, 1030225920 bytes
4 heads, 3 sectors/track, 167680 cylinders
Units = cylinders of 12 * 512 = 6144 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      130209      781252+   6  FAT16
/dev/sdb2          130210      146486       97662   82  Linux swap / So                                                                    laris
/dev/sdb3          146487      167680      127164   83  Linux
blueice:~# fdisk -l
Disk /dev/hda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        1824    14651248+  83  Linux
/dev/hda2   *        1825        3649    14659312+   7  HPFS/NTFS
/dev/hda3            3650        5472    14643247+  83  Linux
/dev/hda4            5473       19929   116125852+   5  Extended
/dev/hda5            5473        5722     2008093+  82  Linux swap / Solaris
/dev/hda6            5723        8762    24418768+  83  Linux
/dev/hda7            8763       13626    39070048+  83  Linux
/dev/hda8           13627       16666    24418768+   c  W95 FAT32 (LBA)
/dev/hda9           16667       19929    26210016   83  Linux
Disk /dev/sda: 50 MB, 50331648 bytes
16 heads, 8 sectors/track, 768 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         768       49148    6  FAT16
Disk /dev/sdb: 1030 MB, 1030225920 bytes
4 heads, 3 sectors/track, 167680 cylinders
Units = cylinders of 12 * 512 = 6144 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      130209      781252+   6  FAT16
/dev/sdb2          130210      146486       97662   82  Linux swap / Solaris
/dev/sdb3          146487      167680      127164   83  Linux
从结果的输出能够看出,CF卡分了3个区,第一个是fat16分区,第二个是swap分区,第三个是ext3分区。
在/etc/fstab中添加如下内容
/dev/sda1       /mnt/ia          vfat    codepage=936,iocharset=cp936,noauto   0       0
/dev/sdb1       /mnt/ib          vfat    codepage=936,iocharset=cp936,noauto   0       0
并建立/mnt/ia和/mnt/ib两个目录。就能够使用mount /mnt/ia和/mnt/ib挂载E680i的两个分区了。
分区挂载后能够看查看分区里边的内容:
blue_stone@blueice:/mnt/ia/preload$ ls -al
总计 34
drwxr-xr-x  9 root root  2048 2005-04-04 20:55 .
drwxr-xr-x 12 root root 16384 1970-01-01 08:00 ..
drwxr-xr-x  2 root root  2048 2005-04-04 20:58 mp3
drwxr-xr-x  2 root root  2048 2005-04-04 20:58 动画
drwxr-xr-x  2 root root  2048 2005-04-04 20:58 墙纸
drwxr-xr-x  7 root root  2048 2005-04-04 20:58 彩信贺卡
drwxr-xr-x  2 root root  2048 2005-04-04 20:58 视频
drwxr-xr-x  2 root root  4096 2005-04-04 20:58 铃音
drwxr-xr-x  2 root root  2048 2005-04-04 20:58 音乐
我使用的字符集是GBK的,配置有如下环境变量:
LC_ALL=zh_CN.GBK
LANG=zh_CN.GBK
LANGUAGE=zh_CN.GBK


喜欢本文,那就收藏到:

    Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
相关评论  我也要评论
还没有关于此文章的相关评论!
  • 昵称: (为空则显示guest)
  • 评论分数: ★ ★ ★★★ ★★★★ ★★★★★
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  • 导航
    赞助商
    文章类别
    订阅