Jump to content

Secure erase hard drive on Linux

Hello! So I have recently created a bootable USB for Linux(Live CD) so I can install it to my hard drive(Ubuntu 18.04 to be exact). I am currently booted from it but the thing is  I want to completely erase the hard drive before I install Linux to it , not only format it. In short words I want to nuke it before I install so I can start fresh. There is an option in the disks utility of Ubuntu that is called erase and that is selectable when you format a hard drive. Is that what I am looking for? Will that secure erase all data on the hard drive? I have selected it and this is how things look(image below). So do I need to run some command or something else after that or the hard drive will be erased and no traces of data will be left on it?

1586613857854219804981.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

By default Linux uses different file systems then Win-OS. Although technically possible, obtaining files from a disk that's been formatted to a different file system (like from NTFS (win-10) to etx4 (Linux)) is very difficult and for a non-techie essentially not feasible. So you shouldn't had to bother with the procedure you followed, once the base of a file system (the link between where files are stored on the disk and the OS) is gone, data is difficult to recover. Not impossible, but certainly requiring way more knowledge then "Joe average PC-user" has.

"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to comment
Share on other sites

Link to post
Share on other sites

Have done this many times, OP.

 

Get to a prompt in Linux as root.  There are various ways to do this, though I prefer using SystemRescueCD.  Download and burn to CD the latest stable version.  Then boot it up via BIOS Boot Order (or it may be automatic, depending on setup and machine -- it's F12 at bootup on a Dell).  Let it go through its process until sitting at a multi-colored prompt.  The idea is to wipe the drive with zeroes.  Do so with the following command:

 

dd  if=/dev/zero  of=/dev/sda  bs=4096  conv=notrunc,sync

 

After pressing  <Enter>  you will see nothing until the process is finished and four lines appear.  It is time-consuming, so go do something worthwhile for an hour or two, depending on the size of the hard drive sitting at /dev/sda.  Be certain that is where the hdd wiping with zeroes resides before issuing the command. 

 

If only one partition is to be wiped, say sda4,  the output file (of) with be sda4 (of=/dev/sda4) for example.  Be careful, but dd will do what you want if used precisely. 

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Dutch_Master said:

By default Linux uses different file systems then Win-OS. Although technically possible, obtaining files from a disk that's been formatted to a different file system (like from NTFS (win-10) to etx4 (Linux)) is very difficult and for a non-techie essentially not feasible. So you shouldn't had to bother with the procedure you followed, once the base of a file system (the link between where files are stored on the disk and the OS) is gone, data is difficult to recover. Not impossible, but certainly requiring way more knowledge then "Joe average PC-user" has.

I wouldn't say that is true, plenty of tools offer such possibility if you are a bit techy you can do it. Even the average user can probably get it working with a bit of googling and finding a good tutorial. It is definitely not difficult I mean in the easiest case you basically start the tool and click on run. Because there are multiple copies of those "links" to the files and usually only the link to the table (linking to the individual files) has been deleted. But even if all those file system specific information would be broken, most files (especially if the drive is not full) are stored sequentially. So by just iterating over those blocks you will find a lot of files, by magic headers for example. And this is was those easy to use data restoring tools do.

 

4 hours ago, sp331yi said:

dd  if=/dev/zero  of=/dev/sda  bs=4096  conv=notrunc,sync

Is not a bad way of securely erasing a HDD. Keep in mind that for an SSD there still be data left, because of wear leveling (a mechanism which basically always hides part of the storage as backup and will exchange what parts are hidden to have the cells used evenly). This can happen on HDDs to (in case of bad blocks) but for much lesser data. There are some possibilities for securely erasing HDDs and SSDs in this case, but not every drive has this feature.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×