Speedup SMB by changing NTFS to ext4

1

I'm using a RaspberryPi with SMB and an external USB HDD for storage. I have only 2MB/s upload on it (via Ethernet/WiFi).

After investigating, I think NTFS on the storage drive is the bottleneck, because the ntfs.mount takes up 80-90% CPU usage (samba process uses 10%).

So I though changing to ext4 might speed up.

These are the steps I chose and I'd like to know if this is rather safe or critical in loss of data or if you have suggestions which improve the overall integrity and performance:

  1. tar and gzip 600GB stored data
  2. verify the archieve is not corrupt (using this gunzip -c file.tar.gz | tar t > /dev/null)
  3. upload the tar to my webserver via sftp
  4. check again the archieve is still in not corrupt
  5. reformat the external hdd
  6. download and extract the files

What would the steps be according to Lưu Vĩnh Phúc answer?

The output of dfis as follows:

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

In /etc/fstab the drive is mounted:

/dev/sda1       /stor           ntfs    defaults          0       1

Daniel W.

Posted 2013-09-11T06:11:46.413

Reputation: 1 462

Answers

1

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?

phuclv

Posted 2013-09-11T06:11:46.413

Reputation: 14 930

1I'm really afraid of losing data. I don't have X installed either so I have to use command line tools – Daniel W. – 2013-09-11T07:04:36.797

most modern disk partitioning software can help you freely resize partitions without loosing data. "With GParted you can resize, copy, and move partitions without data loss" http://gparted.sourceforge.net/ But ofcourse carefulness is always better

– phuclv – 2013-09-11T07:10:22.190

BTW, I failed using parted, NTFS corrupted. I cannot recommend other solution than doing a big backup even if it takes long its way safer. – Daniel W. – 2013-12-09T15:54:10.860