-   Linux - Newbie (
-   -   One command to totally reformat linux box? (

Morgandy 01-11-2010 10:06 AM

One command to totally reformat linux box?

I want to start totally from scratch on Linux server I installed the other day. No dual boot, no personal files, etc... on it.

Fdisk -l shows the following:

Disk /dev/sda: 320g
255 heads, 63 sectors/track, 38913 cylanders
units = cylanders of 16065 *512 = 822...bytes

/dev/dsa1 * 1 13 104391 83 Linux
/dev/sda2 14 38913 312464250 8E Linux LVM

All the info I have found has multiple steps, but in my situation is there just 1 easy command to do this?

If not, can I just reinstall from CD and it will reformat and let me customize more?

If I have to use the several steps to reformat, can you explicitly type out exact commands for me? I am completely new, have to learn all this, and all the referece books/materials kind of scatter the info around.

Thanks so much...

Agrouf 01-11-2010 10:17 AM

Most distros will allow you to wipe out anything that is on the disk.

thorkelljarl 01-11-2010 10:17 AM

An alternative...

This is not the answer to your query, but you can also do the job with a PartedMagic or GPartedLive CD with a GUI. A live-cd partitioning CD is also handy to have on hand in general.

taylorkh 01-11-2010 06:39 PM

If you want to zap the existing partitions before starting your new install...

Boot from a live CD such as Ubuntu or Knoppix
Open a terminal window and do the following

sudo fdisk /dev/sda
d <enter>
2 <enter>
d <enter>
1 <enter>
w <enter>
q <enter>
The "1 <enter>" step may not be necessary - fdisk may not ask for which partition to delete if only one is left - have not done this recently and am writing from memory.

These steps will...
delete partition 2 (sda2)
delete partition 1 (sda1)
write the changes to the disk
exit fdisk


As Agrouf said - the install process for most distros will include steps to partition the drive. Chose "manual" and then delete the existing partitions and create new ones.

If you for some reason want to sanitize the disk before installation - do a google for DBAN. Download and burn to a CD, boot the computer from the CD, follow the on-screen prompts and wait a few hours. The drive will be cleaner than when it left the factory :D


chrism01 01-11-2010 07:08 PM

The simplest way, if you don't need to keep anything, is just to do a re-install & take the defaults.

itsbrad212 01-11-2010 09:37 PM

Reinstall or if you want to have fun, run:


su root
rm -rf /

*Only run that if you want everything on that partition to be wiped!*

I included that just for some of our newer users. :D

All times are GMT -5. The time now is 06:07 AM.