[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /dev/null > /dev/sdb1 !



Jordi Gutiérrez Hermoso wrote:
On 22/04/2008, Sven Joachim <svenjoac@gmx.de> wrote:
No, you would only zero out the disk if you cat /dev/zero to it.
 Catting /dev/null immediately returns and does nothing.

Hm at least catting /dev/null to a full file makes the file now be 0
bytes long. I'm not going to test what it does to my hard drive, of
course. ;-)

- Jordi G. H.



The issue is not with cat or /dev/null, it's what the shell does when it sees '>': open the file, for writing, start at offset 0 (or, truncate the file).

The null device is defined as something that, when read, will immediately return an EOF condition, so nothing is read. So, with a cat of the null device, nothing read, nothing written.

But, the system has opened the destination "file", in this case a device, and done whatever the device driver is coded to do for this case.

I expect, to be able to get the disk back into a usable state, you will need to find a low level formatting tool and rebuild it from scratch.

I have Maxtor IDE drives and Maxtor makes (or made, I got this some time ago) a DOS based utility to do low level formats. Your disk vendor probably has something similar available.

--
Bob McGowan

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Reply to: