Gabri3lZ / SwitchrootAndroidUtils

Utils for Switchroots LineageOS Android ROM for Nintendo Switch
MIT License
45 stars 4 forks source link

Bug: slow partition flashing (dd writes) #3

Closed mchubby closed 5 years ago

mchubby commented 5 years ago

What happens?

Transfer is capped around 4MB/s for each copied android partition

Your settings

Other details:

dd uses a 512-byte sector size, making such copies several orders of magnitude slower.

mchubby commented 5 years ago

Note: you can use iflag=skip_bytes to specify the unit of skip directly as bytes (not as blocks)

Gabri3lZ commented 5 years ago

I changed it to 1M and used iflag=skip_bytes,count_bytes. But in my case this caused a strange issue that the whole stream was cached nearly instantanious in memory (2 GiB) and from then on the dd command was not responding untill it finished.

This is why I also added oflag=direct (this was mentioned in a discussion on LinuxQuestions. I did not see a speed difference with this option.

Let me know if this fixes the issue for you.

mchubby commented 5 years ago

It definitely works better, albeit it did not improve as much as I thought. It now transfers at 8 MB/s, so it must be the card reader or memory interface that is slow: It is pretty much what I get when transmitting a file onto the FAT partition with dd, or with a file copy via fuse (past the initial caching). The card is a 128GB Samsung Evo Plus (2017) and sustains 65-70 MB/s sequential writes on a W10 laptop. I will try to pop a livecd on this one and see how it fares.

Regarding the other improvement, the new lsblk filter works rather well, however it shows ram0 etc. devices (major # 1) which are "disks" but not really.

Gabri3lZ commented 5 years ago

How is the performance if you remove the oflag=direct? More or less the same?

For the RAM devices, maybe I should consider inclusion instead of exclusion afterall. I just don't have the setup to test all these variations.

mchubby commented 5 years ago

It triggers the OS caching mechanism. Reported speed is high at first then gradually falls (averages) to the max speed, but does not hang like it did for you.

I think you may close this issue now. The purpose has been fulfilled, while the final low transfer speed seems to originate from my own card.