Quantcast
Channel: Colocation to Virtualization » raid
Viewing all articles
Browse latest Browse all 2

Linux: dd – Passing User Defined Variables For Status

$
0
0

So I was encrypting the external USB2.0 – 2.5″ raid enclosure a few days back. I have never over-wrote blocks using /dev/urandom to a USB attached device. This definitely took longer than I thought. The device contains two 160 gig sata disks setup using Raid 1 (mirror). The delima is that “dd” in Linux does not give any status indicators at all while running. I found the following information via Google and it is extremely useful. Turns out you can use “kill” to pass a “user defined signal” to the dd process. This signal will cause dd to spew a few details to the terminal that initiated the command.

First, start DD and pass it into the background using “&”

root@workstation:~# dd if=/dev/urandom of=/dev/sdd2 bs=4K &
[1] 25263

The process id (PID) was shown on the second line and in this case is “25263”

Now use “kill” to pass the user defined signal 1 to the process (dd)

root@workstation:~# kill -USR1 25263

Below is what follows after the kill is initiated

root@workstation:~# 9770295+0 records in
9770294+0 records out
40019124224 bytes (40 GB) copied, 9721.18 s, 4.1 MB/s

Now I know that the drive (device) that is being filled with random data has a 160 gig capacity. This tells me that dd has a long way to go.

Another Source For Information. Especially check where it shows using “watch” to keep a loop going for “kill”.

Note: in this case, “kill” does not actually stop the running process. “dd” will continue the copy in the background until complete. This is really only useful if you know the size of the destination drive. Same theory works if just coping data from one drive to another, just figure out the size of the source and use this to show the progress.  Also, the speed is not bad for a USB attached disk!  Last thing, just because this signal works on dd, it does not mean it will on any other commands.  I tested it with “cp” and it did kill the process insted of giving feedback.


Posted in Hardware, Linux

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images