V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
fuxkcsdn
V2EX  ›  问与答

ntfs-3g写入速度很慢?

  •  
  •   fuxkcsdn · 2013-11-30 17:40:44 +08:00 · 6766 次点击
    这是一个创建于 3827 天前的主题,其中的信息可能已经有所发展或是发生改变。
    系统Debian 7.2.0 AMD64
    ntfs-3g 2012.1.15AR.5 external FUSE 29
    CPU E3-1230 V2
    内存 ECC 8G * 2

    挂载在内部SATA接口上(sata_1),当格式化为ext4时,用rsync拷贝iso文件,平均速度可以达到150+MB/S
    sent 23693369613 bytes received 31 bytes 163967956.01 bytes/sec

    格式化为ntfs后,拷贝同样的文件,速度只有50+MB/S...这速度也差太多了吧...

    sent 23693369613 bytes received 31 bytes 57718318.26 bytes/sec

    ntfs格式传输的时候,CPU使用率也就40~50%左右

    是ntfs-3g写入本来就那么慢??还是我哪里设置有问题??
    第 1 条附言  ·  2013-11-30 19:41:13 +08:00
    尝试了下商业软件
    NTFS&HFS for Linux 8.9 Express(对个人免费)
    速度立马提升到160+MB/S!!!

    root@server:/# mkfs.ntfs -f /dev/sdb1
    root@server:/# mount
    /dev/sdb1 on /media/2t type ufsd (rw,relatime,nls=utf8)
    root@server:/# sync
    root@server:/# rsync -r --progress /home/user/test.iso /media/2t/
    sending incremental file list
    test.iso
    23690477568 100% 161.45MB/s 0:02:19 (xfer#1, to-check=0/1)

    sent 23693369613 bytes received 31 bytes 168636082.88 bytes/sec
    total size is 23690477568 speedup is 1.00
    root@server:/# time sync

    real 0m14.761s
    user 0m0.004s
    sys 0m0.000s
    7 条回复    1970-01-01 08:00:00 +08:00
    orzfly
        1
    orzfly  
       2013-11-30 17:53:14 +08:00
    两个测试都是同步写入的没有开缓存么?
    fuxkcsdn
        2
    fuxkcsdn  
    OP
       2013-11-30 17:59:23 +08:00
    @orzfly
    具体操作步骤如下
    # parted /dev/sdb
    (parted) mklabel gpt
    (parted) mkpart
    (parted) ntfs
    (parted) 0%
    (parted) 100%
    (parted) quit
    # mkfs.ntfs -f /dev/sdb1
    # mount.ntfs /dev/sdb1 /media/2t
    # rsync -r --progress /home/user/test.iso /media/2t
    # umount /media/2t
    # mkfs.ext4 /dev/sdb1
    # mount /dev/sdb1 /media/2t
    # rsync -r --progress /home/user/test.iso /media/2t

    都是默认的,没开什么缓存(除非是默认有开启)
    fuxkcsdn
        3
    fuxkcsdn  
    OP
       2013-11-30 18:01:10 +08:00
    BTW,即使是在ext4复制完后,再格式化成ntfs,然后再测试,速度依旧
    orzfly
        4
    orzfly  
       2013-11-30 18:21:01 +08:00
    试试在 rsync 完之后运行 time sync 强制缓存写入硬盘看看时间?

    为了尽量准确记得在 rsync 之前先运行 sync 一下。
    fuxkcsdn
        5
    fuxkcsdn  
    OP
       2013-11-30 18:39:01 +08:00
    @orzfly 速度一样是那么慢...

    root@server:/# mkfs.ntfs -f /dev/sdb1
    Cluster size has been automatically set to 4096 bytes.
    Creating NTFS volume structures.
    mkntfs completed successfully. Have a nice day.

    root@server:/# parted -l
    Model: ATA WDC WD2000FYYZ-0 (scsi)
    Disk /dev/sdb: 2000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 1049kB 2000GB 2000GB ntfs 2t

    root@server:/# sync

    root@server:/# mount.ntfs /dev/sdb1 /media/2t/

    root@server:/# mount
    /dev/sdb1 on /media/2t type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

    root@server:/# sync

    root@server:/# rsync -r --progress /home/user/test.iso /media/2t/
    sending incremental file list
    test.iso
    23690477568 100% 55.78MB/s 0:06:45 (xfer#1, to-check=0/1)

    sent 23693369613 bytes received 31 bytes 58430011.45 bytes/sec
    total size is 23690477568 speedup is 1.00

    root@server:/# time sync

    real 0m0.361s
    user 0m0.024s
    sys 0m0.000s
    orzfly
        6
    orzfly  
       2013-11-30 20:51:16 +08:00
    @fuxkcsdn 额,我的意思是指比较一下 ext4 和 NTFS 卷在 rsync 完成之后 sync 消耗的时间……

    如果 ext4 支持缓存而 ntfs-3g 不支持缓存,那么前者在 sync 时会消耗一定时间而后者几乎不消耗时间。
    orzfly
        7
    orzfly  
       2013-11-30 20:52:23 +08:00
    你看你商业软件 NTFS & HFS for Linux 8.9 Express 强制写入缓存花了 real 0m14.761s
    而 ntfs-3g 的只花了 real 0m0.361s

    很明显前者开了缓存后者没开缓存。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2984 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:23 · PVG 19:23 · LAX 04:23 · JFK 07:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.