View previous topic :: View next topic |
Author |
Message |
chris_andrew Apprentice
Joined: 19 Sep 2004 Posts: 291 Location: Wiltshire, UK
|
Posted: Sun Jul 12, 2009 2:39 pm Post subject: [SOLVED] What's the best way to give my HDD's a check? |
|
|
Hi, all.
I want to install Gentoo on an older box. I know that I get some read errors at times.
Before I start my install, I want to give my drives a very thorough check. It doesn't matter how long it takes, I want to test all my sectors and mark any bad ones so they are not used.
From memory I think I used fsck -c -c to test disks in the past. Can anyone confirm the best way to really sort my disks (without replacing them)?
When I start the install properly and do mke2fs -j /dev/hddn, will this unmark any bed sectors that I identify with my thorough check?
All help appreciated.
Cheers,
Chris.
Last edited by chris_andrew on Mon Jul 13, 2009 7:00 pm; edited 1 time in total |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Sun Jul 12, 2009 3:07 pm Post subject: |
|
|
You should check smartmontool |
|
Back to top |
|
|
chris_andrew Apprentice
Joined: 19 Sep 2004 Posts: 291 Location: Wiltshire, UK
|
Posted: Sun Jul 12, 2009 3:24 pm Post subject: |
|
|
Looks interesting. I need to find GSSmartcontrol on a bootable CD, or use the CLI version from the Gentoo Live cd and read the man page.
Thanks,
Chris. _________________ http://www.whylinuxisbetter.net/ |
|
Back to top |
|
|
chris_andrew Apprentice
Joined: 19 Sep 2004 Posts: 291 Location: Wiltshire, UK
|
Posted: Mon Jul 13, 2009 8:33 am Post subject: |
|
|
I installed GSmartcontrol (based on smartmontool) and as suspected, one of my HDD's looks to be a little past its best.
I am happy to dispose of the disk, but want to wipe any residual data. A long time ago I was taught to use a command to do this. It I remember correctly: Code: | dd of=/dev/hddn if=/dev/zero
|
Anyone know if a better (non-sledgehammer) way exists?
Cheers,
Chris. _________________ http://www.whylinuxisbetter.net/ |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Mon Jul 13, 2009 11:53 am Post subject: |
|
|
Hi, yes you can run this :
Code: |
# time dd if=/dev/zero of=/dev/hddx && dd if=/dev/null of=/dev/hddx && dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx
&& dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx
|
If you have sensitive info, a 7 pass is pretty good.
Also, what distro did you use to run GSmartcontrol ? |
|
Back to top |
|
|
chris_andrew Apprentice
Joined: 19 Sep 2004 Posts: 291 Location: Wiltshire, UK
|
Posted: Mon Jul 13, 2009 12:27 pm Post subject: |
|
|
d2,
Thanks for that. I currently have Arch installed (http://www.archlinux.org/). I downloaded the package and it was really straight forward.
I checked the man page, but out of interest, does the time command help things? It seems like when I get to the end of my dd's, it will just tell me how long it took. I'd be keen to know why this has started to be used, as I've also seen it in the Gentoo install docs.
Cheers, again.
Chris. _________________ http://www.whylinuxisbetter.net/ |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Jul 13, 2009 1:56 pm Post subject: |
|
|
d2_racing wrote: | Code: | # time dd if=/dev/zero of=/dev/hddx && dd if=/dev/null of=/dev/hddx && dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx && dd if=/dev/zero of=/dev/hddx |
| Three minor points:- IDE whole-disk devices are /dev/hdx (where x is a for the first physical disk, b for the second, etc.) not /dev/hddx. For this job you (chris_andrew) want to overwrite the entire disk, including the MBR and partition table, so you omit partition numbers.
- The second invocation of dd reads from /dev/null not /dev/zero. Since that will do nothing (immediate EOF) I assume it's a typo.
- This is overkill.
According to the US National Institute of Standards and Technology: NIST publication SP800-88, Guidelines for Media Sanitization wrote: | Clearing information is a level of media sanitization that ... must not allow information to be retrieved by data, disk, or file recovery utilities. ... For example, overwriting is an acceptable method for clearing media. ... Studies have shown that most of today’s media can be effectively cleared by one overwrite.
...
Purging information is a media sanitization process that protects the confidentiality of information against a laboratory attack. For ... ATA disk drives manufactured after 2001 (over 15 GB) the terms clearing and purging have converged. | Emphasis added. The only level of sanitization above purging is destruction. Remember "laboratory" equals "very expensive." The average criminal would not bother, unless they had reason to believe the recovered data would be worth more than the expense.
A one- or two-pass overwrite with random bytes renders your data inaccessible even to laboratory forensic recovery methods: Code: | dd if=/dev/zero of=/dev/sdx; dd if=/dev/urandom of=/dev/sdx | Use /dev/urandom not /dev/random to avoid running out of random data. For a modern drive (as defined by NIST) you could even skip the first pass (zeroes).
That really is sufficient for safe recycling/resale. If your only acceptable risk level is "zero," forget recycling the drive--destroy it. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
chris_andrew Apprentice
Joined: 19 Sep 2004 Posts: 291 Location: Wiltshire, UK
|
Posted: Mon Jul 13, 2009 3:04 pm Post subject: |
|
|
Now that's a great reply.
Currently doing the
Code: | dd if=/dev/zero of=/dev/sdx; dd if=/dev/urandom of=/dev/sdx |
Really appreciate both answers.
Cheers,
Chris. _________________ http://www.whylinuxisbetter.net/ |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Mon Jul 13, 2009 3:54 pm Post subject: |
|
|
For my concern, I use WipeDrive and I select the RCMP algo, so it does it 7 times, a pass with zero and and another with random. |
|
Back to top |
|
|
|