Phew! I cancelled the 'sudo rm -rfv --no-preserve-root /' just in time!



  • So I wanted to see if the old 'rm -rf --no_preserve-root /' command actually deletes anything important (mostly so that I know how authentic jokes involving it are).

    I opened my linux VirtualBox VM, made a snapshot, was smart enough to mark the shared folders as Read-Only, and started the delete.
    I quickly found I had to add a -v to see it working and a 'sudo' prefix to get anything real done.

    Then after it deleted the /usr/bin stuff, I noticed it started deleting my shared folders anyway!
    Luckily, I managed to stop it before (I hope) it got to deleting anything unrecoverable.

    I'm assuming the culprit here is VirtualBox which probably doesn't actually apply the shared folder changes until guest restart or something. (At least I'm hoping it's not the case that you can modify shared folders marked as Read-Only!)

    So yeah, basically I managed to almost screw myself up with the ole' rm -rf command. Do I win anything?



  • @created_just_to_disl said:

    was smart enough to mark the shared folders as Read-Only, and started the delete.

    That's quite the buttumption.


  • SockDev


  • Discourse touched me in a no-no place

    @created_just_to_disl said:

    So yeah, basically I managed to almost screw myself up with the ole' rm -rf command. Do I win anything?

    Why didn't you just clone the VHD and actually do it? Some things you just gotta experience, like writing a recursive self-spawner.



  • I would like to point out that one of the best things about using a GUI is having access to the "undo" command and being able to recover files from the recycle bin/trash can/whatever.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    I would like to point out that one of the best things about using a GUI is having access to the "undo" command and being able to recover files from the recycle bin/trash can/whatever.

    Irrelevant. rm has a "do you mean it?" option like Windows, and an equivalent to Windows' "don't even ask" shift+delete, and the latter's what he choose to use.



  • @FrostCat said:

    Irrelevant. rm has a "do you mean it?" option like Windows, and an equivalent to Windows' "don't even ask" shift+delete, and the latter's what he choose to use.

    That's not even slightly equivalent. What about the case where I thought the command was correct (i.e. "yes I'm sure), but it had a typo or something and deleted the wrong files anyway? How do you recover from that?

    Oh, right. You don't. You're just fucked. Fuck you, user. I am the OS who hates you. I hate all my users. Fuck you all.



  • @blakeyrat said:

    What about the case where I thought the command was correct (i.e. "yes I'm sure), but it had a typo or something and deleted the wrong files anyway? How do you recover from that?

    In exactly the same way you recover from an inadvertently comprehensive Shift-Delete on Windows: by restoring files from your backups.


  • :belt_onion:

    @blakeyrat said:

    What about the case where I thought the command was correct (i.e. "yes I'm sure), but it had a typo or something and deleted the wrong files anyway? How do you recover from that?

    Oh, right. You don't. You're just fucked. Fuck you, user. I am the OS who hates you. I hate all my users. Fuck you all.

    What about the case where you Shift+Delete the wrong files in Windows? How do you recover from that?

    Oh, right. You don't. You're just fucked. Fuck you, user. I am the OS who hates you. I hate all my users. Fuck you all.

    edit - damn you flabdablet for hanzoing me. it was even the very next post. I had a feeling that if I clicked the "1 reply" that would be what it said. oh well, double undefined is fine.



  • @darkmatter said:

    What about the case where you Shift+Delete the wrong files in Windows?

    The Recycle Bin is much more convenient to use than rm -i, though.



  • @blakeyrat said:

    I would like to point out that one of the best things about using a GUI is having access to the "undo" command and being able to recover files from the recycle bin/trash can/whatever.

    Except when the actual recycle bin and/or the restore utility are the things also being removed.

    Which is the analogistic thing that's being attempted here

    ( This is more rmdir c:\windows, with predjudice, sort of thing, not highlighting c:\windows in Explorer and hitting Del and expecting something/anything to actually happen..)


  • area_deu

    But that doesn't make a difference because rmdir is deprecated according to @blakeyrat.
    And if you use Remove-Item -force in Powershell you're an idiot, because that's a CLI and should not be used for removing files.



  • Well if you're trying to replicate a decades old (1986) urban legend to see what happens, you're not going to be using a GUI from last year to do it are ya? Windows 1.0 would appear to be the closest GUI at the time:

    😁



  • It's... beautiful...



  • @GOG said:

    It's... beautiful...

    Vintage Windows is awesome, until you actually have to use it. I had to use File Manager just the other day, because they somehow wiped Explorer off a Win2000 server. I was surprised to learn this thing still exists on NT systems.



  • I dunno, I remember that Explorer annoyed the shit out of me when it came out. I would have preferred them to keep developing File Manager.


    Filed under: please excuse me, my rose-tinted glasses are fogging up



  • @FrostCat said:

    Why didn't you just clone the VHD and actually do it?
    Because shared folders. They aren't in the VHD, they're part of the host fs that is mounted inside the VM.
    I would have unmounted them rather than take that kind of risk.



  • Awesome link. It renders everything that's ever been written on TDWTF pale and insipid by comparison. Imagine trying to find someone onsite who knew assembler nowadays.



  • @tharpa said:

    Imagine trying to find someone onsite who knew assembler nowadays.

    Nothing a bit of Googling can't do nowadays...



  • How are you marking this read only?

    If it's just a file system attribute (on either Windows or Linux), then:

    1. sudo makes the command run as root, who can manipulate any file regardless of FS permissions.
    2. The -f (or force) argument will make rm suppress any warnings that you're trying to delete a read-only file.

Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.