How do I remove all partitions, data and create clean empty hard disk under Linux operating systems?
2015-10-09 17:18
597 查看
轉載自http://www.cyberciti.biz/faq/linux-remove-all-partitions-data-empty-disk/
How do I remove all partitions, data and create clean empty hard disk under Linux operating systems?
If you are planing sale your hard disk or give to some one else, you need wipe all data left on the hard disk / ssd disk. The simplest command to remove everything from Linux hard drive is as follows. Please note that the following
commands will remove all data so be careful. You need any one of the following command:
a) dd command - convert and copy a file.
b) shred command (secure wipe+erase) - Overwrite the specified FILE(s) repeatedly, in order to make it harder for even very expensive hardware probing to recover the data.
c) scrub command (secure wipe+erase) - Writes patterns on magnetic media to thwart data recovery.
OR for sata disk, use the following syntax:
In this example, empty sata disk /dev/sdb, enter (you must be login as the root user):
securely remove everything so that no one recover any data:
and other devices with repeating patterns intended to make recovering data from these devices more difficult. Type the following command to securely wipe out /dev/sdb:
How do I remove all partitions, data and create clean empty hard disk under Linux operating systems?
If you are planing sale your hard disk or give to some one else, you need wipe all data left on the hard disk / ssd disk. The simplest command to remove everything from Linux hard drive is as follows. Please note that the following
commands will remove all data so be careful. You need any one of the following command:
a) dd command - convert and copy a file.
b) shred command (secure wipe+erase) - Overwrite the specified FILE(s) repeatedly, in order to make it harder for even very expensive hardware probing to recover the data.
c) scrub command (secure wipe+erase) - Writes patterns on magnetic media to thwart data recovery.
Method #1: Old good dd command
Use the following dd command to remove data from /dev/hdX:dd if=/dev/zero of=/dev/hdX bs=512 count=1
OR for sata disk, use the following syntax:
dd if=/dev/zero of=/dev/sdX bs=512 count=1
In this example, empty sata disk /dev/sdb, enter (you must be login as the root user):
fdisk /dev/sdb dd if=/dev/zero of=/dev/sdb bs=512 count=1 fdisk -l /dev/sdb
Method #2: Securely wipe hard disk with shred command
You can use the shred command tosecurely remove everything so that no one recover any data:
shred -n 5 -vz /dev/sdb
Method #3: Say hello to scrub command
You can also use disk scrubbing program such as scrub. It overwrites hard disks, files,and other devices with repeating patterns intended to make recovering data from these devices more difficult. Type the following command to securely wipe out /dev/sdb:
# scrub -p dod /dev/sdb
相关文章推荐
- Centos Swoole安装
- Linux负载均衡软件LVS(概念篇)
- linux svn authorization failed错误
- Linux下复制粘贴快捷键
- linux清空日志文件内容 (转)
- linux下源码安装mysql
- CentOS6.5+hadoop1.2.1安装配置测试记录
- linux获取网线插拔状态的实现
- linux查看文件大小,卸载挂载硬盘
- linux中banner命令的用法
- [转]Centos6.5安装配置keepalived
- CentOS6.5+HADOOP2.7.1安装配置测试编译详细教程
- linux命令学习-(1)
- Linux与Windows 解压乱码 UTF8BOM读取问题
- GPS数据计算校验和的方法
- Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】
- centos安装vsftpd
- 详解Linux环境下Mysql的安装(含下载地址)
- Linux下修改新建用户权限
- linux上nignx php环境搭建