Wednesday, May 15, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2754  / 2 Years ago, wed, august 17, 2022, 3:48:51

as I am new Linux user I don't really know yet where's path to my disk, so therefore also I don't know how to wipe out data from it.


As I mentioned I would need something that will wipe out a hard disk, so I did a bit of googling and I found out that something like command shred will most likely suit me.


Now, I found out that this is syntax of command:


shred [OPTIONS] FILE [...]

So, I would probably run shred with these options:


shred -vfzu -n 25

Now back to my problem, I don't know what's the path of my hard drive, because I have exactly 4 sda parts in /dev/, and they are:


sda
sda1
sda2
sda5

So, my question here is which one of these should I even shred? And how can I know it's the right one?


More From » partitioning

 Answers
0

  • shred /dev/sda will shred the whole disk from the first to the last sector, so everything, including partition table will be erased.



  • shred /dev/sda1 will shred the first partition on the disk. This will destroy the filesystem in this partition, the partition table entry for this partition remains.



  • shred /dev/sda2 will shred the second partition on the disk. If this is an extended partition which acts as a container for sda5, then /dev/sda5 will be completely erased, but the partition table entry for /dev/sda2 remains.



  • shred /dev/sda5 will erase the contents of this partition, the partition itself will remain.




Of course, you will need root privileges, so use sudo or run as root. Very helpful might be a command like


lsblk -f

wich will give you sufficient information about your devices.


Since shredding the whole drive or a partition which is currently in use will most probably end with unwanted side effects, consider booting from USB.


[#1486] Friday, August 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rcraftemur

Total Points: 118
Total Questions: 119
Total Answers: 144

Location: Turks and Caicos Islands
Member since Sun, Mar 7, 2021
3 Years ago
rcraftemur questions
Fri, Jan 13, 23, 19:30, 1 Year ago
Fri, Jan 14, 22, 13:59, 2 Years ago
Tue, Mar 7, 23, 14:57, 1 Year ago
;