Shootout: 'rm -Rf /' vs. 'Format C:'
skyshock21 writes "There's an article over at hohle.net about what actually happens when you type the commands Format C: in windows versus rm -Rf / in Linux. Very interesting results indeed. Myths are busted, and hilarity ensues."
I prefer the magnet or throwing the disk out the window.
openbsd has rm -P which will overwrite the bytes of the 3 times
Well, without the verbose/interactive flag, it's quite more dangerous the 'rm' approach, still the word 'format' itself it is, subjectively, less musical than 'remove'.
Yeah, that's pretty much how I felt when I saw this mornings election results. :-(
would be 'mkfs /dev/hda1' vs 'format c:'
http://www.dealsites.net/wrap.php?file=hohle_post. htm
they apparently did a rm -rf / on their webserver..
The best low level formatting utility I've ever used
i'll go back to laughing at the election results. or was it crying, i cant remember now.
In the article he mentions sudo asks the root password, while it's actually asking the password of the user performing the sudo ! So I guess he must have set the root password identical to his user password during the installation.
http://66.102.7.104/search?hl=en&lr=&q=cache%3Ahtt p%3A%2F%2Fhohle.net%2Fscrap_post.php%3Fpost%3D23%2 6m%3Dfull&btnG=Search
( o ) one could say I'm rather baked
format c: /autotest
Talk about trying to kill a simple joke, for all the braindead: it's the intention of the commands that is funny, not typing the command (well that too if it would work but only del *.* in real dos works and that was pretty much the original joke I guess).
To remove this comment press F4 on windows...
And FP btw
this comment is provided "as is" and without any express or implied legibility or congruity [...]
rm -Rf / removes all the files mounted on the file system. format c:\ rewrites a new file allocation table.
The issue of Linux not running as cleanly after all the files are whiped out vs. Windows still able to run isn't much a means of stability. Remember in Linux/Unix systems, Everything is a file. While in windows it is some hodgepodge framework where some are files and other are not. So naturally if you wipe out all the files on a Linux/Unix system problem will happen. While windows which puts a lot of its features in memory and stayes there so it can still operate even after you logout. In some ways having X windows crash after you try to leave is a good thing because you know that something is wrong sooner. vs. Windows just acting like nothing happend.
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
I once saw an errant script run as a cron job (I DIDN'T WRITE IT, DAMN IT! WHY DON'T PEOPLE BELIEVE ME!!!) execute "rm -f *" in root AS root once. No big deal, right? What if someone accidentally (IT WASN'T ME!!!) created a file called "-r" in / two years prior to the errant rm? Hmm? Now what happens if you have nearly two terabytes of data mounted rw without root squashing via NFS on that workstation? Now what happens if that runs on a Saturday night and nobody notices until Monday morning?
I'll tell you what happens. What happens is that the next several days are very, very, very long and very, very, very uncomfortable.
-- Minds are like parachutes... they work best when open.
The site is gone, but I read the text from Googles cache.
I don't find it interesting though. What's next, comparing PS2 to Xbox by hammering them with a brick and see how much damage is made?
Underholdning.info
format c:
/" in Linux. Besides noting how effectively I could trash the system, I wanted to see how the operating system responded, and what it took to be able to destroy the system. I know that "format c:" and "rm -Rf /" aren't equivalent, but they usually are interchangeable punchlines to jokes, which is why they were chosen.
/FS:NTFS" command, in Linux "rm -Rf *".
/F /S /Q *". Linux was a no brainer. All I had to do was escalate my permissions with sudo, "sudo rm -Rf *" to be exact.
There's a nerdy idea floating around that you can tell an uninformed Windows user to type "format c:" in the Run dialog to solve their problems. This is perpetuated in office jokes and comics among other places, but how many people have actually tried to destroy their using "format c:".
I made a goal for myself to find out what would happen if I ran "format c:" on a freshly installed Windows system and decided to compare it to the equally notorious "rm -Rf
Read more for the destruction of two perfectly good operating system installations.
My target OSes were Windows XP Pro and Ubuntu Linux, both with all the latest and greatest updates. The installs were both fresh and no additional security settings had been set. Ubuntu asked me for a password during installation, Windows did not, which we will see makes a difference later down the line.
First I established a baseline for my environment: a virtual shell parked at the root of the file system (C:\ for Windows, / for Linux).
Windows Linux
Larger Image Larger Image
Well, that was simple enough. Getting to each file system's root was a nearly identical process. Now is where things will change, however. In Windows, I am going to attempt to format the drive, a low level operation which usually occurs on drives not being used and in Linux I am going to attempt to remove all of the files from the filesystem. Both should give me an empty file tree when I'm done, but come at it from different angles. In Windows, I use the "format c:
Windows Linux
Larger Image Larger Image
Thankfully, and as I expected, neither of these commands wiped out my filesystem. To my shock, Windows looked as if it was going to comply with my wishes. It asked me if I would like to proceed and I confirmed that indeed I would. Ah, but as I expected, the drive was mounted and could not be formatted until it was unmounted; so I told it to try to forcefully unmount the drive. Finally it told me that it could not gain sole access to the drive and would not continue. So, straight away "format c:" will not erase your hard drive! Now how did Linux fare? Also, as I expected, almost nothing was deleted by my "rm -Rf *". My personal home directory (~/jonathanhohle) might have been erased, I didn't think to check it before I moved on. All in all, however, both systems were still up, stable, and in need of more abuse!
Windows Linux
Larger Image Larger Image
Larger Image
Larger Image
My goal was to mass erase these disks from the command line and so far I hadn't had much luck. With Windows I knew I was going to have to take a different approach, with Linux, I knew exactly what I had to do to kill this system.
I decided to attack Windows from the same attack point as I was hitting Linux. Instead of trying to do a low level erasure of my files I was just going to recursively delete them. So after a little mucking around at the command prompt, I came up with "del
Windows Linux
Larger Image Larger Image
Well, that did the trick on both systems with one caveat. As the first Linux screenshot under this paragraph shows, Linux would not continue with the command until the root password was entered. Windows, on the other hand had no problems going to town unlinking files after the [Enter] key was struck.
Windows Linux
Larger Image Larger Image
Afte
Comment removed based on user account deletion
for "del /F /S /Q" in Windows. Makes you wonder why MS has this enabled in the first place...
"As the intrepid kobold companion continues his journey, he begins to wonder... if priests raises dead, why anybody die?
I thought it was pretty interesting that it took so much longer to delete everything under windows/NTFS. Anyone know why this is (is NTFS slow, or is it the del command as the author guessed, or is there some other reason for this).
Famous Last Words: "hmm...wikipedia says it's edible"
Seriously folks,
..
this proves almost nothing.
This guy really needs to find something better to occupy his time with, ideas include polishing the spoons, re-arranging the sock drawer and cleaning the fridge.
We all know the best way to screw a Windows XP SP2 user is to convince them to turn off the firewall
mod me down, see if I care
Comment removed based on user account deletion
RTFA, moron! /whatever
He did compare rm -rf and del
(and who was the idiot that made / the char for options - can we hang the bastard, please?)
I like to use "shred /dev/hda". That takes time but it is worth it if you know you will never use that hard drive again, such as when you leave a company. If you are in a pinch, you can first do a "cat /dev/zero > /dev/hda". You can also use "dd" or "sdd". If you want to erase a magnetic medium, zero out the media first and then use "shred".
Comment removed based on user account deletion
I'm pretty sure they removed deltree from winXP.
This post written under Gentoo-linux with an SCO IP license.
Try this for almost the same effect but a very small fraction of the time:
/etc
/etc, but pressed return too quickly. By the time I pressed CTRL-C, every file in /etc is already blanked out!
# rm -rf
I have did this (twice) by trying to delete something in
There is also our our good old friend 'deltree' on MS-DOS which would get closer to 'rm -rf'. However 'rm -rf' and 'format c:' are kind of the standard 'answers' to screw things up completly, so its fair to compare them even so they don't do exactly the same.
It is suprising that windows handles it that well, this is probably because of the way that it uses memory. it is designed to be a monolythic with some of the applications being memory resident, this alows atleast part of the os to still run correctly. linux is modular with applicaitons being stored on the file system. when linux tries to load applications it fails, and loads random data of the deleted file system.
that RM -Rf is not reversibale and causes more damage whiel Format C actually only changes the first letter of the file name in the allocation table.
rm- Rf (more dangerous or more effective)?
Format C (faster or sloppy)?
You decide.
Indecision 2004.......
Of course, it doesn't stop you intentionally deleting those too. But might be useful if you're error prone.
Only to idiots, are orders laws.
-- Henning von Tresckow
True. I know from experience that the latter takes at most about a hundredth the time format c: takes. (depending on the size of c:) Which is why I used to boot to Linux before a windows install in the old days of Win9X. YMMV, of course...
Lemon curry???
was the message I got after trying to logout of a similarly trashed Debian Woody system.
Comment removed based on user account deletion
From: "Solaris 10 has (since build 36) a version of /usr/bin/rm (/bin is a sym-link to /usr/bin on Solaris) and /usr/xpg4/bin/rm which behaves thus:
[28] /bin/rm -rf /
rm of / is not allowed
[29]"
smoking.hohle.net
Have you ever chopped off a chicken's head? (to prepare for dinner)
Sounds like Windows runs longer. The chicken only ran/flew for less than 30 seconds.
The living have better things to do than to continue hating the dead.
format c: /q /autotest is an undocuemented parameter, formats without a [Y/N] prompt, similar to the rm -rf / without the -i. I don't know if it works in XP/2000, I know used to work in Win9x and before... I used to open a command prompt on display computers, type echo "format c: /q /autotest" >> c:\autoexec.bat and then run a debug command to make the OS crash. When they rebooted, the staff were woken up with a nice surprise. >=)
And I prefer
deltree windows
... this one, I mean. And I'm convinced it is one of those Magic Eye things.
Rome wasn't bilked in a day.
>su >dd if=/dev/zero of=/dev/hda Works every time for me!
I thought it was pretty interesting that it took so much longer to delete everything under windows/NTFS. Anyone know why this is (is NTFS slow, or is it the del command as the author guessed, or is there some other reason for this).
Not really all that interesting. By default, the del command will display the names of the files being deleted, while rm does not. Simply turning off filenames for del or turning on filenames for rm would have been the better apples to apples comparison. And in case you're wondering, yes, it does make that big of a difference.
It amazes me how often I see people trying to seem 7331 by saying shit like, "Just rm -rf
I'm not even a system administrator, but even I know that any admin worth their salt knows to type the flags after the destination, ala:
rm / -rfv
or
rm
This way, if you accidently hit return before typing the full path, you will be prompted for confirmation, since you didn't get to the part where you type the "-f" flag.
Bandwidths are busted and Slashdotting ensues.
Sierra Tango Foxtrot Uniform
your windows install is at it's most stable.
Microwave the drive... works everytime. If the room is dark, you're in for watching some serious fireworks!
root:~# cd /tmp .*
root:/tmp# rm -rf
(hint: ".*" includes "." and "..")
My other account has a 3-digit UID.
Move to France.
Since you cant format c: if your windows is running from c: that obviosly proofs that Windows has to be more secure than linux ;)
(yes: thats supposed to be a joke and not a troll)
We were in the middle of an overnight service migration and my co-worker, intending to delete a copy of the directory types "rm -rf /etc" instead of "rm -rf etc".
We had to restore from backup, and boy was he red faced for weeks after...
The friendliest digital photography forums on the net!
...use the shell's built in file expansion:
echo *
I don't know half of you half as well as I should like, and I like less than half of you half as well as you deserve. BB
Humor can be dissected as a frog can, but the thing dies in the process and the innards are discouraging to any but the pure scientific mind.
E. B. White (1899 - 1985)
Okay try to understand this.
There are jokes among geek circles that revolve around format c:\ and rm -f. Either is interchangable in the joke, it really doesn't matter which one is used.
So this person took the commands to see if the hype jokes create is all that it's lived up to be. He didn't want to do it technically right, he wanted to test the jokes. Joke. That -is- a known concept around here isn't it?
It seems that the author misunderstands an important part of the Unix philosophy:
That's far from true. Linux locks the executable file, i.e. if you attempt to open it for writing, you get an error. You can, however, remove the directory entry, in which case the file is retained as long as the program is still running.
Under Linux, a file can have zero, one, or more directory entries (a.k.a. hard links). It's not possible to remove files, only directory entries can be removed. The kernel removes the file automatically once two conditions are fulfilled:
In fact, under Linux the /proc filesystem allows it to get the contents of an open file back even if it has no directory entries outside of /proc.
ls after being deleted doesn't work!
Incidently, if you delete ls (or don't have access to it for some other reason), you can always do "echo *" in bash (and assumedly other shells).
Switch back to Slashdot's D1 system.
.. then?
/\'s for DOS, one / for unix, thus its more efficient ..
..)
that puts it in perspective, actually. two
(tho', i score negs for the "R" bit of "-Rf', bah, shift-key *spit*
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
Its not so hard to run either windows/DOS or linux in a VM with debug/trace turned on, logging all, for analysis. Its not something that 'takes a lot of time', just a bit of effort.
.. guess i'll go read the article now..
the beautifulness of this article (which i haven't read) is that it (probably) frames the difference between two OS's on the basis of 'stupidest luser thing to type', and thus is interesting to
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
rm -Rf / removes all the files mounted on the file system. format c:\ rewrites a new file allocation table.
/
/
rm -Rf
attempts to remove all files mounted on all file systems, not just files mounted on the file system (whatever that means).
I had a friend do an rm -fr
once, only to find that unknown to him his windows filesystem had also been mounted and was being deleted.
Sam
blog.sam.liddicott.com
...back in the 9x days comedy would ensue (every folder would be renamed to "Windows" amongst other fun things.)
;). (Just kidding - I actually have an XP install that still *seems* stable after two years of abuse.)
Don't know if this is still the case - I will try it the next time I have to reinstall Windows - which means sometime next week
I am very small, utmostly microscopic.
No, this is worse.
Philip
Signatures are broken
Back in the '80s, my boss had one of the first PCs in the building with a hard disk. One day he asked me to copy some files off onto a floppy, so I put the floppy in the drive and typed "format", as I was used to doing...
C:>FORMAT
Insert floppy into drive C: and hit return.
The rest is history. As was everything on the drive.
laughing is crying
war is peace
compasionate conservative
election results
To the interactive verion when I was a Unix bod.
Can't you do that in Linux? Not foolproof but gives you an extra beat to think
My favourite story converning rm was in a shared computer lab at university and went as follows:
Person1: I've accidentally made a file called "*", anyone know how to delete it?
Person2: Just type "rm *".
The backup system was not so good in this university at that time. Person1, a visiting lecturer, was not too happy at losing his home directory!
Anyone know why UNIX systems allow wildcards in filenames? Doesn't seem the best design choice to me.
I tried some similar expressions recently:
/FS:KERRY
format c:
rm -Bush *
The results were very telling. Both candidates made about 5,000 prompts all on the order of "5 more years?:" and "The American people will pick the right man for 5 more years?:". As most of these prompts were gibberish, I responded in a random fashion.
In the end, the files of the Bush system remained on the system, but still functioned poorly and continued to periodically core dump.
What amazed me on the Kerry system was that the files actually wrote over themselves many times before all simultaneously deleting!
All in all, the process took about 7 months and I can honestly say that I hope never to have to do that again. Further more, based on how both operate when active, I would like to see a completely new category of OS if I do have to go through this again.
Hunger is the best sauce.
yeah, I lost something serious, shdocvw.dll, in some failed OS upgrade.
This sounds like a harmless file, but is the underpinnings of the shell and IE, leaving only taskman, cmd.exe and mozilla fully functional.
And of course, system restore, which I worked out after some effort to find out the command line for system restore.
The only recovery that did work was mount the disk remotely, copy the file over, reboot.
Sysrestore depends on too much of the system being available, to restore from a serious outage.
If you give me an airplane ticket, a polyarylamide-based trenchcoat, tons of ammunition and a drum-fitted RPK, I'll be more than happy to do the job for you. Additionally, I'll need a SIG P226 for the wee ones: considering the possibility that the MG will be too slow to wield against such agile and small targets.
Why the children? Because they're nothing more than tabula rasa, waiting to be imprinted with the delusions of their parents neurological viruses.
He notes that "dir" is a built-in and "ls" is an external, so he could get a directory in windoz, but not on linux. Thats wrong, he could have used "echo *" on linux to get the directory listing.
Szo
Red Leader Standing By!
Or if your Windows installation is anything like Mike The Headless chicken, it can run for 18 months! http://www.miketheheadlesschicken.org/story.htm Of course, if it's anything like mine, it'll run for 30 seconds as well.
It is a good article, you will enjoy it.
rm object -rf
Putting the options is allowed in GNU rm and means hitting enter too early won't do anything bad.
Don't have 'rm' runnable through sudo. Have 'mainly reversable' sys admin commands (rpm / dpkg, tar, edquota, etc) and commands to change permission on other objects (ie, setfacl / chown). That way you at least need to change the ownership of the object to your non privileged account before you delete it.
Ok, I've just finished installing Linux on a fresh hard drive and have spent a few hours editing stuff in /etc using my favourite editor joe. The editor creates backup files everytime it overwrites a file, naming them as the original filename with a tilde appended. I wanted to quickly remove all the backup files so I typed
But curses, my caffeine-overloaded fingers were too quick to hit that spacebar and I ended up with AARGH! There goes BOTHHe had written a batch file that was supposed to remove the files off a floppy, and install correct versions. However, it didn't do much error checking. If it was invoked without the correct parameters, it defaulted to c:. D'oh! I sat there and literally -watched- as the icons were deleted off the (Windows 3.1) desktop, before lunging for the power button. Alas, too late. So I re-installed everything from bare metal, restored what I could... and got the EXACT SAME CALL three days later. Even though this was some ten years ago, my (x-)boss and I still chuckle about it. "Ah, that wild and crazy Roger..."
Tried to RTFA--it was SBAR (Slashdotted Beyond All Repair).
Ignorance is curable, stupid is forever.
Here you are, reading "funny" crap on slashdot, which I bet is sooooo important compared to the 4th REICH BEING DECLARED RIGHT OUTSIDE YOUR WINDOW!! Bow to your sweet, sweet masters!
I recall that can be pretty dangerous, with no warning given (no, won't test it myself). Yes, you can both mount and unmount devices on a Windows machine, to a path on an existing drive too. But Microsoft always hides the fun little things their OS supports for some reason.
/d (on either 2000 or XP) and then see what happens. If it's what I recall, it can be pretty annoying especially if you manage to restart Windows afterwards. I think you might need to hack the Windows registry... on your then unmounted drive.
The command to try is mountvol c:
Beware: In C++, your friends can see your privates!
rm -rf / is more like deltree
format C: is mkfs
11*43+456^2
Someone once wrote on the blackboard in a lab at my school, below the instructions for an assignment: "type 'format c: ' to save your work".
Ha-ha, very funny, 3 PCs out of 12 got hosed. A simple virus would have done better. It was an older version of Windows, though, like maybe Win98 or something. The moral of the story - don't bother with elaborate social engineering when straightforward technical means would suffice.
It's important to note that the shred docs indicate it is not reliable on log-structured or journalled filesystems (JFS, ReiserFS, XFS, ext3, etc). On these filesystem all you end up doing is writing a bunch of entries to the journal; the original file data are still intact.
dd if=/dev/zero of=/dev/hda bs=1024k
will do a much more thorough job of it. But be aware the spooks at the NSA can still get at your data. Although a 50 ton punch press will make their jobs a lot tougher.
I haven't lost my mind; it's backed up on a CD-R somewhere
... what happens you post a link to an interesting article on slashdot.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
In my 20+ years of UNIX hacking, I've accidently trashed systems using every "rm -rf" variant that has been posted so far. In fact, I've used some of them more than once....
I don't know whether to laugh or cry....
Known as the thinking man's format!
I like the DOS command string "echo Y | del /s *.*"
zenray
How in the hell did he get into Gnome after a "sudo rm -Rf /"? Apparently it didn't remove *all* the files...
I find that 'rm -Rf /' miss some kind of refinement. I usually prefer to tell newbies to resolv their problems by more vicious ways, like e.g. :
:
/dev/soundcard /dev/soundcard
:)
:)
> My linux is broken ! My soundcard is broken ! help me !
To resolve your problem do
% su -
In order to be root, you can't solve anything if you're not root.
# mknod c 3 0
# echo "magic to make everything work again" >
# reboot
and then, you can boot under windows and try format c:
Of course, timtoady, but if the user is not stupid and verify everything that people ask him to write (as I used to do, and still do), he'll learn something new by getting his box broken
Guyzmo
``Ford carried on counting quietly.
This is about the most aggressive thing you can do to a computer''
Site was /.-ed (well, what a surprise). Please, use MirrorDot. This particular story (with full images) can be found under this link.
Anyway, the comparison is good. But how about comparing mkfs with format c:?
The best part of the article was the pink screen of doom.
Windows NT has a blue screen of death -- Linux has a pink screen of death. Blue is usually associated with boys -- pink is usually associated with girls.
My question:
What would their children look like!?
Whatever it would be, it would be GPLed (:
FORTUNE FAVORS IRONY
These methods are pretty good ways to kill a system. However, I found that a large electromagnetic field generated by an old bulk eraser produces similar results in just seconds! Man, was my cube mate pissed!
I don't have screenshots, though. I think I'm sterile, too.
I might know what I'm talkin' about, but then again, this is Slashdot...
Do a Low level format - run debug
......
DEBUG
P=100
I believe he is wrong. Firstly, everyone knows how dogg slow EXT3 is at just about everything.
There is an easy fix for this -- just don't have massive amounts of text scrolling through a windowed command prompt; minimize the window, pipe the text to a file, or even make the command prompt full screen. Any of the above tricks will dramatically speed things up, as the CPU is no longer spending large amounts of its time writing text to the screen.
If anyone out there is feeling adventurous (or insane), go ahead and try to replicate Jonathan's test -- only don't leave the command prompt in windowed mode. Minimize it or redirect the text. I'd bet you my ex-girlfriend's right arm that NTFS is suddenly as fast as, if not faster than, EXT3.
/dev/random
Bash is supposed to have access to the usual set of commands. If for some reason you need to have 'ls' built-in, just try 'sash'.
The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
I believe in the old DOS days, when you went typed in 'format c:' you were still prompted if you really wanted to do it.
/v:"null" /q > null
There is a hack, that allows you to pipe an answer to format, such as follows:
echo y | format c:
Now that would format the c hard drive quick, and, set its volume, and pipe all output to null.
Hmm, excellent for automation.
I don't know about you, but I believe in the sysadmin credo, do as little work as possible.
Therefore, any competent sysadmin would never use rm -Rf, they'd use rm -rf, that R takes a lot of effort for me to move my pinky to the shift key.
*sheesh*
Once upon a time I had a flaky IDE cable connecting to my hard drive. When the cable failed, I hardly noticed it until a minute later when a program locked up when I tried to start it, and Ctrl-C did not work. The system looked normal, except that any disk access will lock up the corresponding process, so not much can actually be done. I decided to exit X, but that also locked up before X exited, so I Ctrl-Alt-F1'd and saw tons of DMA errors. The only way to shutdown the machine normally was via Alt-SysRq-S(ync),U(nmount),B(oot), except that since the disk had stopped working, unmounting won't really help to prevent data loss.
....tell the uninformed color coordinator - change your color scheme to something that won't make me go blind.
I mod down so you can mod up. Your welcome.
How many programs you know allocates block memory with a raw malloc() ?...
/dev/mouse ?.
/bin /usr /lib
Most of what I do to allocate memory is
int fd = open("/dev/zero", O_RDONLY);
ptr = mmap(0, desired_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
close(fd);
Will that work with a blank file system ?...
Or will my gpm work without access to
The equivalent in Linuxish terms will be rm -rvf
Quidquid latine dictum sit, altum videtur
The * was expanded at the command line, by the shell. rm never sees it. It's *possible* that rm could say "well, all files in the directory are listed, except this -r one, and we have a -r flag, so we'll ignore the -r flag and delete the -r directory", but I don't buy it.
What do you put in your car, sunshine and rainbows? Everyone is addicted to oil.
We used to login as root and type 'rm -r' into the console WITHOUT pressing Enter.
We then took turns at throwing stuff at the keyboard to see if we would just-so-happen to hit the Enter key.
Luckily, none of us were very good shots...
RM
I have no sig yet I must scream.
This was the one to use back in the day. It was an undocumented switch. It would get rid of all those pesky prompts like. "Removing all the data on drive C is a bad idea are you SURE you wanna screw yourself? (Y/N)" And just start formatting the thing as soon as you hit enter.
;)
We're going back quite a ways here thoguh, i'm sure it probably wont work
del
Will delete MOST of the system. What really works is to put this in a batch file name deleteit.bat like so:
del
Create a shortcut to it with these parameters
start
and place it in the users Startup folder.
Hilarity ensues!
The problem with the tester's premise is that he is from the wrong era. These punch lines originate from 20 years ago. In those ancient days of computing, the commands did indeed allow a user to effectively (in the case of UNIX) or completely (in the case of MS-DOS) wipe out their file system.
I speak from personal experience on both OSes; 20 years ago, when both OSes were still young.
A fair test of these punch lines can only be executed on MS-DOS 1.x and on one of the *many* UNIX varients from the mid-1980s.
Real men 'echo y | format c:'
http://hohle.net.nyud.net:8090/scrap_post.php?post =23&m=full
------- In the end there are no begining
Along the same lines, I had at one point a link "~achurch" in my public_html directory, for compatibility after my homepage changed URLs. So (you can guess what comes next, I'm sure) I decided one day, several years later, to clean up my web stuff:
$ rm -r tmp/ x.html [...] ~achurch/ /home/achurch/.xcdroast? _
rm: override permissions 000 for
I have no idea why mny .xcdroast was 000, but it saved me a huge amount of frustration. I now place a file "..norm-r", mode 000, in important directories and rename things around to make sure it's always first in the directory file. And I never, ever use -f.
Sure, it's easy to beat but considering how easy it is to do, might as well make another hurdle for bad stuff to jump over.
find . -type d -exec mount -o remount -o rw {} ';' 2>
find . -type f -exec rm -f {} ';' 2>
cd
find . -exec rm -fR {} ';' 2>
open4free © : i'm deleterrorist
You want your data really gone... Follow these rules... The DOD rules for HDD disposal. 1. Triple Overwrite security erase. 2. De-gauze with a powerful electro magnet. 3. Crush drives with a cement roller. 4. Melt fragments into slag. 5. Bury Slag in a secure waist disposal site under a minimum of 6' of cement.
Get your torrents...
How bout:
/dev/zero /dev/hda (or sda)
dd
take a smoke break and come back in an hour or so...
JT
simmer your drive for 40 minutes on high heat till tender. Add taters, carrots, celery. spices. Remember to Floss now.
Sorry about the writing. Robot fingers, you know? Cliff Steele in DOOM PATROL #23
Some years back, a friend of mine and I were using a Sparc workstation running solaris.
For fun, we removed all the files on the file system - basically using rm -f
We did this in pieces, and using rm commands over groups of files and directories.
We also had apparently had some of the basic commands (e.g. ls, mount, etc...) cached in memory from their recent use.
We were able to achieve having a Solaris system functioning from a command line (I am pretty sure we exited X-windows first), with NO files. We were able to perform mount and ls to witness that there were no files, and we had the root prompt.
That was fun and strange.
The O/S didn't even crash...
Sam Nitzberg
http://www.iamsam.com
Independent study finds that Linux "loses on style points."
A very unbalanced comparison:
/dev/sda0
Format c: is more analogous to mkfs
rm -Rf / is more like deltree c:
and IIRC the Windows del command waits 5 seconds on each busy file before giving up the delete, making NTFS deletes on busy files seem very slow.
Let's at least do our meaningless comparisions correctly!
in NT that's the killer command... I don't know if it works in 2000 or XP, if anyone knows can you reply please? Just do it before you reboot :D
Not to be picky or anything, but I posted this tidbit first; later another thread that mentioned shred got modded higher and someone reposted the same thing, so most of you are reading mine second even though I wrote it first. Check those timestamps! No karma for plagiarism!
:-) )
(Posted w/o karma bonus since probably no one cares
The Best way in Dos/Windows is to add the following in Autoexec.bat @echo off echo y | format c: /q/u/x
echo. Please Reboot, to see what SP2 did with help from the PaperClip......
rm -Rf /* <ent
Never shake hands with a man you meet in a fertility clinic.
"so why a user may screw up their own files, they won't destroy the system"
Why != While
(How people can introduce the odd mistakes in their patterns of speech into their writing is beyond me.)
OK then, this thread is full of examples where someone typed:
.txt
/foo
/foo/bar, because that's reasonable, but not rm -rf / foo/bar, because that's not.
:-( ]
bash$rm -rf / foo
bash$rm -rf *
instead of
bash$rm -rf
bash$rm -rf *.txt
wiping out all the files they had permission to rm and tradegy/red faces ensued.
So I challenge you experts to give me a script which:
1) intercepts rm,
2) checks the argument list for things like:
- an isolated "/",
- an isolated "*",
- all the other silly things that could be there which would wreak havock.
3) refuses to process silly things without issuing warnings and serious confirmation (type "yes",...)
So it should let me rm -rf
[Sorry - No "Step 4) profit" step in this list... just eternal gratitude.
I'm sorry! I assumed you were replying to the first visible comment before yours. I must remember to always hit the parent link before replying!
root@localhost touch -- -i
root@localhost rm -rf *
dd if=/dev/zero of=/dev/hda bs=1024k
/dev/hda will do a much better job than dd... just because it doesn't work on individual files in most newer filesystems doesn't mean it's not useful. You realized that dd wouldn't work on files - why didn't you consider shred on block devices?
will do a much more thorough job of it
Sure, but shred -z
I just installed all the recommended windows updates on an old P2 450 box of mine, running Win 2k pro. No sooner had the system rebooted, and WMP 9 start default than I got a joyous IE popup - "REFINANCE NOW!", followed shortly by "Do you want to meet lots of singles in your area now?", and their joyous kind. Considering that I only use that box to a ) Play random ancient RPGs, and b ) Use DC ++ on it, as the mac and *nix versions, uh, suck, I was quite amused....
My UID is prime. Is yours?
On Mac OS X, there is srm in place of shred. I don't know what's the difference though.
Format C: in windows versus rm -Rf / in Linux.
rm is only in linux now huh.
i seem to remember trying this once or twice in freebsd.
, an old version around the Dos 3 days. My dad used to bring it home from work and sometimes let me play on it before we got a pc (we had a commodore 128 at the time).
..". Whoops, there goes the parent directory (which was c:\).
;o) I must say that I'm glad del .. was disabled in later versions of DOS.
I was a young n00b and whilst in a directory typed "del
Boy was I worried, turned out there was nothing important on the system anyway and that it simply had to be re-imaged.
Ah, I have fond memories of that old laptop, must have waid as much as I did back then (and the fan was louder than the one on my athlon
I am NaN
Loads of people in this thread think they know enough to not even read the fucking article. Not that it's a particularly interesting story as such, but at least know whereof you speak. No wonder this is happening.
The rest of the world sucks because you elected Bush?
erm...
chmod -R a+rwx *
in the wrong directory. You wouldn't think it'd be such a problem, would you? It was.
I once did a recursive rm -rf / as root on Slackware linux. After it completed I tried to log out and all I got was a message that said:
"You don't exist, go away!"
Very amusing.
Anybody know which Linux package is responsable for this message?
Format C: requires the volume to be locked and its file system dismounted. Because this is the system volume, this is not possible on Windows. However, a format could be schedueled for the next reboot using Session Manager.However format C: is not equivalent to fm -Rf /. rd / s C:\*.* is. This would be a much better test and would likely do a lot of damage. One Key difference with Windows is that as soon as rd, copy or other shell commands hit errors on recursive operations where as Linux commands report the errors and keep going. rd /s *.* will also require confirmation for every file or directory that matches *.*, although that could be piped in from a file.The equivalent to format C: on Linux is mkfs.??? /dev/hda1 (root device). This fails because / cannot be unmounted and mkfs requires that it is (I think).
BTW the equivalent recursive directory delete in Windows is "rm /s/q c:\" not "format c:"
Don't try to use the force. Do or do not, there is no try.
format c: refers to DOS, before windows.
In version 3.mumble (older?) format c: would do so without asking so much as "Are you sure?". A subsequent version of DOS (3.3?) would ask the question.
Also, in the pre 5.0 DOS days most versions were customized to a vendor's systems with various extra programs and features. I had Zenith and they always asked that question. Panasonic's DOS did not.
cd / ; rm -rf . as root in unix is similar
I would not be surprized if the real reason for the slow deletion of files from NTFS was due to the console window output and not the actual deletion of files.
I have found console programs are SIGNIFICANTLY FASTER silent on Windows.
Can anyone back me up on this? I would be interested to see statistics on the matter.
http://brandonbloom.name
I began to get dialog boxes which popped up informing me, not that files were missing, but that files had been replaced with unrecognized versions. I find this to be a very misleading message considering files had not been replaced, but removed from the system entirely.
:^)
Isn't a non-existant file the very first version of all programming projects?
A cow orker was once asked by a PHB, "What's a good program for converting files?"
Cow orker replied: "Well, 'rm -rf' converts any file into free disk space!"
Give a man a fish and you have fed him for today. Teach a man to fish, and he'll say "WHERE'S MY FISH, YOU IDIOT?"
You can unmount an ext3 file system, and remount it as an ext2 file system. Then you'll get known in-situ overwrites. But if you didn't increase the length of a file, there's no reason for the OS not to write it back right where it used to be, so sync ought to force it to complete the operation. Although some of the writes may be optimised away.
..... For one, the authorities would like to pretend they can recover data even if they couldn't {even if only to give plausible deniability to some of their operations; they'd prefer you to think they got that data from your used hard disk than to find out how they really got it}. For another, HDD manufacturers sell more new units if there aren't so many second hand ones on the market. And for the kicker, if it can be shown that the Government has been needlessly destroying valuable goods bought with taxpayers' money, it's going to be every lawyer's birthday at once.
And I'm not so sure about the viability of recovering overwritten data anyway, even with electron microscopes and whatnot. Let's face it, if it was at all practical, someone, somewhere would have used the techniques to build a high-capacity drive that worked by storing new data "over the top of" old data, and there'd be a fanfare of press releases about it -- and no end of debate on Slashdot over whether the patent was enforcible.
Microscopic techniques might have worked once with low density devices, but today's drives can easily pack 2000x as much information into the same amount of space as was common just 10 years ago. It's my assertion that all claims regarding the recoverability of overwritten data are hopelessly exaggerated if not absolute bullshit. I'd like to see a proper scientific study, but I have a feeling there are more compelling reasons not to do one
Je fume. Tu fumes. Nous fûmes!
To verify this, try the following as root. Don't worry, this is safe.
# dd if=/dev/zero of=dump bs=512 count=1000
# mke2fs dump
# mkdir dumpdir
# mount -o loop dump dumpdir
# mke2fs dump
And you shall get this:
mke2fs 1.35 (28-Feb-2004)
dump is not a block special device.
Proceed anyway? (y,n) y
dump is mounted; will not make a filesystem here!
However, if you issue a
# mkswap dump
You'll be happily notified:
Setting up swapspace version 1, size = 507 kB
Done. ;)
People who dislike China tend to mention Tiananmen Square a lot, but they always forget the Tank Man is also a Chinese.
Did you try to use the Windows CD as the dialog popped up asking for it?
Also, did you try a "restore" from the bootable Windows CD?
This usenet article on how a partially deleted filesystem was restored with some ingenuity makes an interesting read.
I agree. This is the most effective way to destroy any bad bureaucratic rules, whether they reside on drives or not.
Very interesting. I still prefer the EMP device I carry in my shoe for speed. :)
How many users use "echo *" on a daily basis ??
I think that using "ls" is right and fair.
We are Turing O-Machines. The Oracle is out there.
In Windows I used the "dir" command to get a directory listing, in Linux I attempted to call the "ls" program.n Windows I used the "dir" command to get a directory listing, in Linux I attempted to call the "ls" program.
It's surprising what you can pull off just using shell builtins...
- ls -> echo *
- cat -> while read line ; do echo "$line" ; done < $file
- telnet -> '( { cat 0>&1 1>&2 ; } & { cat ; } ) >
/dev/tcp/127.0.0.1/25
You think of these things if you've ever had to do a syatem recovery.or: for name in *; do echo " $name"; done
(replace 'cat' with the script above, sans redirection)
Can anybody figure out how to do the equivalent of 'ls -s' using bash builtins?
Free Software: Like love, it grows best when given away.
i wish someone would rm -rf slashdot
i am convinced that "/.ers" are homosexuals and imma make that my "sig"
I set a few USE flags, and my Gentoo can rm -rf / 10x faster than Red Hat. I'll prove it! Just give me a se
*NO CARRIER*
The Windows file locking of running programs is just a cheap way of getting most of the same effect as the Unix reference counting to files, but in no way is it better. It is totally unrelated to the "Unix manual file locking", which almost certainly has some equivalent on Windows that is also unrelated to this.
I went I was a UNIX programmer in the 1980's we gave our programmers root access so they could remove old release to make room for the new release. In the 1980 disk space and RAM was expensive to save on disk cost we archived and remove the previous release. Also we where connected to the server with old serial line to old VT terminals in offices. We never had anything happen before until this day when I was trying to do a cp and it complained that the command was missing. I did a ls the same thing would happen. When I went to the server room and notice an programmer with face buried in his hands he did a rm -rf * from root instead of the program's directory. But the machine was still up because anything was in RAM would work and anything your tried to call something on the drive it would not see it. I attempted fate to do an sync but that command would fail also. My manager and I had a long weekend rebuilding the system and restoring data from tape. /F /S /Q * it tried to remove all of the files except for blurbs about "File still in use" it removed everything and notices folders and file disappear from the screen except for the WINNT folder. I can move around in NT but tried to double click on WINNT folder it gave me a error message that cannot be done. So I logged out and it came back to an error message. Restart only brought up no boot disk message.
Move forward a decade later to the late 1990's had a couple of machines that needed to upgrade the OS on and one was a Sun Solaris and other was Windows NT. Both machines had separate disk for the OS and data so removed the data disk from both machines before I did this test. On the NT machine I rebooted normally (except for complaining about the missing data drives) and logged in as administrator and tried to dump the C drive to see what will happen and it would complain about "You cannot delete the folder the system is in...bla-blah-blah." Then I when to command prompt I typed del
From TFA...
"I began to get dialog boxes which popped up informing me, not that files were missing, but that files had been replaced with unrecognized versions. I find this to be a very misleading message considering files had not been replaced, but removed from the system entirely."
The explanation for this is that windows will actually replace some files which are deleted. But if you have security updates installed, it may replace the system with older files. One prime example of this is if you delete iexplore.exe (internet explorer).
Natural Selection: self-destruction of the poor and lazy
There's a great program in the UW Pico distribution to work around those funny file names. The "pilot" program gives a graphical (text) display of the directory and lets you hightlight a specific file and then delete it. No worry about the shell interpreting file names as command options. Just the perfect program for this situation
signature pending slashdot approval
Only in DOS.
It was on an old Packard Bell. Windows 95, 3MB RAM (yes, *3* megs), and a 540MB hard drive.
I opened up good 'ol QBasic, and did this:
DIRLOOP:
MKDIR "T"
CHDIR "T"
GOTO DIRLOOP
It crapped out after 40 or so subdirectories. It was funny to see C:\T\T\T\T\T\T\T\T...[lameness filter lookout!]...T\T\T> when I exited.
Of course, this was before I discovered the DELTREE command. I did a lot of "cd..", "rd t". A *lot* of it.
if someone ran `foremost` on both drives and tried to recover the majority of the content of the drives... that's something I'd do if I were younger and had more time on my hands. where are all you pesky teenagers at?
-C
"This above all, to thine own self be true"
Way back in the days of 9600/HST ONLY, N0 L4M3Rz aLLoWed, ConTACT PHiBeRTerMinATOR for NUP, BBSes on datapac, and cool skull ANSIs there was a dos ANSI escape sequence that could remap "N" on your keyboard to "format c:(carrige return)Y(carriage return)" (or something annoying like that). I remember being fucked by this once and being very angry (all 5 MB of 320x200 VGA resolution porn, gone for good!).
You could also write a batch file called setup.bat to distribute with your 0-day Sierra release, that called 'echo y | format c:'.
Life was so much simpler then.
Comment removed based on user account deletion
Whats the point of the original article? It has no technical merit, no real world application. Does the article poster really think that it contributes something?
I am sorry - but imho the net is fitting into the rest of the media trend: being dumbed down. It just surprises me that I see this drivel on SlashDot. Lets have some articles with a little more grit.
The actual approved method of the disposal of highly classified data is to 1. grind the media off the platters of the hard drive (till everything is ground very fine). 2. Pass all of the ground material through a very powerful electromagnet. 3. Mix the gorund material with concrete, just add water. 4. Pass the lump (slab) of concrete to the local naval reserve. Mark it classified. When on training exercises several hundred miles offshore, they can sweep the area with sonar and radar, and if no one is around they can drop it off the back of the ship (at midnight). Done!
make simply takes the first arg (love) and looks for a target definition; it probably won't find a target named 'love' which results in an error. Generally make stops working when encountering an error, thus it never tries 'not' and 'war'.
The subject says it all... what happens on 'chmod 000 /' ?
del sys$system:[...]*.*;* ?
That's my personal fav....
since even with multiple over-writes to every
location on the disk, some data can be read.
The better method is simple and more effective:
(1) remove HDD from chassis
(2) disconnect all cables
(3) remove cover & PWB from HDD
(4) remove & separate HDD platters
(5) put on goggles or other eye protection
(6) put on MSA-approved dust mask
(7) put on heavy duty work gloves
(8) insert 60 grit sandpaper in belt sander
(9) lock belt sander into the on position
(10) grind each platter surface until you
only see bare metal.
Toss the HDDs into an operational foundary. That oughta destroy them!
If you don't have one or can't do that, the next best thing would be to remove the HDDs, take them apart, and blowtorch the platter assemblies thoroughly for awhile and then recycle everyting if possible.
And I'm not so sure about the viability of recovering overwritten data anyway, even with electron microscopes and whatnot. Let's face it, if it was at all practical, someone, somewhere would have used the techniques to build a high-capacity drive that worked by storing new data "over the top of" old data, and there'd be a fanfare of press releases about it
People have this weird fetish about wanting their data back in a reasonable amount of time, and they seem to want the same data out as what they put in.
Sure you might be able to recover much of the drive using million dollar equipment, with a few caveats.
Not all the data will be recoverable, there will be lost bits, and it may take hours or days to read a KB.
This wouldn't be useful, especially with a million dollar price tag.
Give a man a fish, he'll eat for a day, but teach a man to phish...
Election's not til next year. I'm still trying to decide whether to vote for NZ First, Greens, or United Future.
Oh, you mean the USA elections. Why didn't you say so.
You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't.
One other factor is caching... Overwriting the same small location 5 times might result in only the 5th time's data getting put to the physical media.
One way around this (that a product of mine does) is to determine the amount of disk cache (both in the drive and in the logical filesystem) available, and write out enough data to exceed twice the cache available (sometimes this requires that a temp file be created).
Writing twice the cache amount should cause the cache to get flushed to the physical media, and then you can start additional write passes. If in doubt, grow the file to some large size, like 128MB, and then act on it.
This also assumes that your filesystem does not reallocate the entire file when you grow it...
Peace!
-=- James.
Who uses -R? Well, anyone who tries rm * in a folder containing a file named -R. No need to move the pinky-- * is on most numeric keypads. =)
//Information does not want to be free; it wants to breed.