Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make spare partition ext2

Status
Not open for further replies.

ascikey

Programmer
Feb 18, 2004
127
GB
Hi all,
I have 5 gig of free space (unallocated) on my 1 and only hard drive in this com and I would like to make it ext2 could someone please tell me the command to do this. At the moment there is hda1 = 100mb, hda2 = 13720mb and hda3 = 250mb of a 20gig hard-drive.
thanks
 
Thanks for your reply,
The problem is of course that one wrong move and a new install will be needed. This is not a problem in fact it would be an easier solution but I would like to learn something along the way.

The man pages are very informative and give you every conceivable argument but are a bit overwhelming.
but hey what the heck, here goes.
 
*** DISCLAIMER: DON'T BLAME ME! ***
Use fdisk, select the unallocated partition, hit 't' to change the type, select (82?) for ext2 (however, like ericbrunson, I also recommend ext3). Hit 'w' to write it. Then 'mk2fs <your partition>'. It's not hard, not complicated, but not a lot of room for error either.

That's the short, dirty version. BE WARNED: if you select the wrong partition, then run mk2fs on it, your stuff will be gone, and there's no convenient Recycle Bin to restore it from. It's a crappy feeling too, as I personally did this once and suffered the loss of well over 10GB of mp3s (I still wake up screaming in the night).

----
JBR
 

fdisk is about the most potentially dangerous tool on the system that I can think of, but if you read the man page and don't do anything obviously stupid, like delete an existing partition, there shouldn't be any problems.

Similarly, mke2fs would be bad if you ran it on the wrong partition, but still, no less sucky than 'rm /lib/i686/libc.so.6'.

Anything you screw up as root has the potential for extreme suckitude.
 
My actual problem was that I needed a spare partition and I didn’t have one. I then used a third party partitioning tool to move all the data up and create one, but fdisk could not see the newly made partition. With the help of the aforementioned link I managed to get the start and end point of the partition using
“fdisk -l /dev/hda”
then just made partition 4 the one that couldn’t be seen (there was only three at this point) all went well so I then made it ext3 by
“mkfs -t ext2 -j /dev/hda4”
but as I had never used fdisk I wasn’t just sure where to start. My reason for needing a spare partition is so that I can have a bash at this Linux . seemed a good way to learn the inner workings. Thanks for all your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top