Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to zero disk before returning dedi without IPMI?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to zero disk before returning dedi without IPMI?

What is the best one can do to zero a disk before returning dedicated server? Is there a command that can be run without access to rescue mode or IPMI?
I am using centos 6.5.

Comments

  • smansman Member
    edited August 2014

    If you can somehow boot from an ISO or if your provider has rescue boot that would be one way. Most providers can hook up a USB DVD temporarily.

    Depending on how your HD is partitioned and what tool you want to use you could probably zero the non-boot partitions. There shouldn't be anything in the boot partition you would need to worry about. I've never tried that though. Just spit balling.

  • dd bs=100M if=/dev/zero of=/dev/sda

  • @linuxthefish said:
    dd bs=100M if=/dev/zero of=/dev/sda

    or dd bs=100M if=/dev/urandom of=/dev/sda

    Thanked by 2aFriend Noerman
  • rm_rm_ IPv6 Advocate, Veteran

    KMyers said: or dd bs=100M if=/dev/urandom of=/dev/sda

    1) This will work an order of magnitude slower
    2) You don't actually need random, zero is enough, this has been proven time and time again in various studies.

  • @rm_ said:
    2) You don't actually need random, zero is enough, this has been proven time and time again in various studies.

    [citation needed]

    Thanked by 2aFriend tux
  • All you're trying to do is overwrite data which is why writing zeros is fine. You aren't trying to encrypt the data. It isn't the disks that would be taxed from random, it is the random character generation performed by the CPU, so unless you have a supercomputer, zeros will be way faster.

    The question I have about running dd bs=100M if=/dev/zero of=/dev/sda on a live server is if the server would crash before it finishes. I've always run it from a live CD so the system still has access to any files it needs during the execution.

    Thanked by 1aFriend
  • rm_rm_ IPv6 Advocate, Veteran

    vdnet said: The question I have about running dd bs=100M if=/dev/zero of=/dev/sda on a live server is if the server would crash before it finishes.

    Turn off all swap beforehand (swapoff -a), and it will not.

    Thanked by 1aFriend
  • If i want to zero disk /dev/sda and /dev/sdb which share a raid-0 LVm partition, does one just repeat the dd command with /dev/sdb

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/vg_a-lv_root 50G     12G   36G  24% /
    tmpfs                                   7.7G     0  7.7G   0% /dev/shm
    /dev/mapper/vg_a-lv_stor   5.4T  4.2T  886G  83% /stor
    /dev/sda1                               485M  232M  228M  51% /boot
    
  • @aFriend said:
    If i want to zero disk /dev/sda and /dev/sdb which share a raid-0 LVm partition, does one just repeat the dd command with /dev/sdb

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/vg_a-lv_root 50G     12G   36G  24% /
    tmpfs                                   7.7G     0  7.7G   0% /dev/shm
    /dev/mapper/vg_a-lv_stor   5.4T  4.2T  886G  83% /stor
    /dev/sda1                               485M  232M  228M  51% /boot
    

    If you can mount the software RAID in a live boot thingy then you can dd 0's to the mount, otherwise just do it to sda and sdb separately.

Sign In or Register to comment.