Sponsored Content
Top Forums UNIX for Advanced & Expert Users Command to output ones (like zero-fill), with progress indicator Post 302449791 by Corona688 on Tuesday 31st of August 2010 02:11:24 PM
Old 08-31-2010
Eight megabytes per second seems a bit slow even for a green drive, I think this can be optimized a bit.

The first dd does nothing but waste time, pipebench can read fine directly from tr. If you mean to fill the entire drive, count is redundant anyway -- dd will stop when it reaches the end. Or you could put bs and count on the final dd instead of the first.

Increasing the blocksize may make it more efficient. It doesn't need to match the drive's block size -- this isn't raw I/O.

Code:
tr '\000' '\377' < /dev/zero | pipebench | sudo dd of=/dev/wtf

It's also possible to get progress statistics from dd itself instead of using pipebench, by sending it SIGUSR1:

Code:
kill -USR1 pid

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn: How to zero fill df output so it will sort properly

I'm looking for a way in Korn shell to zero fill (or space fill) the output from df so that it will sort properly. "Raw" output from df -k: df -k Filesystem kbytes used avail capacity Mounted on /dev/vx/dsk/rootvol 4131866 3593302 497246 88% / /proc ... (9 Replies)
Discussion started by: shew01
9 Replies

2. Shell Programming and Scripting

Progress indicator script

Can anybody suggest you a good script to show progress of a process. I figured it out some thing like this. But cursor goes to the end of the line and after every loop it goes to the next line. while true ; do for i in \| \/ \- \\ \| \/ \- \\ do echo "\b\b$i \c" sleep 1 done done (8 Replies)
Discussion started by: ./hari.sh
8 Replies

3. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

4. Shell Programming and Scripting

Process indicator with hash marks

Hi Experts, I have written a php script that calls several smaller bash shell scripts throughout it's loop process. Users run this script to achieve a task that this script has automated. However this script depending upon the amount of input variables could take some time to run. It may be a... (5 Replies)
Discussion started by: jaysunn
5 Replies

5. Shell Programming and Scripting

How to fill data from other file and get some output

Greetings, I have a hard time creating a large number of user profiles in a database. The data file looks like this : 01/01/80 Mitch Conley . . . . And I need to put the output into: Name: Mitch Surname: Conley Birthday: 01/01/80 Thanks in advance! (3 Replies)
Discussion started by: hemo21
3 Replies

6. Shell Programming and Scripting

zenity progress and simultaneously terminal output

Hi, I want to use zenity --progress and also put the output to the terminal. I tried using the tee command but that puts the output to the terminal first and then shows the zenity progress dialog. Take the normal example by the gnome manual: ( echo "10" ; sleep 1 ... (0 Replies)
Discussion started by: sikku
0 Replies

7. Solaris

Unix command to fill filesystem

I have been trying to fill all available file space on my Solaris box for my project but have not been successful. I have tried the following script: tr '\0' '\060' < /dev/zero | dd of=zero2.txt bs=1024 count=1953125 But the only thing i get in return is this: "d: bad numeric argument:... (8 Replies)
Discussion started by: rbur101
8 Replies

8. Shell Programming and Scripting

Protecting variable indicator ($) from expansion

Hello, I use a lot this command to edit a bunch of files at once find . -name filename" | xargs -ifoo sh -c 'echo foo ; sed "s/pattern1/pattern2/" foo > ./tmp ; mv -f ./tmp foo' I'm trying to put a function on my .bashrc file. function loopSed() { local filename=$1 local... (2 Replies)
Discussion started by: phollox
2 Replies

9. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

10. Programming

Script to monitor progress of find/exec command

hi all, i want to monitor the progress of a find and exec command, this is the code i use - find . -type f -exec md5sum {} \; >> /md5sums/file.txt this command works and produces a text file with all the md5sums but while running it doesnt show the progress is there anyway i can do this... (4 Replies)
Discussion started by: robertkwild
4 Replies
MT(1)							      General Commands Manual							     MT(1)

NAME
mt - magnetic tape control SYNOPSIS
mt [-f device] [count] DESCRIPTION
Mt is a user interface to the magnetic tape commands described in mtio(4). It allows one to space a tape forwards or backwards, write end of file markers, etc. With the -f option a tape device can be named, otherwise the environment variable TAPE is used if set, otherwise the default device /dev/nrst4 is assumed. Standard input is used if the tape name is a dash (-). The count argument is used to tell how many blocks or files to space or how many file markers to write. It may be a C-style decimal, octal or hexadecimal constant, by default "1". Command is the action to perform, it may be one of the following, or any unambiguous prefix (like st for status): eof, weof Write count end-of-file markers. fsf Forward space count file markers. fsr Forward space count records. (The size of a record depends on the tape, and may even be variable, depending on the size of the writes.) bsf Backwards space count files. The count may be zero to backspace to the start of the current file. (A tape device need not support backwards movement, or may be very slow doing it. Rewinding and forward spacing may be better.) bsr Backwards space count records. The tape is positioned after the last block of the previous file if you hit a filemark when spacing backwards. The block count is set to -1 to indicate that the driver has no idea where it is on the previous file. eom Forward space to the end of media. rewind Rewind the tape. offline, rewoffl Rewind and take offline. This may cause some drives to eject the tape. status Shows the status of the drive, the sense key of the last SCSI error, current file number, current record number, residual count if the last command that encountered end-of-file, and the current block size. retension Removes tape tension by winding and rewinding the tape completely. erase Erases the tape completely and rewinds it. density Sets the density code to read or write the tape to count. Density codes supported depend on the drive. This command need not be used if the drive senses the proper density on read and can only write one density. blksize, blocksize Sets the block size used to read or write the tape to count. This command may be used to select a fixed block size for a variable block size tape. This will speed up I/O for small block sizes. Use a zero count to use variable sized blocks again. ENVIRONMENT
TAPE Tape drive to use if set. FILES
/dev/nrst4 Default tape device. SEE ALSO
mtio(4), st(4). AUTHOR
Kees J. Bot (kjb@cs.vu.nl) MT(1)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy