Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] What's the best way to give my HDD's a check?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
chris_andrew
Apprentice
Apprentice


Joined: 19 Sep 2004
Posts: 291
Location: Wiltshire, UK

PostPosted: Sun Jul 12, 2009 2:39 pm    Post subject: [SOLVED] What's the best way to give my HDD's a check? Reply with quote

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
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sun Jul 12, 2009 3:07 pm    Post subject: Reply with quote

You should check smartmontool
Back to top
View user's profile Send private message
chris_andrew
Apprentice
Apprentice


Joined: 19 Sep 2004
Posts: 291
Location: Wiltshire, UK

PostPosted: Sun Jul 12, 2009 3:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
chris_andrew
Apprentice
Apprentice


Joined: 19 Sep 2004
Posts: 291
Location: Wiltshire, UK

PostPosted: Mon Jul 13, 2009 8:33 am    Post subject: Reply with quote

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
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Mon Jul 13, 2009 11:53 am    Post subject: Reply with quote

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
View user's profile Send private message
chris_andrew
Apprentice
Apprentice


Joined: 19 Sep 2004
Posts: 291
Location: Wiltshire, UK

PostPosted: Mon Jul 13, 2009 12:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Mon Jul 13, 2009 1:56 pm    Post subject: Reply with quote

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:
  1. 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.
  2. 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.
  3. 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
View user's profile Send private message
chris_andrew
Apprentice
Apprentice


Joined: 19 Sep 2004
Posts: 291
Location: Wiltshire, UK

PostPosted: Mon Jul 13, 2009 3:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Mon Jul 13, 2009 3:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum