Howto erase your files/partition with shred in linux

if you want to erase a file use just the command


shred -v filename

its ok if you erase your file one time. if you want to erase your file multi times use the -n parameter.

you overrite with the command the file 2 times.

shred -v -n 2 filename

to erase your partition use fdisk to show your partition


rex@linux:~$ sudo fdisk -l

Platte /dev/sda: 1500.3 GByte, 1500301910016 Byte
255 Köpfe, 63 Sektoren/Spuren, 182401 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Disk identifier: 0x00000001

Gerät boot. Anfang Ende Blöcke Id System
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
Partition 1 endet nicht an einer Zylindergrenze.
/dev/sda2 13 16708 134102016 7 HPFS/NTFS
Partition 2 endet nicht an einer Zylindergrenze.
/dev/sda3 16709 182401 1330922880 5 Erweiterte
Partition 3 endet nicht an einer Zylindergrenze.
/dev/sda5 16709 17316 4876168+ 82 Linux Swap / Solaris
/dev/sda6 17316 35552 146482528+ 83 Linux
/dev/sda7 35553 182401 1179564088+ 7 HPFS/NTFS

Platte /dev/sdf: 82.3 GByte, 82348277760 Byte
255 Köpfe, 63 Sektoren/Spuren, 10011 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Disk identifier: 0x46894688

Gerät boot. Anfang Ende Blöcke Id System
/dev/sdf1 * 1 6530 52452193+ 7 HPFS/NTFS
/dev/sdf2 6531 10010 27953100 f W95 Erw. (LBA)
/dev/sdf5 6531 10010 27953068+ 7 HPFS/NTFS

The computer has 2 Harddisks
sda - 1500 GB
sdf - 80 GB

to erase the whole disk use:

sudo shred -v -n 2 /dev/sdf

to erase the first partition use

sudo shred -v -n 2 /dev/sd1

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Use <pre> all your html php come here </pre> for your code
  • Allowed HTML tags: <a> <b> <pre> <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <div> <style><img> <br> <blockquote>
  • Lines and paragraphs break automatically.
  • You may insert videos with [video:URL]

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

CafeWebmaster.com(CW) is a free online community for webdevelopers and beginners. Anybody can share their code, articles, tips, tutorials, code-examples or other webdesign related material on the site. Newbies can submit their questions and reply to existing questions. CW does not guarantee or warrant reliability of code, data and information published on the site. Use the site on your own risk. The site takes no responsibility of direct or indirect loss or any kind of harm to its users. The site also doesn't take responsibility of infected files or source code with any kind of infection or viruses, worms, spywares, malwares, trojan horses. CW reserves the right to edit, move, or delete any of content for any reason.