LinuxでNTFSパフォーマンスを最適化する方法は?

LinuxでNTFSパフォーマンスを最適化する方法は?

私は次の仕様のノートブックでUbuntu 22.04.2を実行しています。

SSD:HP S700ソリッドステートドライブ
CPU:インテルCore i7 7700HQ
メモリ:16ギガバイト
コア:5.19.0-32 - 一般

2023年2月25日現在、すべてのシステムパッケージが最新バージョンに更新されました。 UbuntuはExt4パーティションにインストールされており、私のデータはWindows 10の使用中に作成されたNTFSパーティションに保存されます。 SSDは次のように認識されます。/dev/sdb

SSDとパーティションの詳細:
出力hdparm -I /dev/sdb

/dev/sdb:

ATA device, with non-removable media
    Model Number:       HP SSD S700 1TB                         
    Serial Number:      HASA42470101207     
    Firmware Revision:  V0823A0 
    Media Serial Num:   
    Media Manufacturer: 
    Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
    Used: unknown (minor revision code 0x011b) 
    Supported: 10 9 8 7 6 5 
    Likely used: 10
Configuration:
    Logical     max current
    cylinders   16383   16383
    heads       16  16
    sectors/track   63  63
    --
    CHS current addressable sectors:    16514064
    LBA    user addressable sectors:   268435455
    LBA48  user addressable sectors:  1953525168
    Logical  Sector size:                   512 bytes
    Physical Sector size:                   512 bytes
    Logical Sector-0 offset:                  0 bytes
    device size with M = 1024*1024:      953869 MBytes
    device size with M = 1000*1000:     1000204 MBytes (1000 GB)
    cache/buffer size  = unknown
    Form Factor: 2.5 inch
    Nominal Media Rotation Rate: Solid State Device
Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, no device specific minimum
    R/W multiple sector transfer: Max = 1   Current = 1
    Advanced power management level: 254
    DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
         Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4 
         Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
    Enabled Supported:
       *    SMART feature set
            Security Mode feature set
       *    Power Management feature set
       *    Write cache
       *    Look-ahead
       *    Host Protected Area feature set
       *    WRITE_BUFFER command
       *    READ_BUFFER command
       *    NOP cmd
       *    DOWNLOAD_MICROCODE
       *    Advanced Power Management feature set
       *    48-bit Address feature set
       *    Mandatory FLUSH_CACHE
       *    FLUSH_CACHE_EXT
       *    General Purpose Logging feature set
       *    WRITE_{DMA|MULTIPLE}_FUA_EXT
       *    {READ,WRITE}_DMA_EXT_GPL commands
       *    Segmented DOWNLOAD_MICROCODE
       *    Gen1 signaling speed (1.5Gb/s)
       *    Gen2 signaling speed (3.0Gb/s)
       *    Gen3 signaling speed (6.0Gb/s)
       *    Native Command Queueing (NCQ)
       *    Phy event counters
       *    READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
       *    DMA Setup Auto-Activate optimization
       *    Software settings preservation
       *    SMART Command Transport (SCT) feature set
       *    SANITIZE feature set
       *    BLOCK_ERASE_EXT command
       *    DOWNLOAD MICROCODE DMA command
       *    WRITE BUFFER DMA command
       *    READ BUFFER DMA command
       *    Data Set Management TRIM supported (limit 8 blocks)
Security: 
    Master password revision code = 65534
        supported
    not enabled
    not locked
        frozen
    not expired: security count
        supported: enhanced erase
    6min for SECURITY ERASE UNIT. 6min for ENHANCED SECURITY ERASE UNIT.
Checksum: correct

出力df -aTh

Filesystem     Type             Size  Used Avail Use% Mounted on
/dev/sdb2      ext4             162G   64G   90G  42% /
/dev/sdb1      fuseblk          760G  383G  378G  51% /mnt/DATA Laptop

出力findmnt --fstab

TARGET           SOURCE                                    FSTYPE OPTIONS
/                UUID=79debb50-d530-d801-70da-b150d530d801 ext4   errors=remount-ro
/mnt/DATA Laptop UUID=01D94304BCDF47E0                     ntfs   uid=1000,gid=1000,rw,user,exec,umask=000,x-gvfs-show

NTFSとExt4パーティションのパフォーマンスの違い:
以下を使用してベンチマークを実行するときKディスクマークどちらのパーティションでも、NTFSとExt4パーティションのパフォーマンス、特にランダムな読み取りと書き込みのパフォーマンスに大きな違いがあることがわかりました。

出力/dev/sdb2

                        KDiskMark (3.1.2): https://github.com/JonMagon/KDiskMark
                    Flexible I/O Tester (fio-3.28): https://github.com/axboe/fio
--------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes

[Read]
Sequential   1 MiB (Q=  8, T= 1):   517.054 MB/s [    504.9 IOPS] < 15813.82 us>
Sequential   1 MiB (Q=  1, T= 1):   500.349 MB/s [    488.6 IOPS] <  2044.34 us>
    Random   4 KiB (Q= 32, T= 1):   168.011 MB/s [  42002.8 IOPS] <   760.80 us>
    Random   4 KiB (Q=  1, T= 1):    28.314 MB/s [   7078.7 IOPS] <   139.87 us>

[Write]
Sequential   1 MiB (Q=  8, T= 1):   356.269 MB/s [    347.9 IOPS] < 24887.09 us>
Sequential   1 MiB (Q=  1, T= 1):   334.044 MB/s [    326.2 IOPS] <  2978.64 us>
    Random   4 KiB (Q= 32, T= 1):   184.879 MB/s [  46219.8 IOPS] <   665.75 us>
    Random   4 KiB (Q=  1, T= 1):    84.579 MB/s [  21144.9 IOPS] <    46.37 us>

Profile: Default
   Test: 1 GiB (x5) [Measure: 5 sec / Interval: 5 sec]
   Date: 2023-02-25 14:18:20
     OS: ubuntu 22.04 [linux 5.19.0-32-generic]

出力/dev/sdb1

                        KDiskMark (3.1.2): https://github.com/JonMagon/KDiskMark
                    Flexible I/O Tester (fio-3.28): https://github.com/axboe/fio
--------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes

[Read]
Sequential   1 MiB (Q=  8, T= 1):   484.235 MB/s [    472.9 IOPS] < 16879.14 us>
Sequential   1 MiB (Q=  1, T= 1):   494.241 MB/s [    482.7 IOPS] <  2068.27 us>
    Random   4 KiB (Q= 32, T= 1):    24.336 MB/s [   6084.1 IOPS] <  5255.13 us>
    Random   4 KiB (Q=  1, T= 1):    24.453 MB/s [   6113.4 IOPS] <   162.18 us>

[Write]
Sequential   1 MiB (Q=  8, T= 1):   313.461 MB/s [    306.1 IOPS] <  8380.51 us>
Sequential   1 MiB (Q=  1, T= 1):   313.816 MB/s [    306.5 IOPS] <   879.35 us>
    Random   4 KiB (Q= 32, T= 1):    78.391 MB/s [  19597.8 IOPS] <  1237.62 us>
    Random   4 KiB (Q=  1, T= 1):    77.982 MB/s [  19495.5 IOPS] <    37.17 us>

Profile: Default
   Test: 1 GiB (x5) [Measure: 5 sec / Interval: 5 sec]
   Date: 2023-02-25 14:14:16
     OS: ubuntu 22.04 [linux 5.19.0-32-generic]

NTFSパーティションがfuseblkシステムとして認識されるのを見ると、新しいカーネルドライバであるマウント以外のdfパーティションが使用されていると仮定します。説明したように、私のfstab FSTYPEをntfs3に変更します。ntfs-3gntfs3ここパフォーマンスを向上させますか? LinuxでNTFSのパフォーマンスを向上させるために他にできる方法はありますか?それ以外の場合、NTFSパーティションをExt4に非破壊的に変換する方法はありますか?

あなたの助けに事前に感謝し、良い一日を過ごしてください。

修正する:
ntfs3FSTYPEをinに設定すると、/etc/fstab実際にパフォーマンスが大幅に向上します。

KDiskMark出力/dev/sdb1

                        KDiskMark (3.1.2): https://github.com/JonMagon/KDiskMark
                    Flexible I/O Tester (fio-3.28): https://github.com/axboe/fio
--------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes

[Read]
Sequential   1 MiB (Q=  8, T= 1):   525.712 MB/s [    513.4 IOPS] < 15556.55 us>
Sequential   1 MiB (Q=  1, T= 1):   428.302 MB/s [    418.3 IOPS] <  2387.84 us>
    Random   4 KiB (Q= 32, T= 1):   237.324 MB/s [  59331.2 IOPS] <   538.66 us>
    Random   4 KiB (Q=  1, T= 1):    43.243 MB/s [  10810.8 IOPS] <    92.45 us>

[Write]
Sequential   1 MiB (Q=  8, T= 1):   495.466 MB/s [    483.9 IOPS] < 16344.70 us>
Sequential   1 MiB (Q=  1, T= 1):   372.929 MB/s [    364.2 IOPS] <  2591.59 us>
    Random   4 KiB (Q= 32, T= 1):   299.469 MB/s [  74867.4 IOPS] <   425.59 us>
    Random   4 KiB (Q=  1, T= 1):   135.961 MB/s [  33990.3 IOPS] <    27.96 us>

Profile: Default
   Test: 1 GiB (x5) [Measure: 5 sec / Interval: 5 sec]
   Date: 2023-02-25 15:45:46
     OS: ubuntu 22.04 [linux 5.19.0-32-generic]

ただし、マウントオプションをntfs3に変更すると、Proton依存パーティションでSteamゲームをプレイできなくなります。 ntfs-3gのntfsマウントオプションを使用している場合にのみ、このゲームを実行できます。

アップデート2:
protonと一緒にntfs3を使用して解決策を見つけたので、そのフラグをに残します/etc/fstab。 NTFSのパフォーマンスの向上や、Windowsと互換性のない、またはWindowsと互換性のないNTFSファイルシステムの変換に関する他の提案は歓迎されています。

ベストアンサー1

あなたの投稿に見られるように、古いSATA SSDが使用されます。私の場合、Ubuntu 23.04でM.2スロットを持つNVME SSDを使用してもntfs3パフォーマンスの向上はありません。

KDiskMarkのGUIバージョンをauto使用して、ファイルシステムタイプを使用して2000MB / s以上を取得しました。ntfs3

私のドライブの速度は約7000MB / sですext4。両方のSSDドライブはマザーボードに直接接続されています。

ここに画像の説明を入力してください。

ここに画像の説明を入力してください。

おすすめ記事