Ускорьте SMB, изменив NTFS на ext4

1836
DanFromGermany

Я использую RaspberryPi с SMB и внешний жесткий диск USB для хранения. У меня есть только 2 МБ / с загрузки по нему (через Ethernet / WiFi).

После исследования я думаю, что NTFS на диске является узким местом, потому что ntfs.mount занимает 80-90% загрузки ЦП (процесс samba использует 10%).

Так что я, хотя переход на ext4 может ускориться.

Вот шаги, которые я выбрал, и я хотел бы знать, достаточно ли это безопасно или критично для потери данных или у вас есть предложения, которые улучшают общую целостность и производительность:

  1. tar и gzip 600GB хранят данные
  2. убедитесь, что архив не поврежден (используя это gunzip -c file.tar.gz | tar t > /dev/null)
  3. загрузить tar на мой веб-сервер через sftp
  4. проверьте еще раз архив все еще не поврежден
  5. переформатировать внешний жесткий диск
  6. скачать и распаковать файлы

Каковы будут шаги в соответствии с ответом Лю Вон Фука?

Вывод dfвыглядит следующим образом:

Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 1465135100 641848736 823286364 44% /stor 

В /etc/fstabпривод монтируется:

/dev/sda1 /stor ntfs defaults 0 1 
1

1 ответ на вопрос

1
phuclv

If the disk have available space I think it's much faster to use to resize the partition, create another ext4 partition on the new blank space and then move data from the NTFS to the ext4 partition. The process may need to be repeated 1 or 2 more times and after finished, the NTFS could be removed completely

Suppose you've used 600GB on a 1TB disk, then the detailed steps are like this

  • Resize the NTFS partition to the minimum possible size (i.e. ~600GB). This will leave a ~400GB unpartitioned space
  • Create a new 400GB ext4 partition in the blank space we've just created
  • Copy ~400GB of data to the new partition
  • Verify that the copy has finished successfully, then remove the copied data from the old partition after verifying that they're OK. Now the NTFS partition will have ~400GB more free space
  • Resize the NTFS partition again to the minimum size (~200GB)
  • Enlarge the ext4 partition to the newly created free space
  • Copy the remaining data to the ext4 partition and verify
  • Remove the NTFS partition and resize the ext4 partition to fill the remaining disk space

More information can be found in Convert filesystem NTFS -> EXT4?

I have zero experience using command-line partition resizing tools but the GUI disk partitioning tools work great. I've never lost data that way a single time. You'd better use a live boot USB with GUI to do the resizing. The fact that you don't have a GUI shouldn't be a problem because the HDD is external then why don't just plug it into another PC? In my experience 3rd party solutions like MiniTool Partition Wizard or EaseUS Partition Master (I'm not affiliated by any of them) work more reliable and a lot faster then gparted

However given that you have a lot of space available on your server, it's always good to have a backup. Your proposed way will work fine

You can also convert NTFS to ext3 directly in-place using anyconvertfs then use tune2fs to convert ext3 to ext4

See Is it safe to convert NTFS to ext2 with anyconvertfs?

Я действительно боюсь потерять данные. У меня также не установлен X, поэтому я должен использовать инструменты командной строки DanFromGermany 10 лет назад 1
Самое современное программное обеспечение для создания разделов дисков может помочь вам свободно изменять размеры разделов без потери данных. «С помощью GParted вы можете изменять размеры, копировать и перемещать разделы без потери данных» http://gparted.sourceforge.net/ Но, конечно, осторожность всегда лучше phuclv 10 лет назад 0
Кстати, я не смог использовать parted, NTFS повреждена. Я не могу порекомендовать другое решение, кроме создания большой резервной копии, даже если это займет намного больше времени. DanFromGermany 10 лет назад 0