PDA

View Full Version : wipe partition



aditnsr
31st December 2008, 01:34 AM
Hi all,

can I use:

dd if=/dev/zero of=/dev/sda6

to zero fill my /dev/sda6? or will it wipe the whole /dev/sda?
thx,

Adit

stoat
31st December 2008, 03:54 AM
Hello aditnsr,

I think folks are steering clear of this because a command like that is a single keystroke away from a catastrophe. Nobody wants to be blamed for that. If you had to ask that question, then you shouldn't try it even if someone answers your question. I strongly urge you to download and make yourself a GParted LiveCD (http://gparted.sourceforge.net/download.php). It's my favorite partition manager. You can use it to delete/recreate or reformat that partition. It's a nice GUI app so it's easier to see what you are doing. It also will ask you if you are sure before doing something (dd will never do that). It's also easy to learn on-the-fly so to speak. And you can play with it, too, because nothing really happens until you click on "Apply". You, of course, should do what you want. But at least think about it.

aditnsr
31st December 2008, 04:50 AM
ok stoat, thanks for the advice..

stevea
31st December 2008, 05:02 AM
Yes that command works, except it doesn't wipe the partition table so the system may still suspect it's an XX type file system occupying that partition.

*WHY* do you need to wipe it ? I just don't understand it. Don't mount it and that's a great way to ignore it. Over-write it if you want. Use gparted to properly remove the p' table entry if that's the goal.

aditnsr
3rd February 2009, 11:24 AM
Yes that command works, except it doesn't wipe the partition table so the system may still suspect it's an XX type file system occupying that partition.

*WHY* do you need to wipe it ? I just don't understand it. Don't mount it and that's a great way to ignore it. Over-write it if you want. Use gparted to properly remove the p' table entry if that's the goal.

hai stevea,

So that command works but the partition table entry of that partition remains.
I can just use fdisk instead to remove the partition table entry right?
and edit /etc/fstab and/or evrything else related to that removed partition?

As to 'WHY', actually I have no reason to do it, and I'm probably never going to do it.
I'm just curious. A little more knowledge never hurts, right? :)

cheers

crunched
3rd February 2009, 11:48 AM
Forget dd. Unmount the partition, then use fdisk to delete it. Then as you said, make sure fstab ins't trying to remount it on startup.

Or just format the partition?

Sauron
3rd February 2009, 12:25 PM
Wouldn't it depend on whether you were attempting to shred the data on the partition before removing it from the table?

Jaguar07
4th February 2009, 06:07 PM
If you were actually looking to securely remove the data, something like the scrub utility would be a much better alternative.

scrub was created at Lawrence Livermore national laboratory to be a DoD compliant data removal tool.

preone
4th February 2009, 07:28 PM
Hi aditnsr,

I heard something about this command , if you want to clear a partition like /dev/sda6 it seems in attention of other's opinion and ofcourse I agree with them ,this command isn't suitable for deleting a partition but because of the boot sector probably didn't clear properly if that partition was booting partition, this command in this situation will be so useful, with this command you can clear boot sector as well:



dd if=/dev/zero of=/dev/sda6 bs=[size of boot sector] count=1


depend on type of your filesystem ,boot sector size is defined , for example boot sector size in ext2,3 is 1024 byte