2

I'm running shred against blockdevice with couple of etx4 filesystems on it. The blockdevices are virtual drives - RAID-1 and RAID-5. Controller is PERC H710P. command shred -v /dev/sda; shred -v /dev/sdc ...

I can understand from shred man(info) page that shred might be no effective on journal filesystems but only when shredding files.

Anyone can please explain whether is shredding against blockdevice safe way to destruct all data on it?

etharendil
  • 83
  • 1
  • 3
  • 7
  • possible duplicate of [Shred: Doesn't work on Journaled FS?](http://stackoverflow.com/questions/913282/shred-doesnt-work-on-journaled-fs) – Alfred Rossi May 10 '15 at 17:31
  • Also with SSD, writing to the same sector from your OS, nearly never means overwriting the same sector on the SSD (unless the drive is full). This is done that way to get the same number of writes to each cell on the drive and thus burn all the cells at a similar pace. (although of course cells that are written once for a file that never changes will have a counter that stays at 1...) – Alexis Wilke Apr 15 '23 at 15:27

1 Answers1

4

This is a complex issue.

The only way that is 100% effective is physical destruction. The problem is that the drive firmware can mark sectors as bad and remap them to a pool of spares. These sectors are effectively no longer accessible to you but the old data may be recoverable from those sectors by other means (such as an alternate firmware or physically removing the platters).

That being said, running shred on the block device does not have the issues due to journaling.

The problem with journaling is that for partial overwrites to be recoverable you cannot actually overwrite the original data, so the overwrite of the file takes place in a second physical location, leaving the first intact. Writing directly to the block device is not subject to journaling.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Alfred Rossi
  • 1,942
  • 15
  • 19
  • the blockdevices are virtual raid drives: # lsscsi [0:2:0:0] disk DELL PERC H710P 3.13 /dev/sda [0:2:1:0] disk DELL PERC H710P 3.13 /dev/sdb [0:2:2:0] disk DELL PERC H710P 3.13 /dev/sdc [0:2:3:0] disk DELL PERC H710P 3.13 /dev/sdd [0:2:4:0] disk DELL PERC H710P 3.13 /dev/sde so in this case should be all drives overwritten ? – etharendil May 10 '15 at 17:17
  • Different issue: shred may not be safe because you don't know how these virtual drives map to physical hardware – Alfred Rossi May 10 '15 at 17:29
  • I understand the virtual drive (RAID 1) as mirrored allocated space on two physical drives. When shred is run against /dev/sda (RAID 1 virtual drive) allocated space of both physical drives should reflect the same data as it is mirrored ? – etharendil May 10 '15 at 17:53