FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-25-2008, 04:21 AM
"Rafael Fontenelle"
 
Default Fwd: /dev/null > /dev/sdb1 !

---------- Forwarded message ----------
From: Rafael Fontenelle <rffontenelle@gmail.com>
Date: 25/04/2008 01:19

Subject: Re: /dev/null > /dev/sdb1 !
To: paragasu <paragasu@gmail.com>

2008/4/24, paragasu <paragasu@gmail.com>:




dd if=/dev/zero of=/dev/sdb bs=1M



to fix it. i did try that command but it seems doesn't help much either.


Could this command have the same result as 'cat /dcev/null > /dev/sdb' ?




actually, i read some post from



http://howto.wikia.com/wiki/Howto_wipe_a_hard_drive_clean_in_Linux







and some post from linuxforums about this

Strange. I set a virtual machine with an extra harddisk and I just ran 'cat /dev/null > /dev/hdd' as root with /dev/hdd3 umounted in the first attempt and then mounted in the second, but nothing happened with my partition or the whole virtual disk. See the output below:



rffdebian01:/# cat /dev/null > /dev/hdd
rffdebian01:/# cd /mnt/hdd3/
rffdebian01:/mnt/hdd3# ls
file
rffdebian01:/mnt/hdd3#

It seems that /dev/null really returned _nothing_. Very different from 'cat /dev/zero > /dev/hdd'. This one really formated the virtual harddisk, cleaning incl. the partition table (I had to remake the partitions with cfdisk). Also displayed a message after completing the harddisk with zeros.



rffdebian01:/# umount /dev/hdd3 && cat /dev/zero > /dev/hdd
cat: write error: No space left on device
rffdebian01:/#

Note: when I ran this with /dev/hdd3 mounted, I got a lot of error messages and the system didn't want to umount not either reboot. Pretty messy.



So, I think that the command 'cat /dev/null > /dev/hdd' did nothing to your system. Maybe something else?

Cheers,

Rafael
 
Old 04-27-2008, 09:46 AM
Tzafrir Cohen
 
Default Fwd: /dev/null > /dev/sdb1 !

Hi,

Jumping in late, and probably noone still reads this thread, but still,

On Fri, Apr 25, 2008 at 01:21:39AM -0300, Rafael Fontenelle wrote:

> So, I think that the command 'cat /dev/null > /dev/hdd' did nothing to your
> system. Maybe something else?

/dev/hdd is a block device. 'cat whatever >/dev/hdd' is an operation on
a character device, essentially.

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-27-2008, 10:23 AM
Osamu Aoki
 
Default Fwd: /dev/null > /dev/sdb1 !

On Sun, Apr 27, 2008 at 09:46:04AM +0000, Tzafrir Cohen wrote:
> Hi,
>
> Jumping in late, and probably noone still reads this thread, but still,
>
> On Fri, Apr 25, 2008 at 01:21:39AM -0300, Rafael Fontenelle wrote:
>
> > So, I think that the command 'cat /dev/null > /dev/hdd' did nothing to your
> > system. Maybe something else?
>
> /dev/hdd is a block device. 'cat whatever >/dev/hdd' is an operation on
> a character device, essentially.

I do not think character or block device matters.

Upon reading /dev/null, EOF will be encounterd. So nothing is written
to output. For example try:

$ cat /dev/null >here
$ ls -l here
-rw-r--r-- 1 osamu osamu 0 2008-04-27 19:03 here

As long as you use correct device, it will write output. /dev/zero or
/dev/urandom is the good file to use as such input.

$ cat /dev/zero >here
(Control C pressed)
$ ls -l here
-rw-r--r-- 1 osamu osamu 105467904 2008-04-27 19:15 here

Instead of here, you use /dev/sdax etc. I will not try it now :-)

http://people.debian.org/~osamu/pub/getwiki/html/ch02.en.html#specialdevicefiles

I usually use dd to erase this kind of device file. The dummy file
creation is the same.

http://people.debian.org/~osamu/pub/getwiki/html/ch11.en.html#dummyfiles

Osamu


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-29-2008, 12:22 PM
Michelle Konzack
 
Default Fwd: /dev/null > /dev/sdb1 !

Am 2008-04-25 01:21:39, schrieb Rafael Fontenelle:
> Strange. I set a virtual machine with an extra harddisk and I just ran 'cat
> /dev/null > /dev/hdd' as root with /dev/hdd3 umounted in the first attempt
> and then mounted in the second, but nothing happened with my partition or
> the whole virtual disk. See the output below:
>
> rffdebian01:/# cat /dev/null > /dev/hdd
> rffdebian01:/# cd /mnt/hdd3/
> rffdebian01:/mnt/hdd3# ls
> file
> rffdebian01:/mnt/hdd3#
>
> It seems that /dev/null really returned _nothing_. Very different from 'cat
> /dev/zero > /dev/hdd'. This one really formated the virtual harddisk,
> cleaning incl. the partition table (I had to remake the partitions with
> cfdisk). Also displayed a message after completing the harddisk with zeros.
>
> rffdebian01:/# umount /dev/hdd3 && cat /dev/zero > /dev/hdd
> cat: write error: No space left on device
> rffdebian01:/#

dd if=/dev/zero of=/dev/hdd bs=1M

Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
 
Old 04-30-2008, 06:01 PM
Bob McGowan
 
Default Fwd: /dev/null > /dev/sdb1 !

Michelle Konzack wrote:

Am 2008-04-25 01:21:39, schrieb Rafael Fontenelle:

Strange. I set a virtual machine with an extra harddisk and I just ran 'cat
/dev/null > /dev/hdd' as root with /dev/hdd3 umounted in the first attempt
and then mounted in the second, but nothing happened with my partition or
the whole virtual disk. See the output below:

rffdebian01:/# cat /dev/null > /dev/hdd
rffdebian01:/# cd /mnt/hdd3/
rffdebian01:/mnt/hdd3# ls
file
rffdebian01:/mnt/hdd3#

It seems that /dev/null really returned _nothing_. Very different from 'cat
/dev/zero > /dev/hdd'. This one really formated the virtual harddisk,
cleaning incl. the partition table (I had to remake the partitions with
cfdisk). Also displayed a message after completing the harddisk with zeros.

rffdebian01:/# umount /dev/hdd3 && cat /dev/zero > /dev/hdd
cat: write error: No space left on device
rffdebian01:/#


dd if=/dev/zero of=/dev/hdd bs=1M



I don't understand the point you're trying to make, unless it is to just
give an alternate way to do the same thing?


Yes, the dd command given will also write zeros to the device. Same as
the "cat /dev/zero > /dev/hdd" does.


And, both commands generate the same basic output error (different
words, same issue):


cat: write error [No space left on device]

dd: writing `/dev/fd0': No space left on device

This is because 'cat' only knows to stop when input reaches EOF, which
/dev/zero never gives, and dd will only stop if you tell it how many
blocks to write, as in:


dd if=/dev/zero of=/dev/fd0 bs=18k count=80

The error messages in the first two cases are simply the response of the
disk driver to the fact that it has moved the read/write head to the end
of the disk and can't go any farther, even though both commands try to.


--
Bob McGowan
 

Thread Tools




All times are GMT. The time now is 07:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org