Search code examples
linuxrhelext4journalshred

Data destroy using shred agains ext4 filesystem


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?


Solution

  • 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.