5 ms·
I've always preferred this tougher command to screw VMs I was going to delete. dd if=/dev/random of=/dev/sda Depending on how long does it run, you end up
by gjulianm 14y ago
I've always preferred this tougher command to screw VMs I was going to delete.
dd if=/dev/random of=/dev/sda
Depending on how long does it run, you end up with a more or less screwed computer. It's funny to see how does the machine fall over when you invoke a simple 'cd' command after this.
- srl 14y agoBack when `/dev/mem` was a thing in default kernels (now you need a special config, or a module), I enjoyed `cat /dev/urandom > /dev/mem`. That would usually bork things pretty quickly, so then I would set random offsets with `dd`. Fun times.
- mikeash 14y agoSee also kmem Russian Roulette: https://twitter.com/shadowcat_mst/status/754107237269504 https://twitter.com/shadowcat_mst/status/754107237269504
- zx2c4 14y agoOr try this -- http://git.zx2c4.com/memory-hemlock/tree/slow-death.c http://git.zx2c4.com/memory-hemlock/tree/slow-death.c It picks a random device on your system -- ram, video, bios, etc -- and writes a random number of random bytes into it and then sleeps for a random amount of time. Last one standing lives.
- eridius 14y agoWhat's /dev/sda?
- gjulianm 14y agoOn Linux, the hard disk. This command, dd, copies data in bulk from /dev/random (a special device on *nix that outputs random bytes) to /dev/sda (your hard disk). That means it starts to overwrite your disk with trash, rendering the system unusable.
- eridius 14y agoI know what `dd` is. I just don't use Linux, so I'm not particularly familiar with the Linux-specific /dev entries. Thanks though.
- aroman 14y agoMost probably the storage device which is your HD.
- aidos 14y agoProbably your main drive.
- derleth 14y agoThe device file applications can use to access the first hard drive on most Linux systems. It provides raw access without filesystems or partitions. /dev/sda1 is the first partition on that drive, /dev/sda2 the second, and so on. /dev/sdb is the next hard drive, /dev/sdc the next after that; beyond /dev/sdz, the naming scheme is apparently dependent on the hardware driver in use: Going from /dev/sdz to /dev/sdaa is what happens in the default SATA and SCSI drives, up to /dev/sdzzz, at which point you apparently run into problems. [1] http://rwmj.wordpress.com/2011/01/09/how-are-linux-drives-named-beyond-drive-26-devsdz/ http://rwmj.wordpress.com/2011/01/09/how-are-linux-drives-na... [1] http://kerneltrap.org/mailarchive/linux-scsi/2010/9/20/6886603 http://kerneltrap.org/mailarchive/linux-scsi/2010/9/20/68866...
- huherto 14y agoAahhh. In the old days, we used this command just to mess with your workmates. while : do clear > /dev/tty sleep 5 done
- hp50g 14y agoWe wrote our own shell when I was at university (which was completely offensive, not at all obedient and generally no help whatsoever) and chsh'ed them if they left a terminal open :) (for ref, we had to do very naughty things to SunOS 4 to add it to /etc/shells)
- RyanGWU82 14y agoIt's not so funny when you do this accidentally, on a 2 TB disk full of user data, on a live production server, at 2AM on a Friday night... (The server was part of a MogileFS cluster so there were multiple copies of the data online. There was no data loss, not even any downtime. Still, it was scary as hell, and I spent all Saturday in the data center restoring the box.)
- xyos 14y agohow did you end up doing this accidentally?
- niggler 14y agoI've seen stranger: a redirect gone the wrong way $ foo < bar # runs command `foo`, reading from `bar` on stdin $ foo > bar # runs command `foo`, writing stdout to `bar` Writing `>` instead of `<` has resulted in many a blowup at 3 AM
- huherto 14y agoMy friend did this... rm * -i The system response was "-i not found" or something like that.
- ISL 14y agoI once discovered that apparently rm bob* has completely different behavior from rm bob * The above line of code successfully fixed a bug I'd been trying to find for weeks in source code in the same directory. When I rewrote it from scratch, the bug was gone.
- niggler 14y agorm -i is your friend
- 14y ago
- lucian303 14y agoI've always gone with the classic: rm -rf / However, sometimes that's protected so i switch: Lazy version: rm -rf /* Long version: rm -rf / --no-preserve-root But I do like your brute force random disk wipe method. I'll try that on the next vm that's gotta go.