Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
A friend of mine has just given me an old 80GB hard drive provided that i erase the hard drive. So could someone tell me that if i used Code: ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    98

    Erasing an old hard drive?

    A friend of mine has just given me an old 80GB hard drive provided that i erase the hard drive. So could someone tell me that if i used
    Code:
    shred -vz -n 3 /dev/hda
    to erase all data contained on the hard drive Would i then have to reformat the hard drive so i could install a Linux OS on it?

  2. #2
    Linux Newbie Nagarjuna's Avatar
    Join Date
    Feb 2011
    Posts
    122
    I would recommend using dd to fill your hard-drive with zeros. I say this because shred can sometimes miss bad sectors that were mapped out by the HDD, which are completely invisible to applications, such as shred.

    Use dd to write all zeros to your entire hard drive:

    Code:
    dd if=/dev/zero of=/dev/hda bs=1M
    Or just to a selected partition:

    Code:
    dd if=/dev/zero of=/dev/hda1 bs=1M
    However, if your just going to be installing Linux to the hard drive, you might as well let your distributions installation program do all the work for you. It should make new partitions and reformat them. In my opinion, I think formating is best practice to clean up any 'dirty' sectors. Is there a reason why you'd like to avoid formatting?

  3. #3
    Just Joined!
    Join Date
    Apr 2009
    Posts
    98
    The only reason why i would like to avoid formatting an hard drive is because i don't have a clue how to do it.

  4. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,095
    Quote Originally Posted by branoo View Post
    The only reason why i would like to avoid formatting an hard drive is because i don't have a clue how to do it.
    Check out the Parted Magic LiveCD for your formatting chores. It uses gparted and with its very nice GUI, it is highly doubtful that formatting can get any easier. The disk itself also comes with lots of other great utilities to have on hand. It is by far my favorite liveCD.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  5. #5
    Linux Newbie Nagarjuna's Avatar
    Join Date
    Feb 2011
    Posts
    122
    Ahh, I see.

    Well that really shouldn't be much of a problem. Most Linux distributions these days do all that work for you using the installation wizard. Generally, the wizard will ask if you'd like it to wipe the entire drive and setup as well as format the partitions for you. All you need to do is tell it the size of the partitions and what file system you'd like to partition it as. I personally recommend using the ext3 file system.

    You also usually have a more manual approach as well. This will let you define your partitions, their size, their file system and more if you'd like a custom configuration.

    Also, as Ozar suggested, Parted-Magic is a wonderful partitioning tool.

    Since I imagine you have nothing to loose on this hard drive, I say just give it a go! Let us know if you need any help along the way

  6. #6
    Just Joined!
    Join Date
    Apr 2009
    Posts
    98
    Thanks for the replies both. Think i might have to come back if i mess things up lol

  7. #7
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,095
    Quote Originally Posted by branoo View Post
    Thanks for the replies both. Think i might have to come back if i mess things up lol
    If you have good backups of your system and all data, you can mess up over and over again, but be right back to where you were in a matter of minutes.

    Post back if you run into any problems.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  8. #8
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    If your friend is concerned about protection of data on the drive then use dd to zero the entire drive then install Linux after, partitioning the drive as you like. I suggest this will meet requirements your friend may have for security ... otherwise they would destroy the drive or wipe it before letting you have it
    Make sure you select the correct drive when using dd command ... run fdisk -l first and check you have selected the correct drive ...

  9. #9
    Just Joined! reginaldperrin's Avatar
    Join Date
    Oct 2010
    Posts
    66
    Yes, using dd is an easy option, but requires the command line and an understanding of what is "/dev/hda" etc. This is something which puts off the average user from Linux.
    Simple reformatting of a drive is not unlike resetting the file listing held at the start of a drive, and marking the whole drive as empty and ready for use. It doesn't overwrite any of the actual data sectors. These will remain filled with whatever data was written on them until the OS uses them because they are "empty" space.
    The dd command would overwrite as stated, but the question might be asked - why don't you get a new and bigger drive?
    If your friend is concerned with security, he/she should physically destroy the old drive. A good few hits with a hammer, or drill through the casing and pierce the platters.
    Hard drives are so cheap these days, and you get much better performance and a warranty!
    Just my 2 cents...

  10. #10
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    I'm with Jonathan. Honor your promise to your friend by zeroing the drive, no matter what else you do. Formatting leaves much of the old data subject to harvesting.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...