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 10-15-2004, 11:30 PM   #1
gagda1
LQ Newbie
 
Registered: May 2004
Location: Canada
Distribution: Fedora core 2
Posts: 28

Rep: Reputation: 15
format linux partition


Hello,
I want to format a newly created partition (hda4). I want to make sure I'm not screwing my existing partitions... Also, I would like to automount this partition a boot time. I'm using Fedora core 2.

fdisk returns the following.

Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 6514 52219282+ 83 Linux
/dev/hda3 6515 6628 915705 82 Linux swap
/dev/hda4 6629 9964 26796420 5 Extended

Thanks,
David.
 
Old 10-15-2004, 11:51 PM   #2
goofyheadedpunk
Member
 
Registered: Aug 2003
Distribution: Arch Linux
Posts: 140

Rep: Reputation: 15
To learn how to format the partition read the man page for "mkfs".

To learn how to automount the partition at boot time read the man page for "fstab".

When formating your partition be EXTREMELY sure that you're indeed formatting the partition. Don't type "mkfs.reiserfs /dev/hda" if all you want to do is format /dev/hda4 reiserfs. That would format /dev/hda completely, which would make you a very unhappy person I'm sure.

If you're nervous ( as in this is your first format ) post what you think you should use to format here, and we'll will make sure you don't format your other partitions.

Have fun!
 
Old 10-16-2004, 07:22 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,382

Rep: Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650
Re: format linux partition

Quote:
Originally posted by gagda1


Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 6514 52219282+ 83 Linux
/dev/hda3 6515 6628 915705 82 Linux swap
/dev/hda4 6629 9964 26796420 5 Extended

/dev/ha4 is an extended partition and therefore you can not format it with a filesystem. An extended partition is used to create more then 4 partitions on a drive and in a nut shell a container for logical partitions. So either you need to create a logical partition or change the partition ID type from 5 to 83 in order to create a filesystem.
 
Old 10-16-2004, 09:40 AM   #4
gagda1
LQ Newbie
 
Registered: May 2004
Location: Canada
Distribution: Fedora core 2
Posts: 28

Original Poster
Rep: Reputation: 15
How do I change partition ID type from 5 to 83 to create a filesystem?
 
Old 10-16-2004, 10:00 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,382

Rep: Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650
Use fdisk or cfdisk. cfdisk is probably easier to use. You want to set the type of partition.

http://www.tldp.org/HOWTO/IBM7248-HOWTO/cfdisk.html
 
Old 03-15-2007, 12:11 PM   #6
jerzeejerome
Member
 
Registered: Aug 2006
Location: Jersey, USA
Distribution: Fedora 6, Slackware
Posts: 66

Rep: Reputation: 15
I'm trying to format a partition and I get an error message:
root@darkstar:~# mke2fs -j /dev/hdc4
mke2fs 1.38 (30-Jun-2005)
/dev/hdc4: Invalid argument passed to ext2 library while setting up superblock
root@darkstar:~#
6 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdg doesn't contain a valid partition table
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: invalid flag 0xfffff313 of partition table 5 will be corrected by w(rite)

Disk /dev/hde: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hde1 2 4717 37881270 f W95 Ext'd (LBA)
/dev/hde2 * 4718 9730 40266922+ 7 HPFS/NTFS
/dev/hde5 ? 141386 166269 199875215+ be Solaris boot

Disk /dev/hdc: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 13 104391 83 Linux
/dev/hdc2 14 136 987997+ 83 Linux
/dev/hdc3 137 745 4891792+ 83 Linux
/dev/hdc4 746 3785 24418800 5 Extended
/dev/hdc5 746 868 987966 83 Linux
/dev/hdc6 869 1053 1485981 82 Linux swap
root@darkstar:~#

Last edited by jerzeejerome; 03-15-2007 at 12:18 PM.
 
Old 03-15-2007, 12:30 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,382

Rep: Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650
jerzeejerome,
According to fdisk hdc4 is an extended partition which can not be formated. An extended partition is in a nutshell a container for logical partitions i.e. any partition >4
 
Old 03-15-2007, 12:34 PM   #8
jerzeejerome
Member
 
Registered: Aug 2006
Location: Jersey, USA
Distribution: Fedora 6, Slackware
Posts: 66

Rep: Reputation: 15
Quote:
Originally Posted by michaelk
jerzeejerome,
According to fdisk hdc4 is an extended partition which can not be formated. An extended partition is in a nutshell a container for logical partitions i.e. any partition >4
If I make it a logical partition can it be formatted? If so how?
 
Old 03-15-2007, 01:36 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,382

Rep: Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650Reputation: 1650
Partitions 1-4 are primary. If you make this a linux filesystem then you will loose hdc5 and hdc6. You have space in the extended partition that is not being used and I would create another logical partition.
 
Old 03-22-2007, 08:23 AM   #10
jerzeejerome
Member
 
Registered: Aug 2006
Location: Jersey, USA
Distribution: Fedora 6, Slackware
Posts: 66

Rep: Reputation: 15
Thanks for your help I found a page that helped me. I had to read it a few time, but I finally got it.

http://tldp.org/HOWTO/Partition/fdisk_partitioning.html
 
  


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
Best HD partition format for linux Cripple Linux - Newbie 3 11-09-2005 01:51 AM
Format window partition from linux how? Itachi Linux - General 4 09-06-2005 08:40 AM
Format NTFS partition from Linux? EgosZ Fedora 3 10-21-2004 07:59 AM
Format a vfat partition with Linux... possible? lazlow69 Linux - Newbie 2 03-03-2004 11:50 PM
Linux partition format exalik Linux - General 5 08-19-2003 10:16 AM


All times are GMT -5. The time now is 08:07 PM.

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