How to erase a disk or logical volume

Jump to: navigation, search


Sometimes is necesary to remove the data from a disk or logical volume before decommision it or to verify that all is writing surface is in good condition. You can use "dd" to acomplish the task. Is recommended to use the raw device for improved speed.

1. Verified that the "/dev/zero" special device file exists.

# ll /dev/null
crw-rw-rw-   1 bin        sys          3 0x000004 Oct 10 20:26 /dev/zero 

If the device is not available, use "mknod" to create it.

# mknod /dev/zero c 3 0x000004
# chown root:sys /dev/zero

2. Use "dd" to fill the target device.

HP-UX 11.11 / 11.23 disk

# dd if=/dev/zero of=/dev/rdsk/c#t#d#

HP-UX 11.31 disk

# dd if=/dev/zero of=/dev/rdisk/disk#

LVM logical volume

# dd of=/dev/zero of=/dev/<vgname>/r<lvol_name>