U盘格成ext4后怎么就这点写入速度?

CPU/显卡/打印机/USB设备等硬件问题
回复
头像
wangchaoran
帖子: 764
注册时间: 2011-11-18 21:41
系统: kubuntu 13.4 amd64
来自: China

U盘格成ext4后怎么就这点写入速度?

#1

帖子 wangchaoran » 2012-10-02 17:47

刚刚把4g的u盘格成ext4,往里面写入一个3.2g的文件,然后去干其他事了.二十分钟后,我回来了但那进度让我大跌眼睛:20分钟才写了1.6g,速度才1.2m/s,在这之前这块优盘用fat32写入速度也能到10m,而且用ext4也实现了4k对齐,这速度只有我那使用TLC NAND内存卡速度的三分之一,而我这优盘是正品金士顿DT101 4g,用的是MLC NAND,这是什么原因?我写此帖时文件还在拷着,速度依然为1.2m/s.

代码: 全选

The best way to predict the future is to invent it.
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

Re: U盘格成ext4后怎么就这点写入速度?

#2

帖子 cuihao » 2012-10-02 17:49

什么对齐啦换格式啦,对读写速度影响都不大。可能是出了点啥硬件问题,退化成USB1.1了……
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
funicorn
帖子: 1318
注册时间: 2005-09-13 4:56
系统: Ubuntu Jammy Jellyfi

Re: U盘格成ext4后怎么就这点写入速度?

#3

帖子 funicorn » 2012-10-02 18:00

cuihao 写了:什么对齐啦换格式啦,对读写速度影响都不大。可能是出了点啥硬件问题,退化成USB1.1了……
usb1.1的速度怎么可能到1M/s
头像
wangchaoran
帖子: 764
注册时间: 2011-11-18 21:41
系统: kubuntu 13.4 amd64
来自: China

Re: U盘格成ext4后怎么就这点写入速度?

#4

帖子 wangchaoran » 2012-10-02 18:02

代码: 全选

wangchaoran@kubuntu:~$ lsusb -v

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            3.02
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0001 1.1 root hub
  bcdDevice            3.02
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval             255

Bus 002 Device 002: ID 0951:1642 Kingston Technology 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0951 Kingston Technology
  idProduct          0x1642 
  bcdDevice            0.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
lsusb -v 的返回结果写的我的u盘用的就是usb2.0啊?不过,现在文件终于拷完了,不过还在写缓存.

代码: 全选

The best way to predict the future is to invent it.
头像
wangchaoran
帖子: 764
注册时间: 2011-11-18 21:41
系统: kubuntu 13.4 amd64
来自: China

Re: U盘格成ext4后怎么就这点写入速度?

#5

帖子 wangchaoran » 2012-10-02 18:04

更确切的是这一段第六行

代码: 全选

Bus 002 Device 002: ID 0951:1642 Kingston Technology
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0951 Kingston Technology
  idProduct          0x1642
  bcdDevice            0.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1

代码: 全选

The best way to predict the future is to invent it.
jtshs256
帖子: 22323
注册时间: 2010-07-19 21:41
系统: OS X

Re: U盘格成ext4后怎么就这点写入速度?

#6

帖子 jtshs256 » 2012-10-02 18:04

dmesg 出来些什么?
躺平
头像
wangchaoran
帖子: 764
注册时间: 2011-11-18 21:41
系统: kubuntu 13.4 amd64
来自: China

Re: U盘格成ext4后怎么就这点写入速度?

#7

帖子 wangchaoran » 2012-10-02 18:35

dmesg返回结果太多,我只贴出与我优盘有关的一部分:
[23711.544075] usb 1-5: new high-speed USB device number 2 using ehci_hcd
[23712.102413] Initializing USB Mass Storage driver...
[23712.102716] scsi6 : usb-storage 1-5:1.0
[23712.102908] usbcore: registered new interface driver usb-storage
[23712.102913] USB Mass Storage support registered.
[23713.101160] scsi 6:0:0:0: Direct-Access Kingston DT 101 G2 1.00 PQ: 0 ANSI: 2
[23713.102516] sd 6:0:0:0: Attached scsi generic sg2 type 0
[23713.106353] sd 6:0:0:0: [sdb] 7815168 512-byte logical blocks: (4.00 GB/3.72 GiB)
[23713.106984] sd 6:0:0:0: [sdb] Write Protect is off
[23713.106992] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
[23713.110559] sd 6:0:0:0: [sdb] No Caching mode page present
[23713.110568] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[23713.117758] sd 6:0:0:0: [sdb] No Caching mode page present
[23713.117762] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[23713.562026] sdb: sdb1
[23713.564220] sd 6:0:0:0: [sdb] No Caching mode page present
[23713.564224] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[23713.564227] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[23718.781262] device label btrfs devid 1 transid 50 /dev/sdb1
[23744.590519] WARNING! power/level is deprecated; use power/control instead
[23744.668204] usb 1-5: USB disconnect, device number 2
[23745.040087] usb 2-5: new full-speed USB device number 2 using ohci_hcd
[23745.241163] usb 2-5: not running at top speed; connect to a high speed hub
[23745.262486] scsi7 : usb-storage 2-5:1.0
[23746.269252] scsi 7:0:0:0: Direct-Access Kingston DT 101 G2 1.00 PQ: 0 ANSI: 2
[23746.273161] sd 7:0:0:0: Attached scsi generic sg2 type 0
[23746.283226] sd 7:0:0:0: [sdb] 7815168 512-byte logical blocks: (4.00 GB/3.72 GiB)
[23746.290194] sd 7:0:0:0: [sdb] Write Protect is off
[23746.290205] sd 7:0:0:0: [sdb] Mode Sense: 23 00 00 00
[23746.298400] sd 7:0:0:0: [sdb] No Caching mode page present
[23746.298412] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[23746.337189] sd 7:0:0:0: [sdb] No Caching mode page present
[23746.337200] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[23746.484275] sdb: sdb1
[23746.513216] sd 7:0:0:0: [sdb] No Caching mode page present
[23746.513227] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[23746.513235] sd 7:0:0:0: [sdb] Attached SCSI removable disk
[23750.208202] device label btrfs devid 1 transid 53 /dev/sdb1
[24293.772241] EXT4-fs error (device loop0): ext4_mb_generate_buddy:739: group 18, 2042 clusters in bitmap, 2043 in gd
[24293.772270] JBD2: Spotted dirty metadata buffer (dev = loop0, blocknr = 0). There's a risk of filesystem corruption in case of system crash.
[24293.811010] EXT4-fs error (device loop0): ext4_mb_generate_buddy:739: group 3, 1264 clusters in bitmap, 1616 in gd
[24293.811662] EXT4-fs error (device loop0): ext4_mb_generate_buddy:739: group 2, 3096 clusters in bitmap, 2377 in gd
[24293.812719] EXT4-fs error (device loop0): ext4_mb_generate_buddy:739: group 33, 26717 clusters in bitmap, 19824 in gd
[24293.812731] JBD2: Spotted dirty metadata buffer (dev = loop0, blocknr = 0). There's a risk of filesystem corruption in case of system crash.
[24293.824579] EXT4-fs error (device loop0): ext4_mb_generate_buddy:739: group 12, 28905 clusters in bitmap, 30208 in gd
[24293.829509] JBD2: Spotted dirty metadata buffer (dev = loop0, blocknr = 0). There's a risk of filesystem corruption in case of system crash.
[24782.461202] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
[25224.421297] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
wangchaoran@kubuntu:~$

[/code]
里面有error

代码: 全选

The best way to predict the future is to invent it.
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

Re: U盘格成ext4后怎么就这点写入速度?

#8

帖子 cuihao » 2012-10-02 18:42

funicorn 写了:
cuihao 写了:什么对齐啦换格式啦,对读写速度影响都不大。可能是出了点啥硬件问题,退化成USB1.1了……
usb1.1的速度怎么可能到1M/s
https://zh.wikipedia.org/wiki/USB#USB_1.0
12 Mbit/s (Full-Speed)
1.5MB/s
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
funicorn
帖子: 1318
注册时间: 2005-09-13 4:56
系统: Ubuntu Jammy Jellyfi

Re: U盘格成ext4后怎么就这点写入速度?

#9

帖子 funicorn » 2012-10-02 20:27

你知道啥叫Bit,啥叫Byte不
更何况下面说USB2.0增加更高的数据传输速率480 Mbit/s(现在称作Hi-Speed),也就是60M/s,这种usb2.0的u盘你见过?
那页面上说的那是端口的的传输速率,不是存储设备的传输速率,你弄个usb1.1接硬盘,速度当然能快一些,可是现在说的是U盘,不是移动硬盘。
jtshs256
帖子: 22323
注册时间: 2010-07-19 21:41
系统: OS X

Re: U盘格成ext4后怎么就这点写入速度?

#10

帖子 jtshs256 » 2012-10-02 20:31

诡异的输出 :em20
没见过
fsck 下吧
躺平
jtshs256
帖子: 22323
注册时间: 2010-07-19 21:41
系统: OS X

Re: U盘格成ext4后怎么就这点写入速度?

#11

帖子 jtshs256 » 2012-10-02 20:35

说到传输速度一直没搞懂
有块支持 USB3.0 的移动硬盘,接在 2.0 口的机器上连续写也就 30多M/s
插在 3.0 口的机器上却更快(说明硬盘还能写的更快)
明明还没到 2.0 传输速度的上限,为什么会有这种差异? :em20
躺平
头像
wangchaoran
帖子: 764
注册时间: 2011-11-18 21:41
系统: kubuntu 13.4 amd64
来自: China

Re: U盘格成ext4后怎么就这点写入速度?

#12

帖子 wangchaoran » 2012-10-02 21:21

现在重新写一个1.6G文件速度又升到11m/s了。lsusb -v的输出显示还是Full-speed.

趁着回答楼上的问题,原因是你机器的usb2.0控制器的问题,不过usb2.0控制器普遍都这速度。

代码: 全选

The best way to predict the future is to invent it.
alanfly
帖子: 334
注册时间: 2007-12-19 16:15

Re: U盘格成ext4后怎么就这点写入速度?

#13

帖子 alanfly » 2012-10-02 21:36

jtshs256 写了:说到传输速度一直没搞懂
有块支持 USB3.0 的移动硬盘,接在 2.0 口的机器上连续写也就 30多M/s
插在 3.0 口的机器上却更快(说明硬盘还能写的更快)
明明还没到 2.0 传输速度的上限,为什么会有这种差异? :em20
说是由于bot传输协议usb2.0实际上是半双工的,60MB的理论速度就只剩下30MB左右了。
回复