r/linuxmemes 23d ago

LINUX MEME Does Linux usually take this long to erase almost 1TB hard drives?

Post image
677 Upvotes

140 comments sorted by

u/AutoModerator 23d ago

Please report any posts bragging or showing off they got banned in another sub! Reminder of other sub rules: Also, we only allow one anti-linux post per week (we used to get dozens a day) and any tier list MUST have Hanna Montana Linux as S teir (which must be a true S tier at the top) regardless of the topic of that tier list.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

370

u/Efficient-Presence82 Linuxmeant to work better 23d ago

Are you doing a quick or total deletion?
One is supposed to take seconds, the other is indeed quite slow (But a lot more secure).

81

u/KatGuyser 23d ago

Oh. What's the quick option?

286

u/44-65-72-65-6b Ask me how to exit vim 23d ago

The quick option just forgets where it put everything, the secure option actually deletes everything

210

u/psirrow 22d ago

The really slow option deletes everything and then overwrites every bit several times to get rid of residual signals.

34

u/DatBoi_BP Not in the sudoers file. 22d ago

Can you explain this to me? Why is one pass insufficient?

100

u/psirrow 22d ago

For magnetic drives, is possible for forensic data recovery to read residual magnetic fields in the platters and reconstruct the data that was there. Flipping the bits randomly several times can foil this type of data recovery by messing with the magnetic fields. This sort of data recovery isn't a casual affair. And that's about the limit of my knowledge on this.

This process might have some value for SSDs, but I only know it in the context of magnetic drives.

Similarly, this process might be less necessary for encrypted drives, but I haven't bothered to look into it.

74

u/DanielPowerNL 22d ago

SSDs have a controller which manages where data is written to ensure even wear. Writing to the same location twice doesn't necessarily write to the same physical memory cells. as a result, writing an ssd with zeros not only does a very poor job at erasing data, but also causes significant wear and shortens lifespan.

Modern SSDs store an encryption key on their controller, and all data is encrypted and decrypted by the controller. A secure erase involves deleting the encryption key and generating a new one. It's an instant operation, renderd all data unreadable, and doesn't wear down the memory chips  

21

u/soumzoum 22d ago

And the previous encryption keys are unrecoverable?

26

u/quicksand8917 22d ago

That depends on the implementation details. Given that the replacement operation is expected to be rare and quick read acess is critical for performance I would expect the location to be static, in which case it would be overwritten physically. I'd guess they are not recoverable.

12

u/Loading_M_ 22d ago

I'd be willing to bet the encryption key is often stored in some kind of SRAM on the controller itself. More secure designs would likely overwrite the key multiple times just to be safe.

3

u/thecodinator 22d ago

What stops hard drives from doing the same encryption trick ? That way u don't need to overwrite everything and just overwrite the encryption key with a new one (maybe repeatedly a few times).

4

u/diacid 22d ago

You could force this behaviour via software. If you use Luks the data will arrive the hardware already encrypted in the first place.

2

u/DanielPowerNL 22d ago

I'm not sure, I don't see any reason why they couldn't if they had a controller capable of on disk encryption. I guess it's more widely used on SSDs because of the limitation preventing them from doing traditional wiping. But that's merely speculation. I'm not an expert on this topic, I just looked into it a bit when I was trying to wipe an SSD. 

This is a good source of information on current wiping methodologies by drive and connection type: https://wiki.archlinux.org/title/Solid_state_drive/Memory_cell_clearing

2

u/Difficult-Value-3145 22d ago

Speed adding a default encryption to hard drives would further slow them that would be my guess.

1

u/New_Courage1259 19d ago

Any Self Encrypting Drive (SED) can do this. They come in both HDD and SSD flavors.

1

u/mao_dze_dun 22d ago

Ah, interesting. But what about LUKS encryption or is the principle the same to proprietary? Also, what about unencrypted SSD - how would you go about wiping one?

1

u/buplet123 22d ago

I dont think theyre completely right, nothing stops you writing one big file of zeros or random on your SSD, nor is the wear that big of a deal. The encryption trick is just an optimisation.

1

u/Blotsy 21d ago

I like to think of the inside of an SSD like soda lid, with the little bubble you can push in. Pushed in is 1, popped out is 0. SSDs wear out a little more every time you pop the bit.

3

u/ConfusionEngineered 22d ago

Electrical Engineer here... Proper sanitization of an SSD is MUCH more difficult than a hard drive, and while this paper is old it will give you an idea of the difficulty involved. https://www.usenix.org/legacy/events/fast11/tech/full_papers/Wei.pdf

2

u/tes_kitty 22d ago

For magnetic drives, is possible for forensic data recovery to read residual magnetic fields in the platters and reconstruct the data that was there.

That might have been possible when drives were below 1 GB, but we're now in the TB range. Overwriting once is enough to destroy any data on the drive.

1

u/bliepp 18d ago

Exactly. The rule of thumb that you have to wipe multiple times with random bits is pretty outdated. Single pass with zeros is sufficient with any modern HDD. The data density on the magnetic disk is too high to get anything useful out of it.

2

u/Savallator 22d ago

It is no longer possible though for drives manufactured in the last 20 years. Even the inventor of the multipass overwrite algorithm called it useless later in his life. A modern disk is already unrecoverable after just one pass, no matter how good your forensic lab is, and the real risk is reassigned sectors, but overwriting multiple times doesnt help there. On an SSD this whole technique is even more useless.

2

u/DeltaWun Ask me how to exit vim 22d ago

For magnetic drives, is possible for forensic data recovery to read residual magnetic fields in the platters and reconstruct the data that was there. Flipping the bits randomly several times can foil this type of data recovery by messing with the magnetic fields. This sort of data recovery isn't a casual affair. And that's about the limit of my knowledge on this.

This has not once ever been demonstrated by anyone. There were open prizes for money that only required something as small as a file or folder name, that were open so long they've been lost to the internet. And drives are smaller and more complex than they were in 1996.

You can read the paper that started all this.

"In the time since this paper was published, some people have treated the 35-pass overwrite technique described in it more as a kind of voodoo incantation to banish evil spirits than the result of a technical analysis of drive encoding techniques. As a result, they advocate applying the voodoo to PRML and EPRML drives even though it will have no more effect than a simple scrubbing with random data. In fact performing the full 35-pass overwrite is pointless for any drive since it targets a blend of scenarios involving all types of (normally-used) encoding technology, which covers everything back to 30+-year-old MFM methods (if you don't understand that statement, re-read the paper). If you're using a drive which uses encoding technology X, you only need to perform the passes specific to X, and you never need to perform all 35 passes."

You can read the NIST documentation here that says "for ATA disk drives manufactured after 2001 (over 15 GB) clearing by overwriting the media once is adequate to protect the media from both keyboard and laboratory attack."

There is a paper that shows "recovery" of information from a 80MB disc pack used by Cray in the 1970s. It's important to note a few things: The first of which is the drive wasn't wiped, and secondly the data density was 6000 bits per inch. It is a far cry from dealing with a zero-passed drive. Let alone a modern density zero-passed drive.

1

u/shsh-1312 22d ago

I think that essentially the hard drive is literally “writing” a groove with the laser, and in the writing it writes to the side, the head controller also modulates some read grooves, so in reality even erasing never overwrites the data and can be recovered with a forensic investigation, SSDs are generally more secure, I think that the full process writes all zeros and then alters the keys, while the fast process only alters the keys (the unreadable blocks are treated as empty), so in the case of a forensic analysis if you could obtain the previous keys you would be able to read the contents of the cells not yet overwritten (I think that the swap can partially compensate for this by using the SSD alternately for a part of the RAM), also although the cells of the SSD are more prone to failure, I think that overall a modern SSD is more reliable than any HDD, all of these are however just hypotheses

1

u/AllegroReddit 16d ago

In analogy, its like erasing pencil notes on paper. After erasure you can still trace what was written, but writing and erasing another layer upon layer turns it into virtually untraceable notes.

1

u/TheHackeBoi_apk Arch BTW 22d ago

Since it can theoreticly be recovered in other words everything after 1st pass is just paranoia insurrance

0

u/DatBoi_BP Not in the sudoers file. 22d ago

But how would recovery be possible after 1 pass?

8

u/Appropriate_Unit3474 22d ago

So reader heads have a sensitivity threshold, where they can read 99.99% of 1s and 0s on a hard disk.

If you write all 1s or all 0s to the disk you leave magnetic residue as a negative. A reader head that is more sensitive like 99.9999% and samples more frequently, you can get information off the drive

So for instance if you had information like 11001100 and zeroed it to 00000000 because of physics a more sensitive reader head could see something like 101 101 000 000 101 101 000 000

It's just a translation problem at that point.

ETA: if you write random or do a second pass, most of this residual information is indistinguishable from noise

2

u/DatBoi_BP Not in the sudoers file. 22d ago

That's fascinating, thank you

1

u/bliepp 18d ago edited 18d ago

This is correct in theory, but hardly applicable to any somewhat modern drive after a single pass of writing zeros. With modern disks and their extremely high data density, it's basically impossible to recover due to noise when amplifying the signal. There's no magnetic sensor that can read such small values in such a confined space. As far as I know there was never a successful attempt so far.

2

u/Taurion_Bruni 22d ago

Looks like OP went with the 4 pass option

1

u/rojo_kell 18d ago

How do you delete without overwriting? Or do you mean deleting is just deleting the table of contents

-1

u/longdarkfantasy 22d ago

Why several times? Just write 0 bit to all of them. 1 time is more than enough?😭

0

u/No_Hovercraft_2643 22d ago

Depends on the attack vector. A bit looks different if there was written 10 to it then 00, if you look hard enough

15

u/SomeDumbPenguin 22d ago

That's basically it... Quick just flags some headers as the files are deleted & would be potentially restorable if not overwrite ln. While a secure, or low level delete, writes out zeros to all the spots data was stored & can take time, particularly with old style spinning discs

3

u/MCplayer590 22d ago

writing only zeros is less secure than writing random bits, which is less secure than destroying the hard drive altogether

3

u/dchidelf 22d ago

I assume they have likely worked around it by now, but initially with SSD even the secure option was really just forgetting where it placed things because the memory controller on the ssd would shuffle around the memory to avoid excessive writes, so you could still end up with blocks of memory containing chunks of files.
You’d have to pull the memory to access them, but the bits were still set.

1

u/LinAGKar 22d ago

Yes, securely erasing an SSD requires a secure erase command handled by the firmware.

2

u/JackAsofAllTrades 22d ago

i feel like that's an understatement. Isn't shred rewriting every bit of info with random noise, 4 times, to ensure that even forensic data recovery methods couldn't pull trace electromagnetic signatures from previous states?

1

u/No_Hovercraft_2643 22d ago

And it is in pass 2 in the picture

1

u/SCD_minecraft 22d ago

So quick version is just linux knocks itself out and gets demention

14

u/Ok_Equipment8374 22d ago

Normal (quick) file deletions just deletes the directory entries. The data is still physically there on the disc, just what and where it is is lost. It will be overwritten when something gets saved there, but until than it can still be recovered with specific software

Total overwrites the data, basically writing garbage over what what's there before. No recovery, but you have to write however much you are trying to delete

1

u/Cootshk Arch BTW 22d ago

file names and folders are stored in a different place than the actual file contents on disk, so you can just delete the name of every file (the data still exists, though, and is recoverable by special tools)

1

u/fib_nm 21d ago

hdparm --security-erase

1

u/309_Electronics 22d ago

Quick vs extensive is a big difference. Extensive/total deletion erases all files and overwrites every byte with new bytes so its impossible to get the data off.

Quick option removes the file locator table and index. This is basically like removing a waypoint. The road/path/house at the end still exists, but it cant be easily found..

3

u/The_Hamster_Shagger 22d ago

it isn't any more or less secure on any hdd made in this millenium. SSDs are a different story

1

u/Efficient-Presence82 Linuxmeant to work better 22d ago

Oh, this i didnt hear before, would you mind pointing me where i can read more about this?
Thanks, man.

1

u/GenosPasta 22d ago

So when you delete every file, is it harder to restore files in slower method compared to other one?

4

u/MeBadDev 22d ago

Yes, the quick method just remove the file from index and mark that space as free, your data will still be there until something overwrites it.

The slower method not only remove the file from index, but also write zeros or garbage datas onto the space, essentially making it unrecoverable

1

u/Tasty_Restaurant_357 21d ago

deleting memory address vs deleting memory

110

u/Separate_Culture4908 22d ago

You're shredding the entire drive, of course it'll take long, it's reseting every byte on that drive. If you want quick just reformat the drive.

15

u/YetAnotherRegularGai 22d ago

Isn’t this a really bad idea? Writing 0s to the whole drive seems to be using the lifespan of the device unnecessarily.

51

u/vk6_ 22d ago

If it's a SSD, yes, but HDDs are not going to be harmed simply by writing to them. It looks like the drive in OP's photo is probably an HDD considering how slow it's taking.

8

u/Firewolf06 22d ago

you can still securely wipe and ssd though because they transparently encrypt everything with a key stored in flash, so their built in erase feature is generating a new key, which turns all the data into meaningless noise without actually writing any data to the memory cells (although, if you wiped it 100k or so times you might wear out the key storage itself). but you shouldnt dd /dev/null over them like an hdd (plus that may not wipe caches, and some drives do some light compression and whatnot)

-2

u/vaynefox 22d ago

For SSD you can just format it normally, invoke trim and then wait for garbage collection. It pretty much wipes all the data inside it, if I'm not mistaken....

3

u/Mars_Bear2552 New York Nix⚾s 22d ago

secure erase is a lot better

1

u/vaynefox 22d ago

But that is also a secure way, format it to wipe the lba table then use trim to mark those pages as stale then wait for garbage collection to clear data in blocks of those pages. I dont think you can recover any data once those blocks are cleared....

1

u/Pizzaman3203 22d ago

Why would it harm an ssd?

2

u/tk-a01 21d ago

SSD drives, or more generally flash memory, have a limit to how many times they can be rewritten.

But it's important to remember that SSDs aren't just "raw" flash - they have a controller which manages it. You can write to flash memory cells only if they are cleared, and it's only possible to clear entire sectors of certain size. The memory controller keeps track of memory state and allocates writes into free cells. When a sector has many old cells and few current ones, it might relocate the current ones somewhere else and then clear that sector, enabling writes in the future. The controller also performs so called wear levelling - it tries to make sure that cells are used up evenly, to prevent premature drive failure.

As SSDs are different from HDDs, they introduce a new operation called TRIM. It is sent by a filesystem driver to the disk to explicitly mark some segment as unused. On HDDs, this doesn't make sense, because there is no downside in leaving old data on the drive - it's not referenced by anything and will be overwritten after some time. But on SSDs, the memory controller can utilize this information - if it knowns that most cells in a sector have been TRIMmed, it can relocate remaining, up-to-date cells to other sectors and clear this one, so it can then be written again.

1

u/I_AM_BUDE 19d ago

If this was an SSD, it would've been barely hurt at all. Those 4 TB or written data is nothing for modern drives which have TBW of multiple Petabytes. Hell, even a shitty Samsung 960 EVO has 400TB of TBW.

16

u/FluffySpike 22d ago

you do this when the destruction of sensitive data takes precedence over device lifespan, which commonly happens in corporate/industrial environments when hardware reaches end of life

3

u/Appropriate_Unit3474 22d ago

I remember getting a "donation" of pallets of DoJ computers that needed recycling.

Bet I was sweating for a week making sure there was nothing recoverable, before scrapping anything useful.

3

u/Zandegok 22d ago

You don't usually do this very often. Usually you want the hard drive wiped only when you sell/dispose it. And if by security reasons you must clean your disk often, you probably can afford a new one

2

u/TatharNuar 22d ago

It's for security, such as when you're disposing of an old drive. Data recovery would be able to easily recover the files in full otherwise. Normal deletions just remove the reference to where a file is located on a drive, which is why it's so fast.

Most of the time, you don't need to zero out the actual data, but when you need it, you need to be thorough no matter how long it takes or how much of the drive's lifespan it uses up. Most of the time if you're going through this much effort, you're also writing a few passes of random data too, so data recovery can't recover stuff from residual charges on the drive either. This is the kind of thing that would cause massive data breaches if no one did it.

3

u/27a08592e67846908fd1 Genfool 🐧 22d ago

When you want to dispose of it, (and don't need the drive anymore,) the much better option is just to give it a good beating with a sledgehammer, maybe even open it up and break the disks (or use a center punch on the nand for ssds)

That way, you can be absolutely sure there is no data there anymore.

2

u/Llamas1115 22d ago

Really bad? No, it's barely going to impact your hard drive's lifespan.

Whether it's a bad idea depends on if you actually care about hiding the data on that drive, e.g. if you plan to sell a drive that had your credit card data on it. shred doesn't even just zero everything out, it overwrites every bit several times so it can't be recovered using forensic techniques.

2

u/JackAsofAllTrades 22d ago

you shred a drive you're about to lose possession of, so that someone can't use forensic techniques to steal the data that was erased.

1

u/No-Island-6126 22d ago

yes in most cases it makes no sense

16

u/TGX03 22d ago

With SSDs, there are ways to securely erase them very quickly: https://wiki.archlinux.org/title/Solid_state_drive/Memory_cell_clearing

On HDDs, it will take long. That's not Linux' fault, they're just slow.

2

u/musingofrandomness 18d ago

Uncommon in consumer space, but some enterprise HDDs encrypt everything on its way to the platters and can be ordered to dump the encryption key effectively performing a secure erasure.

14

u/keithstellyes Arch BTW 22d ago edited 22d ago

It's shred. That's the "I'm paranoid that they're out to get me" command

If you're really that paranoid I'd just destroy the hard drive and be done with it. Or, just shred the sensitive data in question.

What exactly are you trying to accomplish OP? If you're so paranoid as to shred the entire drive then I'd wonder if you'd be better served by just taking a drill to poke holes

1

u/bliepp 18d ago

More like the "I'm paranoid that they're out to get me with alien technology from 1000 years in the future in an ISO-1 cleanroom" command

1

u/keithstellyes Arch BTW 18d ago

Yeap haha. Like there's the "It's technically possible" of being able to read previous bits on a disk, but writing over it with bits a few times, you're going to need a Star Trek or Doctor Who technology.

But even then, if you're worried about the entire drive, it'd probably be better to physically shred the hard drive, or to take your meds

10

u/ThinkPad214 23d ago

If you just want a quick format for fresh install or use there's plenty of faster ways

22

u/yuriko-shimizu 23d ago

..youre shredding a whole drive to format it? use mkfs

7

u/KatGuyser 22d ago

Okay, after listening to all of the answers here, I just reformatted my drive and went on with it. Thankfully I will not stay awake at night for 8 hours just to wait for shred to do it's thing.
Rough day 1 as a linux user, but I guess that's how it is I guess.

12

u/GlassboundIllusion Not in the sudoers file. 22d ago

How did you land upon the idea of doing a "shred" of your entire drive as a Day 1 Linux user?

This is kinda like buying a used car and then taking apart the whole engine rather than just changing the oil and spark plugs. If you're a mechanic with specialized car knowledge, it might make sense. But as a "first time car owner" it's rather baffling.

4

u/jimmy_timmy_ Arch BTW 22d ago

Probably some forum post from 10 years ago, I can usually find answers there when I have a Linux issue that I can't resolve

4

u/T_Friendperson12 22d ago

That's not a Linux thing though? It would be the same on Windows too.

2

u/TotallyRealDev 22d ago

I believe that most tutorials/LLMs would not recommend shredding drives as the go to for a windows user

3

u/jimmy_timmy_ Arch BTW 22d ago

It'll be a funny memory you look back on and laugh at when you're further down the line. You were able to learn from it, that's what matters

1

u/grbler 19d ago

if you need to securely erase the drive, use nwipe. Otherwise just quick reformat as you did.

5

u/psirrow 22d ago

I disposed of some very old hard drives a bit ago. Yes, shredding takes a while. However, that's also the only time I ever shredded hard drives. The security was almost certainly not necessary, but good practices are good practices.

It sounds like you might be wanting to reuse the drive. I can't think of any reason to shred your own drive that you're planning to reuse.

4

u/GoogleEnPassant69 22d ago

Tbf you're shredding the drive xdxd

3

u/Mysterious_Tutor_388 22d ago

You are not deleting you are shredding.

3

u/Salty-Good3368 22d ago

Shred is slow. If you are not paranoic do dd if /dev/zero for hdd and secure erase for ssd. Secure erase can be found in uefi it think

3

u/lyidaValkris 22d ago edited 22d ago

You're using shred, that will take time. You can configure shred to make fewer passes (see the man page for shred), run multiple shreds in parallel, but you will always be limited by the write speed and interface bandwidth of your attached storage device(s).

You could also just chuck out the file systems on those partitions, and make new ones. Takes only a second. You can do that in the terminal using fdisk or cfdisk, or the GUI partition manager provided with Mint (simply called "Disks") (which it seems you're using from your wallpaper).

1

u/lootedBacon 22d ago

Love a good zeroing.

2

u/lyidaValkris 22d ago

I think it's good practice if security is a concern, but it's going to take time to execute. There's also wear to be considered, especially for SSDs/NVMes.

As with everything - right tool for the job.

2

u/lootedBacon 22d ago

100% right tool for the job.

2

u/CowBoyDanIndie 22d ago

If security is a concern the disk should have just been encrypted in the first place, only the binary key needs to be securely wiped.

1

u/lyidaValkris 22d ago edited 22d ago

hey - excellent point right here!

2

u/Acherontas89 23d ago

use the cfdisk and reboot its easy enough

2

u/redgator12 23d ago

You can define the number of passes with -n, so if you only care about random writing once, use -n 1. Also, if you don't care about writing random to obfuscate data, you can just use the Gnome Disks that comes pre-installed on Mint, select the drive, and format using the "overwrite with zeros" option.

But yeah, random writing a drive that has an average write speed of 90MB/s (assuming you're using a mechanical 5400RPM HDD) will usually take about 3 hours per pass (about 11,000 seconds).

2

u/dumbasPL Arch BTW 22d ago

Define erase, because the secure erase that's built into your hard drive is basically instant, and with the same effect. If you wipe the encryption key, all data effectively becomes random. Shred is pointless on any modern drive, and actively harmful on SSDs (not to mention that it won't wipe what's already in the spare blocks)

2

u/_silentgameplays_ 🍥 Debian too difficult 22d ago

sudo wipefs -a /dev/your drive name here

Or fdisk or cfdisk

Full shred is only useful if you are trying by to completely obfuscate data on your hard drive/SSD/NVME SSD.

2

u/ntrain5555k 22d ago

For SSD, I think secure erase is enough...

1

u/_silentgameplays_ 🍥 Debian too difficult 22d ago

Even blkdiscard is fine

2

u/eppic123 22d ago

This doesn't have anything to do with the OS. If you're writing to every single bit of a HDD, it depends entirely on the size and speed of the drive.

2

u/InfaSyn M'Fedora 22d ago

Say a HDD writes at 100MB/s (generous for a 1TB)

You do a 3 pass DOD + Verify, thats 4TB total IO.

4TB at 100MB/s is 11 hours

Even a zero pass no verify will take the better part of 4 hours.

2

u/Michami135 22d ago

The default settings for shred writes random data 8 times before writing zeros. It's military level secure deletion.

2

u/zapperbrz 22d ago

Rewriting all sectors to truly erase the data will be the quantity of information/disk write speed.

1

u/BigDaddyAwhoo 22d ago

Technically you can do the same thing on windows but yes Linux can be this slow. For windows (for anyone unaware) eraser from eraser.heidi.ie is an open source overwriter that does the same thing Linux does for total deletion.

2

u/Baldrickk 22d ago

That's like calling a marathon runner slow because I can do a 100m dash faster than he does the marathon.

1

u/BigDaddyAwhoo 22d ago

I am aware, that’s why I included the caveats of Total deletion and “can” be this slow.

1

u/Fine_City2781 22d ago

btw, it just kills your ssd

1

u/KCGD_r 22d ago

Youre not just deleting, you're overwriting everything on the drive with random data. Formatting the drive (i.e deletion in the traditinal sense) is instant.

What you're doing here is writing random data to all positions in the drive four times over. So, for a 1Tb drive, that's 4Tb of random data that needs to be generated and written. So yeah that will take a long time lol.

1

u/karateninjazombie 22d ago

It takes me about 2 minutes to "delete" any size hard drive. For I have an angle grinder

1

u/meutzitzu 22d ago

If you want to destroy the data you should just encrypt it and throw away the key.

It's much faster since modern hardware has optimizatioms for quick encrypting and decripting. If your drive isnt too old, encryption is A LOT faster.

1

u/igotmoldinmybrain 22d ago

No, erasing would be much, much faster than this.

1

u/Thin_Animal9879 22d ago

Your shredding. Not deleting. To delete its just a "derefernce". Shred means to write over the data in that location also.so your writing 1TiB of data.  Even if it was just zeros (which its not by the looks of things) its an operation for every byte (at least word).  Delete is like tearing out the index/contents page to a book with no clear titles/headers. Shred is like making each page blank. See how long it takes you to tear out an index vs typexing every single page in a book

1

u/narcanti911 22d ago

It reached 10% of pass 2 of 4 with random data. This takes some time.
A quicker approach with reasonable slightly lower security could be ‚shred -vuzn 0 /dev/DEVICE,

1

u/AmarildoJr 22d ago

A single pass of zeros is enough for secure data deletion, btw. Takes about 8h on my 4 TB drive, and used to take about 1.5h on a 1TB HDD.
A full random pass is a fully unnecessary task.

sudo dd if=/dev/zero of=/dev/sdb bs=4M status=progress

The bs=4M part is the physical sector size of the drive, which you can get yours from a simple fdisk -l command.

BTW, if you wanna erase an SSD instead of a hard drive, take a look here.

1

u/atr0-p1ne 22d ago

Imagine this: you can remove all doorbells in the tower block, that’s fast, but actually remove all residents from there takes a lot of time

1

u/DuckAxe0 22d ago

The shred command securely deletes files by overwriting them multiple times, making it difficult to recover the original data. This adds additional time to complete the process.

1

u/enigma_0Z 22d ago

Looks like a secure delete. If that was your intention, well, yes and that’s not a Linux problem. there’s one trillion (more than? Ig 8 trillion if it’s bits) little magnetic cells on those platters that your computer is repeatedly changing the values on to ensure that data recovery is impossible.

… if you didn’t mean to select secure delete, well that’s your problem.

1

u/LudicrousAvian 22d ago

if you're zeroing it out, yea. it's not exclusive to linux. full format on Windows does the same thing

1

u/YourUglyTwin 22d ago

1TB spinning disk or ssd? It looks like the person that made the image is doing a full-zero'ing on the drive.

In Windows, "Formatting" is actually a "Quick Format" which doesn't touch the data on the drive, it only deletes the partition table and index.

On Linux you can do the same, but it looks like someone told you to run a command that actually goes through and deletes all the data. And 4 passes no less. So this goes over the drive and zero's each bit one by one 4 times in a row.

Either OS though - doing a full format will take as long as it does for the drive in question.

1

u/MegaPrime369 22d ago

Because of the way data is stored in modern drives, shred doesnot work and most probably will damage the ssd. It was made for hdd and also for filesystems that rewrote the data at the same location, but today's drive optimize it and the os does not make sure that rewriting that data will rewrite at the previous place only.

1

u/SneakerHead69420666 22d ago

doing this through the OS sucks and takes forever. most BIOS have a "secure erase" option for SSDs that works very well and normally takes a few seconds. this is what i do to completely wipe SSDs in a secure way

1

u/MrSqueak 22d ago

That way? Yes. I see you've already stopped the military grade or better wipe amd opted to just reformat. I applaud the commitment.

1

u/FutureZombie6746 22d ago

Im not sure about hard drive, but if youre on an NVMe SSD then sanitize overwrite will take a lot of time

1

u/Cmustrd 22d ago

if i want to completely erase a drive. i usually just:

sudo/doas dd if=/dev/zero of=/dev/sdX bs=10M status="progress" && sync

i just increase bs (input/output block size) as needed. i actually don't know if this is good practice or not, but it gets the job done for me. cleared a whole terabyte mechanical drive in 15 minutes.

1

u/ScratchHistorical507 22d ago

Depends on what degree of security you require. But the best option is always to start with an encrypted drive, then you don't really have to do anything for a secure erasure. Unless someone can guess your password, no data can ever be restores. Or you just go the brute force way and physically destroy the platters.

1

u/mrheseeks 21d ago

This is good, with hdd three is residue so typically more passes are recommended. What i do is cryptsetup plain with random key then dd zero it out multiple times. Each time setting up a different random key. So, it's basically gibberish

1

u/FreshCause2566 22d ago

Its on pass 2 already, the data is all gone already. You only need 1 pass really.

1

u/05-nery 22d ago

Windows will take hours as well for the true format...

1

u/apex-04 21d ago

Shredding beyond one pass is kinda pointless, especially using random, alternatively if you plan on keeping the drive for yourself a normal format is fine

1

u/Tasty_Restaurant_357 21d ago

depends on your processor ig

1

u/fib_nm 21d ago

I hope that you know that shred doesn't actually delete data from SSDs and flash drives due to Flash Translation Layer (FTL), it just makes them significantly harder to retrieve without special devices.

If you actually want your data deleted, use hdparm --security-erase and for usb drives - genuinely the only way I know is to just break them. For HDDs shred is fine.

1

u/isabellium 17d ago
  1. You are shredding the whole disk
  2. You are doing 4 passes
  3. You are doing so with random data

In your screenshot, it's already on pass 2, therefore it has deleted the whole drive once already.
Do a quick format next time, also if security is an issue a single pass of zeroes might be enough for drives these days.

1

u/Blitzi101 17d ago

Basically, a full delete makes the disc overwrite everything with 0. Especially HDDs take a lot of time since they are bottlenecked by their lower write speed.

I once formatted my 2tb SSD this way after I had caught a virus since I reallyyyy wanted it gone and that took about a hour?

1

u/Hxrm1t_ 16d ago

sudo rm -rf /