

Windows has its own command line tools for disk manipulation, but tread cautiously, they are not as reliable as they might seem. There are many other tools too that can be used erase disk in Linux and Mac, but they aren’t always within arm’s reach, especially on systems that are command line only. In my experience, shred tends to run faster that using dd to read directly from /dev/urandom, but it does not benefit from the incredible ubiquity that dd does. The -n option specifies the number of passes to make. shred takes information from /dev/urandom and uses it to overwrite the disk (or file) specified.

After you run the command above, you will see the initial installation screen of the macOS operating system. The entire drive seems to be needed to be one partition of non-journaled. To start the installation, run the basic.sh script file that we have just edited above./basic.sh. This will cause the drive to mount as Read Only. Running this command to wipe hard drive is essentially the same as our dd command in a for-loop. Note that if you partition your USB drive with OS X disk utility (IE partition 1 is unjounaled HFS+, partition 2 fat32) the drive is flagged as journaled even if the HFSPlus partition on the drive is not journaled. The next option to erase drive, which is available on both Linux and Mac, though not always installed by default on Linux, is shred.
#Mac disk utility partition for ubuntu linux mac#
Additionally, you can use a disk as the input file and point to a filename that doesn’t exist to create an image of your disk.Īlso Read: The Ultimate A To Z List of Linux Commands Erasing disk in Linux and Mac using shred
#Mac disk utility partition for ubuntu linux iso#
cat /dev/urandom > /dev/sdaĪlternatively, you can use dcfldd, which supports all that dd does and much more, including (most importantly?) displaying the amount of data copied.īONUS TIP: Apart from using dd to erase disk in Linux and Mac, you can use it to write an ISO to a drive by specifying the ISO as the input file to create a bootable USB disk with ease. You could even accomplish this with cat as well. dd will stop when it encounters the end of the file, the end of the file being the end of the disk. We’ve omitted the bs and count options because when writing through a whole disk, they are unnecessary. for i in $( seq 0 2 ) do dd if=/dev/urandom of=/dev/sda done A for loop is handy for this drive wiping process, else you would need to intervene manually and repeat it as necessary, hardly efficient. Alright, what if you want to securely erase an entire drive? Well, you can still do that with dd, all you need to do is change your input from /dev/zero to /dev/random or /dev/urandom and then run it through however many passes you believe is sufficiently secure.
