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-22-2008, 01:35 PM
paragasu
 
Default /dev/null > /dev/sdb1 !

well, i just did an experiments on my old pentum III computer.
one of the slave hardisk listed as /dev/sdb1 (EXT2) and* /dev/sdb2(SWAP)
i run the command /dev/null > /dev/sdb1 and suddently,
i cannot cannot read or mount my /dev/sdb1 anymore even after i restart my

computer few times. i have message saying media failure or disk I/O error.

now i am wondering. whether it is because the command i just executed or
my hard disk is really dying?
 
Old 04-22-2008, 01:38 PM
George Borisov
 
Default /dev/null > /dev/sdb1 !

paragasu wrote:

well, i just did an experiments on my old pentum III computer.
one of the slave hardisk listed as /dev/sdb1 (EXT2) and /dev/sdb2(SWAP)
i run the command /dev/null > /dev/sdb1 and suddently,
i cannot cannot read or mount my /dev/sdb1 anymore even after i restart my
computer few times. i have message saying media failure or disk I/O error.

now i am wondering. whether it is because the command i just executed or
my hard disk is really dying?


Is this a serious question?


George.
 
Old 04-22-2008, 01:43 PM
"Eduardo M KALINOWSKI"
 
Default /dev/null > /dev/sdb1 !

On Tue, Apr 22, 2008 at 10:35 AM, paragasu <paragasu@gmail.com> wrote:
> well, i just did an experiments on my old pentum III computer.
> one of the slave hardisk listed as /dev/sdb1 (EXT2) and /dev/sdb2(SWAP)
> i run the command /dev/null > /dev/sdb1 and suddently,
> i cannot cannot read or mount my /dev/sdb1 anymore even after i restart my
> computer few times. i have message saying media failure or disk I/O error.

What exactly did you run?

/dev/null is not executable, so you cannot run it and redirect the
output somewhere else.


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

Is this a serious question?

George.
well, i am sorry if this question look so stupid. but yes, i mean it.
but i don't mind if you laugh or think it is a joke anyway
 
Old 04-22-2008, 01:45 PM
Matthew Macdonald-Wallace
 
Default /dev/null > /dev/sdb1 !

On Tue, 22 Apr 2008 21:35:31 +0800
paragasu <paragasu@gmail.com> wrote:

> now i am wondering. whether it is because the command i just executed
> or my hard disk is really dying?

It could be either. The command you typed effectively formatted the
disk.

/dev/null contains no data. It is the Linux equivalent of a black
hole. If you send the output of /dev/null to a file (which is exactly
what you have done) with a single chevron (>), it will overwrite
anything that exists in that file (in this case the entire contents of
your disk). If you use a double chevron (>>) you will append the
contents of /dev/null to the end of the file (in this case, your disk).

All I can say is "I hope you took a backup..."

Kind regards,

Matt
--
|Matthew Macdonald-Wallace
|Tiger Computing Ltd
|"The Linux Specialists"
|
|Tel: 0330 088 1511
|Web: http://www.tiger-computing.co.uk
|
|Registered in England. Company number: 3389961
|Registered address: Wyastone Business Park,
| Wyastone Leys, Monmouth, NP25 3SR


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

On Tue, Apr 22, 2008 at 8:43 AM, Eduardo M KALINOWSKI <ekalin@gmail.com> wrote:
> On Tue, Apr 22, 2008 at 10:35 AM, paragasu <paragasu@gmail.com> wrote:
> > well, i just did an experiments on my old pentum III computer.
> > one of the slave hardisk listed as /dev/sdb1 (EXT2) and /dev/sdb2(SWAP)
> > i run the command /dev/null > /dev/sdb1 and suddently,
> > i cannot cannot read or mount my /dev/sdb1 anymore even after i restart my
> > computer few times. i have message saying media failure or disk I/O error.
>
> What exactly did you run?
>
> /dev/null is not executable, so you cannot run it and redirect the
> output somewhere else.

The problem is that the file is opened before the commands are executed.
Try:

thiscommanddoesnotexist > /tmp/test
ls -lha /tmp/test

Perhaps an EOF was written?

N.-

--
http://arhuaco.org


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

It could be either. *The command you typed effectively formatted the


disk.



/dev/null contains no data. It is the Linux equivalent of a black

hole. *If you send the output of /dev/null to a file (which is exactly

what you have done) with a single chevron (>), it will overwrite

anything that exists in that file (in this case the entire contents of

your disk). *If you use a double chevron (>>) you will append the

contents of /dev/null to the end of the file (in this case, your disk).



All I can say is "I hope you took a backup..."



Kind regards,



Matt

well, is that so simple to format the hardisk? format is ok as long as it doesn't render
my hard disk useless.
 
Old 04-22-2008, 01:49 PM
paragasu
 
Default /dev/null > /dev/sdb1 !

*
thiscommanddoesnotexist > /tmp/test
*
ls -lha /tmp/test



*Perhaps an EOF was written
opps.. a correction.
what i did was $cat* /dev/null >* /dev/sdb1
i forgot to include the cat command
 
Old 04-22-2008, 02:00 PM
George Borisov
 
Default /dev/null > /dev/sdb1 !

paragasu wrote:

well, i am sorry if this question look so stupid. but yes, i mean it.
but i don't mind if you laugh or think it is a joke anyway


Sorry but I assumed that if you knew about /dev/null and the use of ">"
that you would also expect to break something if you redirected stuff
directly to the disk device.


So I thought you were having a boring day at work and decided to crack a
joke. ;-)



George.
 
Old 04-22-2008, 02:02 PM
Sven Joachim
 
Default /dev/null > /dev/sdb1 !

On 2008-04-22 15:45 +0200, Matthew Macdonald-Wallace wrote:

> On Tue, 22 Apr 2008 21:35:31 +0800
> paragasu <paragasu@gmail.com> wrote:
>
>> now i am wondering. whether it is because the command i just executed
>> or my hard disk is really dying?
>
> It could be either. The command you typed effectively formatted the
> disk.

I don't think so.

> /dev/null contains no data. It is the Linux equivalent of a black
> hole. If you send the output of /dev/null to a file (which is exactly
> what you have done) with a single chevron (>), it will overwrite
> anything that exists in that file (in this case the entire contents of
> your disk).

Only true for an ordinary file and because it's the shell that truncates
the file before the redirection. Since you cannot read anything from
/dev/null, catting it to device files is harmless. It's a different
story with /dev/zero instead of /dev/null ...

> If you use a double chevron (>>) you will append the
> contents of /dev/null to the end of the file (in this case, your disk).

But because you append nothing, that's actually a no-op.

Sven


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




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

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