1834939 Members
2134 Online
110071 Solutions
New Discussion

Re: dd not working

 
R.K. #
Honored Contributor

dd not working

Hi All,

I am trying to format few of my disks. Below is command and its output:

-------------------
# dd if=/dev/zero of=/dev/rdsk/c27t0d5 bs=128k
I/O error
8193+0 records in
8192+1 records out
# echo $?
2
-------------------------
# dd if=/dev/null of=/dev/rdsk/c27t0d5 bs=128k
0+0 records in
0+0 records out
# echo $?
0
-------------------------
# diskinfo /dev/rdsk/c27t0d5
SCSI describe of /dev/rdsk/c27t0d5:
vendor: HP
product id: HSV100
type: direct access
size: 1048576 Kbytes
bytes per sector: 512
--------------------------

And this is happening with all the disks I want to format.

I am using "bs" as the multiple of 'bytes per sector'.
My concern is has the 1st command did the formatting ??

Thanks in adv..
Don't fix what ain't broke
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: dd not working

Hi:

You would expect to write 8192 times at a size of 128*1024 bytes. That equals the 1048576 Kbytes of disk you have.

The 8192+1 means a last partial record was written.

Using '/dev/null' as input writes nothing as you saw, so this test is meaningless. You wrote zeros once accross your entire disk in your first attempt.

Regards!

...JRF...
Torsten.
Acclaimed Contributor

Re: dd not working

... but I wonder why you "format" an EVA3k vdisk that way - why?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Matti_Kurkela
Honored Contributor

Re: dd not working

dd is working exactly as it should.

When you specify "if=/dev/zero" you are copying data from a source that contains an infinite number of zero bytes. Your disk, however, is finite... so the copy operation must stop at some point.

Because the destination has completely filled up and the source still has data left (it is endless!), dd regards this as an error. In this situation, this error is completely expected and normal.

Your first dd command ended after writing 8192 * 128k bytes = 1048576 Kbytes, exactly the size of your disk. So you've completely overwritten your disk with zero bytes.

Your second dd command is trying to copy from /dev/null, the black hole that swallows everything and lets nothing out. Any attempt to read it will return only an indication "you've reached the end, there is nothing more". So there is nothing to copy. Your second dd command does not accomplish anything at all.

MK
MK
R.K. #
Honored Contributor

Re: dd not working

Hi again,

Actually someone asked me to format the disks.
So I thought this would be the way to do this.

-Does formatting/erasing really have some meaning?
-Is there any relevant way also?(mediainit)....some threads says "mediainit does more harm than help"

-RK
Don't fix what ain't broke
Torsten.
Acclaimed Contributor

Re: dd not working

How about unpresenting and deleting the vDisk from commandview EVA?

Do a vgexport first!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor

Re: dd not working

Hi (again):

> Actually someone asked me to format the disks. So I thought this would be the way to do this.

This is usually loosely said as "format" but it really means just overwrite the disk with zeros or sometimes random bytes (with '/dev/urandom').

Be advised that if someone has the tools and the desire to read your data, writing over a disk even 10-15 times isn't going to stop reading "layers" down. If your objective is to prevent anyone from finding anything on your disk, a bath of acid plus a metal shredder work better.

That said, however, you effectively erased your disk insofar as your normal Unix tools won't find anything but zeros on it.

Regards!

...JRF...
Torsten.
Acclaimed Contributor

Re: dd not working

Shredder the EVA?

IMHO the EVA will use the free space for other data during leveling if you delete your vdisks.

If you find a way to restore the data anyway, please tell me how ...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor

Re: dd not working

Hi (again):

> Torsten: Shredder the EVA?

I actually had no idea *what* kind of disk or disk array the device sat in. My responses where directed solely to the question of 'dd'; the erasure of data; and what *can* be retrieved from physical media if you have the tools.

No, I think shredding the whole thing is overkill other than as an academic question.

;-)

Regards!

...JRF...
R.K. #
Honored Contributor

Re: dd not working

Thanks Everybody...

I got solution here....vgexport and my "dd" query is also clear
Don't fix what ain't broke