What is the Windows equivalent of "rm -rf /" of the linux world?

Discussion in 'Linux' started by rms_returns, Jul 14, 2016.

  1. rms_returns

    rms_returns MDL Novice

    Jul 9, 2016
    14
    1
    0
    I'm just asking this out of curiosity, what is the Windows equivalent of rm -rf / ? For those who don't know, the linux drives are all folders inside the root drive (/). So, /home, /cache, /boot, etc. are all folders that could be stored on any physical disk. There is no C:\ drive or D:\ drive.

    Coming back to my question, its possible to wipe off the whole disk (in fact all disks on the system!) by running the command rm -rf / in linux (though only root can do that, no other user). Similarly, what will happen if I ran rmdir /s C:\* or something like that? Is there any single DOS command to wipe off the entire C:\ drive?
     
  2. garf02

    garf02 MDL Member

    Sep 15, 2007
    159
    54
    10
    C: is the system partition, is not possibile delete all folder

    format d: is the fast way for delete all from the drive, otherwise rd /s /q d:\
     
  3. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    1,190
    441
    60
    wipe - secure delete ?

    diskpart > sel disk 0 > clean
    bring the whole disk(not vol, all the vols in this disk will be cleaned) back to default factory state
     
  4. rms_returns

    rms_returns MDL Novice

    Jul 9, 2016
    14
    1
    0
    lol, I never said I had any problem. I was just curious to know about this :cool:.
     
  5. Bat.1

    Bat.1 MDL Addicted

    Oct 18, 2014
    810
    790
    30
    Bat curious why you be curious :confused:
     
  6. Lodge

    Lodge MDL Novice

    May 31, 2016
    16
    9
    0
    Since rm -rf / is a common troll among new GNU/Linux users, The "Delete System32" meme would be the most similar, although it does not delete every file on the hard disk.

    Too answer your question, not even the Administrator account can delete those system files, to the best of my knowledge. You'd have to do something like takeown /f
     
  7. John Sutherland

    John Sutherland MDL Senior Member

    Oct 15, 2014
    476
    626
    10
    #7 John Sutherland, Jul 22, 2016
    Last edited: Jul 22, 2016
    Hello @ rms returns - To quote Ingio Montoya, "You keep using that word, I do not think it means what you think it means". :D
    In this case, it depends on what you mean by using the word "wipe".

    Using the "rm" command is in no way meant to securely erase the files on a disk or disk partition, all it does is remove the directory structure - the raw data still remains on the disk. Any decent data recovery software should be able to retrieve these files.

    A much better approach would be to use the "shred" command. Example: "shred -vzn /dev/sda1" would overwrite all data on partition sda1 with zeroes. Substituting "sda" for "sda1" would overwrite /dev/sda -the entire disk.

    Another alternative would be the "dd" command. Example: "dd if=/dev/zero of=/dev/sda1 bs=1024" would also overwrite all data on partition sda1 with zeroes.

    Also using the "dd" command: "dd if=/dev/urandom of=/dev/sda1 bs=1024" would overwrite all data on partition sda1 with random data. This is very useful if you plan to encrypt /dev/sda1 using cryptsetup/luksFormat afterwards, since the random data tends to "mask" the encrypted data.

    NOTE: Do not use any of the above commands on a sold state drive. In that case, use the manufacturer's software (if available) to securely erase the SSD, or use Partition Magic to perform an ATA Secure Erase by choosing the "Internal" option - do not use "External"! This erases the SSD using the SSD's internal firmware.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...