Testing the speed of USB flash drives

interpretive language scripts


Moderator: Forum moderators

Post Reply
User avatar
smokey01
Posts: 163
Joined: Sun Jul 12, 2020 10:46 am
Location: Australia
Has thanked: 21 times
Been thanked: 23 times
Contact:

Testing the speed of USB flash drives

Post by smokey01 »

Recently I wanted to test a few USB Flash drives but I had forgotten the command. A quick look at the murga forums reminded me of the thread I had started there. I have now expanded the simple hdparm command into a simple gtkdialog script.
Attachments
ds.tar
Click to extract.
(10 KiB) Downloaded 161 times
Screeny
Screeny
ds.png (37.92 KiB) Viewed 2454 times
seneka77
Posts: 2
Joined: Wed Jul 15, 2020 5:30 pm

Re: Drive Speed

Post by seneka77 »

Thanks for sharing, nice app, great shell script sample with GUI.
On my Slacko 64:

Code: Select all

# bash --version
GNU bash, versión 4.2.53(2)-release (x86_64-slackware-linux-gnu)
# uname --all
Linux puppypc5895 4.1.11 #1 SMP Mon Oct 26 11:19:32 EST 2015 x86_64 Intel(R) Core(TM) i5 CPU       M 520  @ 2.40GHz GenuineIntel GNU/Linux
I've got the following error in the term when do the check over my hard-disk:
-----
sh: line 3: numfmt: can't find the command
ERROR
hdparm: invalid option -- '-'
hdparm: invalid number 'irect'
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: attempt to access field -1
COMBOBOX="sda"
INPUT="ATA TOSHIBA MK3261GS MB/sec
"
EXIT=" Quit "
------
Dunno how to install numfmt, however I've fixed with the simple hdparm (no --direct option) command and format the number in MB, so my hdparm output is in KB:

Code: Select all

speed1="$(hdparm -t /dev/$COMBOBOX)"
speed2=`echo "${speed2:0:(${#speed2}-3)},${speed2:(-3)}"`
Now just need to fix the size part.
Cheers!
User avatar
smokey01
Posts: 163
Joined: Sun Jul 12, 2020 10:46 am
Location: Australia
Has thanked: 21 times
Been thanked: 23 times
Contact:

Re: Drive Speed

Post by smokey01 »

Maybe updating hdparm might fix the problem. I will have a look when I get some time, hopefully later today.

I just tried Drive Speed in slacko64-6.9.9.9-uefi-k4.9-FF-LO.iso. I noticed it is using hdparm which is included in busybox. Quite often the apps in busybox don't have full functionality. If you install hdparm from the package manager it should work. It did here.

Enjoy.
Geek3579
Posts: 245
Joined: Sat Jul 18, 2020 1:07 pm
Has thanked: 68 times
Been thanked: 62 times

Re: Drive Speed

Post by Geek3579 »

Ive just tried to run Drive Speed in the following:

Distro: LxPupSc64 19.09
Desktop Panel: lxpanel 0.10.0
Window Manager: Openbox 3.6.1
Desktop Start: xwin startlxde

hdparm caused the same error as previously mentioned. Yet it seemed to be installed....

Then I reinstalled it from the package manager. I did not remove any previous installation of hdparm.

Works great now !

Thanks Smokey01, for a very easy to use script.
User avatar
smokey01
Posts: 163
Joined: Sun Jul 12, 2020 10:46 am
Location: Australia
Has thanked: 21 times
Been thanked: 23 times
Contact:

Re: Drive Speed

Post by smokey01 »

That's because your computer is now using the full version of hdparm instead of the one in busybox.

Thanks for letting me know, enjoy.
User avatar
smokey01
Posts: 163
Joined: Sun Jul 12, 2020 10:46 am
Location: Australia
Has thanked: 21 times
Been thanked: 23 times
Contact:

Re: Drive Speed

Post by smokey01 »

@seneka77,
After doing a lot of detective work it appears you are running Linux puppy-slacko64-6.3.0 4.1.11 #1 SMP x86_64 Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz GNU/Linux. If this is the case numfmt was not included.

If you copy the attached file into /usr/local/bin and extract it by clicking it, it should show you the size.
seneka77 wrote: Wed Jul 15, 2020 6:34 pm Thanks for sharing, nice app, great shell script sample with GUI.
On my Slacko 64:

Code: Select all

# bash --version
GNU bash, versión 4.2.53(2)-release (x86_64-slackware-linux-gnu)
# uname --all
Linux puppypc5895 4.1.11 #1 SMP Mon Oct 26 11:19:32 EST 2015 x86_64 Intel(R) Core(TM) i5 CPU       M 520  @ 2.40GHz GenuineIntel GNU/Linux
I've got the following error in the term when do the check over my hard-disk:
-----
sh: line 3: numfmt: can't find the command
ERROR
hdparm: invalid option -- '-'
hdparm: invalid number 'irect'
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: attempt to access field -1
COMBOBOX="sda"
INPUT="ATA TOSHIBA MK3261GS MB/sec
"
EXIT=" Quit "
------
Dunno how to install numfmt, however I've fixed with the simple hdparm (no --direct option) command and format the number in MB, so my hdparm output is in KB:

Code: Select all

speed1="$(hdparm -t /dev/$COMBOBOX)"
speed2=`echo "${speed2:0:(${#speed2}-3)},${speed2:(-3)}"`
Now just need to fix the size part.
Cheers!
Attachments
numfmt.tar
numfmt binary
(70 KiB) Downloaded 50 times
seneka77
Posts: 2
Joined: Wed Jul 15, 2020 5:30 pm

Re: Testing the speed of USB flash drives

Post by seneka77 »

Thanks a lot, so now works great in my Puppy slacko @smokey01 , @Geek3579

I've also checked the program in my old Puppy tahr64 6.0.5 distro

Code: Select all

# ds
/mnt/sda9/script/ds: line 7: lsblk: command not found
COMBOBOX=""
INPUT="Select a drive then press the Test Button.
"
EXIT=" Quit "
root# uname --all
Linux puppypc14017 3.14.54 #1 SMP PREEMPT Tue Dec 1 17:54:26 GMT 2015 x86_64 x86_64 x86_64 GNU/Linux
So now the problem is with lsblk command, but anyway I'vef fixed soon , just replace it with the line:

Code: Select all

ls /dev/sd? | grep sd. -o > /tmp/thelist
instead the 'lsblk' one, and it works.
Cheers!
User avatar
puddlemoon
Posts: 189
Joined: Sun Sep 06, 2020 9:26 pm
Location: In between
Has thanked: 89 times
Been thanked: 64 times

Re: Testing the speed of USB flash drives

Post by puddlemoon »

Hi there,

Thanks for this! super handy to pick which usb, from my pile of rejects, is the best choice to make an install on!!

So I have been looking for a script to use as a base for a similar(ish) set of commands. I'm a real novice so I need a starting point.
I'd be so grateful if you'd coach me on that..??

I'd like to display list of sound cards from /proc/asound/cards and have an input box to insert the selection and nickname into to next command. any advice on how to modify it would be great. If you don't mind me doing so of course...
User avatar
smokey01
Posts: 163
Joined: Sun Jul 12, 2020 10:46 am
Location: Australia
Has thanked: 21 times
Been thanked: 23 times
Contact:

Re: Testing the speed of USB flash drives

Post by smokey01 »

puddlemoon wrote: Thu Oct 15, 2020 10:58 pm Hi there,

I'd like to display list of sound cards from /proc/asound/cards and have an input box to insert the selection and nickname into to next command. any advice on how to modify it would be great. If you don't mind me doing so of course...
How would you like to display the cards? In a terminal, GUI like gtkdialog or yad etc.

typing "cat /proc/asound/cards" in a terminal will list your cards.

Do you want to list the sound cards in a combobox?

For anyone to help, you need to be very specific.

If you have the devx loaded there are many example of gtkdialog that will help at:
/usr/share/doc/gtkdialog-514

Cheers
User avatar
puddlemoon
Posts: 189
Joined: Sun Sep 06, 2020 9:26 pm
Location: In between
Has thanked: 89 times
Been thanked: 64 times

Re: Testing the speed of USB flash drives

Post by puddlemoon »

hi @smokey01 yes, i realized i kinda just blurted it out there... thanks for the response.

yep, I'm hoping to use gtkdialog or yad to display "cat /proc/asound/cards" ideally in a combobox to pass to the selection to the next command. and an input box for the second part.

but the second command needs only part of the output for the given card.
so from..

0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xf0600000 irq 32

I just need "PCH" the first "short name"

The next command is to connect the selected card to jack with name provided in input box

' zita-a2j -dhw:card -jnickname '

But ya know, this is really way simple by comparison and also totally off topic so I apologize for piping in here...
I will do some more homework ;)
User avatar
Jasper
Posts: 1589
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 674 times
Been thanked: 357 times

Re: Testing the speed of USB flash drives

Post by Jasper »

Thanks smokey01 for this application :thumbup2:

As in an earlier message, I too have some ancient USB flash drives lying around and now I can see if there still usable.

**EDIT

Also used it to check out the speed of external USB HDD drives. Worked in exactly the same way :thumbup:

Last edited by Jasper on Tue Nov 01, 2022 8:22 am, edited 1 time in total.
User avatar
gychang
Posts: 553
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: Testing the speed of USB flash drives

Post by gychang »

smokey01 wrote: Mon Jul 13, 2020 10:26 am

Recently I wanted to test a few USB Flash drives but I had forgotten the command. A quick look at the murga forums reminded me of the thread I had started there. I have now expanded the simple hdparm command into a simple gtkdialog script.

This is very well done, simple and quick and intuitive, :thumbup:

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
mikewalsh
Moderator
Posts: 5572
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1679 times

Re: Testing the speed of USB flash drives

Post by mikewalsh »

gychang wrote: Sun Oct 30, 2022 8:18 pm
smokey01 wrote: Mon Jul 13, 2020 10:26 am

Recently I wanted to test a few USB Flash drives but I had forgotten the command. A quick look at the murga forums reminded me of the thread I had started there. I have now expanded the simple hdparm command into a simple gtkdialog script.

This is very well done, simple and quick and intuitive, :thumbup:

@gychang :-

There's also the DriveSpeed! portable package I put together a while back, after getting inspiration from Barry's EasyDD.....which features an on-going readout of real-time speeds as it tests a drive.

https://forum.puppylinux.com/viewtopic.php?t=2836

For straight-forward testing, I recommend the v2.2-portable, attached to the first post. Fred and stemsee took the concept & "ran with it", developing v3 and v4, but much of this was them playing around with YAD GUIs, and seeing just how many 'extras' they could cram in. It became a little bit "OTT" for my liking! :D

Image

IMHO, v2.2 does all you want - the GUI even has the functions numbered in the order you need to run them, for maximum ease-of-use. To use it, keep a main copy of it somewhere safe; for testing drives, just copy the whole thing to the root of that drive; it's pretty small, and is designed to work "in-situ". It's a ROX-app, so just click on it to run it. When you're done, simply delete the whole thing again.

The 'Help' file explains what to do with it, and how to get the best out of it, depending on age & capabilities of your hardware, and the type of drive you're testing (it'll work with ANY kind of storage drive).

Just another alternative, FWIW.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Clarity
Posts: 3268
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: Testing the speed of USB flash drives

Post by Clarity »

Hi @mikewalsh

DriveSpeed is very nice.

Idea for your consideration
Have you thought to add the 'latest' desktop picture of the latest DriveSpeed version to your opening post, here?

If you feel it worthy.

User avatar
smokey01
Posts: 163
Joined: Sun Jul 12, 2020 10:46 am
Location: Australia
Has thanked: 21 times
Been thanked: 23 times
Contact:

Re: Testing the speed of USB flash drives

Post by smokey01 »

I bought a new laptop recently and it had a nvme drive. The problem was drivespeed couldn't see it so I added this functionality. Drivespeed should be able to test all types of drives now like: usb, hdd, ssd, mmc, nvme etc.

Attachments
drivespeed.tar.gz
(1.57 KiB) Downloaded 30 times
Post Reply

Return to “Scripts”