How to delete each disk mounted on filesystem using dd command

Posted on 2009-12-17
Last Modified: 2013-12-16
I am using redhat Linux
Question by:supportpro
    LVL 14

    Accepted Solution

    Check here:


    # dd if=/dev/zero of=/dev/hdc                         # Delete full disk
    # dd if=/dev/urandom of=/dev/hdc                      # Delete full disk better
    LVL 34

    Expert Comment

    by:Duncan Roe
    You  should unmount the disks before doing this. They will not be mountable afterwards, until you re-run mke2fs on them (or whatever)
    LVL 6

    Expert Comment

    to truly delete, you may want to use the command "wipe"

    should be available via rpm. This does a scrub of the disk.
    LVL 2

    Expert Comment

    I did not exaclty understand what you want to do. Do you need to delete ALL the used disks, or just some?

    If you want to get rid of all, then I suggest you boot using a live cd, and perform the dd command on all the detected disks. You are able to "see" them using fdisk -l

    For sure you need them unmounted before.

    Author Closing Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now