Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!hubcap!ncrcae!ncr-sd!se-sd!rns From: rns@se-sd.sandiego.NCR.COM (Rick Schubert) Newsgroups: comp.unix.wizards Subject: Re: How does filling a disk to capacity affect performance? Message-ID: <1508@se-sd.sandiego.NCR.COM> Date: 12 Apr 88 21:17:08 GMT References: <460@osupyr.mast.ohio-state.edu> <92@iravcl.ira.uka.de> Reply-To: rns@se-sd.sandiego.NCR.COM (Rick Schubert) Organization: NCR Corp. Systems Engineering, San Diego Lines: 28 In article <92@iravcl.ira.uka.de> fsinf@iravcl.ira.uka.de writes: >In article <460@osupyr.mast.ohio-state.edu>, czei@osupyr.mast.ohio-state.edu (Michael S Czeiszperger) writes: >I've heard (but not verified) you can crash *every* unix-system using the >CP-command when there is not enough space on disk. CP will not check >whether the disk is full and overwrite blocks which are not free. The original >data will be lost; also the machine is likely to go down. > >If this isn't right, please correct. You will probably get tons of corrections on this, but I'd like to add some information that I think may be useful in this and other situations. Commands like "cp" are just programs. In general (i.e. unless the file is setuid to "root"), such programs cannot perform magic. That is, they cannot do anything that you couldn't write a program to do if you knew how. "cp" may be "dumb" (not meant to be derogatory to "cp" or to people who are unable to speak) enough not to check whether or not a write was successful (I haven't bothered to test whether or not it is because that's not my point), but it doesn't have the permission to start writing over blocks that are not free, just as you could not naively (or maliciously) write a program that would do that kind of damage to the system (you could write programs that would do damage to your files and to other unprotected files, however) -- UNIX(tm) does provide a reasonable (no flames, please) amount of security in this area. One thing I think is nice about UNIX in terms of understanding and using it IS that all commands are just programs (even the various shells), and, except for things that need to run as root (or some other userid), any program can do anything that a "command" can do. -- Rick Schubert