LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-11-2010, 10:06 AM   #1
Morgandy
LQ Newbie
 
Registered: Dec 2009
Location: Cleveland
Posts: 16

Rep: Reputation: 0
One command to totally reformat linux box?


Hi,

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...
 
Old 01-11-2010, 10:17 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Most distros will allow you to wipe out anything that is on the disk.
 
Old 01-11-2010, 10:17 AM   #3
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,796

Rep: Reputation: 213Reputation: 213Reputation: 213
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.

Last edited by thorkelljarl; 01-11-2010 at 10:18 AM.
 
Old 01-11-2010, 06:39 PM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,590

Rep: Reputation: 111Reputation: 111
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
Quote:
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

THIS WILL WIPE OUT ALL DATA ON THE DISK!!!!!

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

Ken
 
Old 01-11-2010, 07:08 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
The simplest way, if you don't need to keep anything, is just to do a re-install & take the defaults.
 
Old 01-11-2010, 09:37 PM   #6
itsbrad212
Member
 
Registered: Nov 2009
Location: Chicago
Distribution: Arch and OpenBSD
Posts: 104

Rep: Reputation: 19
Reinstall or if you want to have fun, run:

Code:
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to format Linux Box in single command? your_shadow03 Linux - Newbie 16 03-19-2009 08:04 AM
Need a linux command which will give me Manufacturer and Model of the Linux box adastane Linux - Newbie 7 12-14-2007 12:20 AM
need a linux command which will give me Manufacturer and Model of the Linux box. adastane Solaris / OpenSolaris 3 12-13-2007 04:23 AM
command to get the serial number of linux box bhatpp Linux - Newbie 4 09-19-2007 10:45 AM
hdd reformat from the command line Dewey Linux - Newbie 2 03-28-2005 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration