Sponsored Content
Special Forums Hardware Filesystems, Disks and Memory Erasing hard disk contents using dd or dcfldd Post 302322015 by jake24 on Tuesday 2nd of June 2009 02:06:02 PM
Old 06-02-2009
Data Erasing hard disk contents using dd or dcfldd

Hi,

I am writing a script to wipe my hard disk, in a relatively secure manner by over-writing the disk with 3 patterns. So, I run the dd/dcfldd command 3 times with a sync call in between each command call in the script.

Code:
#!/bin/sh
dcfldd pattern=99 conv=notrunc of=/dev/sda
sync
dcfldd pattern=jj conv=notrunc of=/dev/sda
sync
dcfldd pattern=hell conv=notrunc of=/dev/sda
sync

I want to know if the above code would in fact,result in my hard disk being over-written with the given patterns in that order? Since I have introduced a sync in between each command call, any remaining buffers to be written onto the disk would have been physically written before the next pattern is being copied to the disk by dcfldd.

Please help me. I really want to understand the impact.
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

hard disk meltdown

I had an issue with a second hard disk in my machine. I have a sparc station running solaris 7. It was working fine but now it wont mount on boot up and when you try to mount it manually it gives an I/O error. I tried a different disk as a control which was fine. What I want to know is if my... (3 Replies)
Discussion started by: Henrik
3 Replies

2. UNIX for Dummies Questions & Answers

How to Copy Contents from CD to Hard disk

Hello all.. Iam New to Unix Environment. I need to copy .cpio file from CD to a Folder on Sun 5.8 Box. Can anyone give me the commands to execute this ?.. Thanks in advance Ron (4 Replies)
Discussion started by: vr76413
4 Replies

3. UNIX Desktop Questions & Answers

Hard Disk

I have a cuestion. How Can I to add other hard disk to my computer? I need to configurate anyone? (4 Replies)
Discussion started by: hmaraver
4 Replies

4. UNIX for Dummies Questions & Answers

Hard Disk at 99% Help!

:eek: I use this Solaris to run CMS a call acounting software package for my job. No one could run reports today because it said the this when you logged on "The following file systems are low, and could adversely affect server performance: File system /: 99%full" Can some one please explain... (9 Replies)
Discussion started by: mannyisme
9 Replies

5. SCO

declare disk driver for IDE hard disk

hi I've a fresh installation of SCO 5.0.7 on the IDE hard disk. For SCSI hard disk I can declare, for example blc disk driver using: # mkdev hd 0 SCSI-0 0 blc 0but it works for IDE hard disk? (3 Replies)
Discussion started by: ccc
3 Replies

6. Solaris

Need Hard Disk Details

Hi freinds, What is the command to find out the hard disk details (logical name, FS type etc,). Because i connected one ntfs partition and i don't know the hard disk logical and physical name to mount it.Kindly do the needful. Thanks | P.Bharathiraja. :mad: (2 Replies)
Discussion started by: bharathiraja
2 Replies

7. Red Hat

Need help for getting hard-disk traces

When we write a programme,we declare variables and compiler allocates memory to them.I want to get access to the physical block number of hard-disk where actually the data is stored by the programme " Some one help me out... (1 Reply)
Discussion started by: nagraz007
1 Replies

8. UNIX for Advanced & Expert Users

Need help for getting hard-disk traces

When we write a programme,we declare variables and compiler allocates memory to them.I want to get access to the physical block number of hard-disk where actually the data is stored by the programme " Some one help me out... (3 Replies)
Discussion started by: nagraz007
3 Replies

9. Linux

C++ Code to Access Linux Hard Disk Sectors (with a LoopBack Virtual Hard Disk)

Hi all, I'm kind of new to programming in Linux & c/c++. I'm currently writing a FileManager using Ubuntu Linux(10.10) for Learning Purposes. I've got started on this project by creating a loopback device to be used as my virtual hard disk. After creating the loop back hard disk and mounting it... (23 Replies)
Discussion started by: shen747
23 Replies

10. BSD

Migrate a Hard Disk

hi Has anyone already tried to migrate a hard disk with FreeBSD using recoverdisk? (1 Reply)
Discussion started by: ccc
1 Replies
hdio(7I)							  Ioctl Requests							  hdio(7I)

NAME
hdio - SMD and IPI disk control operations SYNOPSIS
#include <sys/hdio.h> DESCRIPTION
Note - The SMC and IPI drivers have been discontinued. dkio(7I) is now the preferred method for retrieving disk information. The SMD and IPI disk drivers supplied with this release support a set of ioctl(2) requests for diagnostics and bad sector information. Basic to these ioctl() requests are the definitions in <sys/hdio.h>. IOCTLS
HDKIOCGTYPE The argument is a pointer to a hdk_type structure (described below). This ioctl() gets specific information from the hard disk. HDKIOCSTYPE The argument is a pointer to a hdk_type structure (described below). This ioctl() sets specific information about the hard disk. /* * Used for drive info */ struct hdk_type { ushort_t hdkt_hsect; /* hard sector count (read only) */ ushort_t hdkt_promrev; /* prom revision (read only) */ uchar_t hdkt_drtype; /* drive type (ctlr specific) */ uchar_t hdkt_drstat; /* drive status (ctlr specific, ro) */ }; HDKIOCGBAD The argument is a pointer to a hdk_badmap structure (described below). This ioctl() is used to get the bad sector map from the disk. HDKIOCSBAD The argument is a pointer to a hdk_badmap structure (described below). This ioctl() is used to set the bad sector map on the disk. /* * Used for bad sector map */ struct hdk_badmap { caddr_t hdkb_bufaddr; /* address of user's map buffer */ }; HDKIOCGDIAG The argument is a pointer to a hdk_diag structure (described below). This ioctl() gets the most recent command that failed along with the sector and error number from the hard disk. /* * Used for disk diagnostics */ struct hdk_diag { ushort_t hdkd_errcmd; /* most recent command in error */ daddr_t hdkd_errsect; /* most recent sector in error */ uchar_t hdkd_errno; /* most recent error number */ uchar_t hdkd_severe; /* severity of most recent error */ }; SEE ALSO
ioctl(2), dkio(7I) SunOS 5.11 13 Aug 2002 hdio(7I)
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy