Results 1 to 5 of 5
Learned about badblock from this post , and this post mentioned the importance of noting the time-to-complete.
So how would I sequentially run the following commands with a way of ...
- 07-09-2009 #1Linux Newbie
- Join Date
- Mar 2004
- Posts
- 185
How to Combine a badblock Scan With a Time-To-Run Calculation?
Learned about badblock from this post, and this post mentioned the importance of noting the time-to-complete.
So how would I sequentially run the following commands with a way of measuring how long it took to complete each command:
nohup badblocks -v /dev/sdx &
(time-to-complete printed to screen)
nohup badblocks -c 10240 -s -w -t random -v /dev/sdx &
(time-to-complete printed to screen)
Thanks for helping a scripting noob!
DrCR
- 07-10-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Example:
That will give you an output like this (in nohup.out):Code:nohup /usr/bin/time --portability badblocks -v /dev/sdx &
where N.NN is the time in seconds.Code:... output from badblocks command ... real N.NN user N.NN sys N.NN
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-21-2009 #3Linux Newbie
- Join Date
- Mar 2004
- Posts
- 185
Awesomeness, thanks. I'll give it a go when I get in the replacement drive (it had badblock errors). Thanks again.
- 07-28-2009 #4Linux Newbie
- Join Date
- Mar 2004
- Posts
- 185
Hum, that didn't work for me, at least not for a different purpose I tried to apply it to below.
Is the --portability part for nohup or time? I tried to search the man files, but I don't know how to access the additional documentation e.g. time(1) instead of time(7).Code:server:~# nohup /usr/bin/time --portability mkfs.jfs -c /dev/sda1 & [1] 24843 server:~# nohup: ignoring input and appending output to `nohup.out' nohup: cannot run command `/usr/bin/time': No such file or directory
What am I doing wrong? Thanks
- 08-03-2009 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Most systems have 2 'time' programs - one builtin to the shell, and the other an executable. Usually it is found as /usr/bin/time, but on your system it might be elsewhere, such as in /bin. Find it and use that path instead of /usr/bin/time as I did in my example. BTW, which linux distribution+version and kernel version are you running?
The --portability option is applied to the time command.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
