Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: setting up a server as a hdd wiper

  1. #1
    Join Date
    Jul 2009
    Beans
    17

    setting up a server as a hdd wiper

    Hello - I am trying to use an intel based 2u sata server as a hdd wiper/formater. I have about 150 hdd's that I need to wipe and prep for resale. I have installed ubuntu 12.10 on a 160 sata drive in bay one (has a total of 8 bays).

    It would be ideal if I could load the bays with drives and set it up to wipe one after the other or all at once.

    Currently I don't know how to get ubuntu to recognize the drives I want to wipe.

    I am a 10 year ubuntu user and a novice under the hood. I have very little server experience.

    I have been searching but I am not finding anything that matches my situation.

    Anyone have an idea how this could work out. Thanks a ton.

  2. #2
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: setting up a server as a hdd wiper

    Check with sudo fdisk -l (that is, lowercase L at the end) which disks are there.

    Code:
    wim@aa0:~$ sudo fdisk -l
    
    Disk /dev/sda: 8069 MB, 8069677056 bytes
    255 heads, 63 sectors/track, 981 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0003255d
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1         918     7367680   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2             918         981      509953    5  Extended
    Partition 2 does not end on cylinder boundary.
    /dev/sda5             918         981      509952   82  Linux swap / Solaris
    
    Disk /dev/sdb: 4127 MB, 4127195136 bytes
    127 heads, 62 sectors/track, 1023 cylinders
    Units = cylinders of 7874 * 512 = 4031488 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000451df
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        1023     4027520    b  W95 FAT32
    Partition 1 has different physical/logical endings:
         phys=(1023, 126, 62) logical=(1022, 126, 62)
    wim@aa0:~$
    In the above, there are 2 disks, /dev/sda (my system disk) and /dev/sdb (an additional disk). You will get a few more (sdc, sdd etc, one for each disk inyour system)

    Make sure the partitions on the non-system disks are not mounted.
    Code:
    wim@aa0:~$ mount
    /dev/sda1 on / type ext4 (rw,noatime,errors=remount-ro)
    tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
    udev on /dev type tmpfs (rw,mode=0755)
    tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
    fusectl on /sys/fs/fuse/connections type fusectl (rw)
    /dev/sdb1 on /media/PENDRIVE type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000,shortname=winnt)
    wim@aa0:~$
    In this case, partition 1 (/dev/sdb1) of disk2 (/dev/sdb) is mounted. You need to unmount all partitions of the non-system disks if they are mounted.
    Code:
    wim@aa0:~$ sudo umount /dev/sdb1 
    wim@aa0:~$
    Next you can wipe the disk by overwriting it with zeros using the dd command
    Code:
    sudo dd if=/dev/zero of=/dev/sdb
    Repeat for sdc, sdd etc. MAke sure that you don't overwrite you system disk which is probably /dev/sda.

    You can force the commands to the background by adding an ampersand at the end
    Code:
    sudo dd if=/dev/zero of=/dev/sdb &
    Personally I would rather open multiple consoles / terminals and run each 'dd' in its own terminal so you can more easily check when they are done.

    Note that the process can take long. For a normal wipe this should be enough; normal users will not be able to get data back that is wiped that way. I'm not that paranoid that I will overwrite with /dev/random and do multiple wipes so I will use /dev/zero.

    One link that I found:
    http://how-to.wikia.com/wiki/How_to_...clean_in_Linux

    Note:
    commands in red bold
    Last edited by Wim Sturkenboom; December 24th, 2012 at 10:48 AM.
    If you don't make backups of your important data, your data is obviously not important to you.

  3. #3
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: setting up a server as a hdd wiper

    As an addition to the excellent advice already received, assuming that you're using a server with true RAID, your drives may well show up more like:

    Code:
    /dev/cciss/c0d0
    rather than:

    Code:
    /dev/sda
    Merely because of the controller.

    It may also be worth stipulating a large block size when using dd (4096 or so), although I'm not sure if that will have a great impact on a zero session.

  4. #4
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: setting up a server as a hdd wiper

    Just to add to Win Sturkenboom's post you can increase the speed that dd runs at by adding the bs (block size) argument:
    Code:
    sudo bs=4MB if=/dev/zero of=/dev/sdb
    Cheesemill

  5. #5
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: setting up a server as a hdd wiper

    Note:
    the fact that you're using server hardware can make a difference for what you see in the fdisk output. If not sure, post the output of the first command.

    //Edit
    just see that Grenage already covered that.
    Last edited by Wim Sturkenboom; December 24th, 2012 at 12:08 PM. Reason: Added //Edit
    If you don't make backups of your important data, your data is obviously not important to you.

  6. #6
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: setting up a server as a hdd wiper

    Quote Originally Posted by Cheesemill View Post
    Just to add to Win Sturkenboom's post you can increase the speed that dd runs at by adding the bs (block size) argument:
    Code:
    sudo bs=4MB if=/dev/zero of=/dev/sdb
    That is shown in the link that I provided. I however have a question about that (without trying to hijack the thread): what is the optimal size for the bs parameter or how to determine the optimal size?
    If you don't make backups of your important data, your data is obviously not important to you.

  7. #7
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: setting up a server as a hdd wiper

    Quote Originally Posted by Wim Sturkenboom View Post
    what is the optimal size for the bs parameter or how to determine the optimal size?
    It's completely system-dependant, not least of course - the drives themselves. With modern drives, I imagine one could happily use 8-16M chunks, given the abundance of cache.

  8. #8
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: setting up a server as a hdd wiper

    Quote Originally Posted by Grenage View Post
    It's completely system-dependant, not least of course - the drives themselves. With modern drives, I imagine one could happily use 8-16M chunks, given the abundance of cache.
    I understand that I was thinking about a more scientific answer

    Block size? HD buffer size? What else?

    Reason for asking is that I (sorry, my system) just has spend roughly 30 hours running creating an image of a 125GB partition (bs was 1M) to (OK, I admit) an USB2 external HD.
    If you don't make backups of your important data, your data is obviously not important to you.

  9. #9
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: setting up a server as a hdd wiper

    Quote Originally Posted by Wim Sturkenboom View Post
    I understand that I was thinking about a more scientific answer

    Block size? HD buffer size? What else?

    Reason for asking is that I (sorry, my system) just has spend roughly 30 hours running creating an image of a 125GB partition (bs was 1M) to (OK, I admit) an USB2 external HD.
    I'd probably push the BS to the cache size, although with USB, I don't think it's going to make much difference.

    Alas, I fear we have derailed this thread some!

  10. #10
    Join Date
    Jul 2009
    Beans
    17

    Re: setting up a server as a hdd wiper

    Thanks for the help - I will be back a my workstation in about 2 hours and run fdisk and post output - last time I ran it it only showed one disk - I will run it again. Thanks.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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