LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Formatting existsing unused partition (https://www.linuxquestions.org/questions/linux-hardware-18/formatting-existsing-unused-partition-58331/)

rusium 05-06-2003 01:43 AM

Formatting existsing unused partition
 
I have a 40g HD with 3 defined partitions, I made an extended partition with fdisk and im running into some problems now when formatting it...

fdisk -l
Warning: invalid flag 0x0000 of partition table 5 will be corrected by w(rite)

Disk /dev/hda: 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/hda1 * 1 2550 20482843+ 83 Linux
/dev/hda2 2551 2677 1020127+ 82 Linux swap
/dev/hda3 2678 4865 17575110 5 Extended

---

mkfs.ext3 /dev/hda3
mke2fs 1.32 (09-Nov-2002)
/dev/hda3: Not enough space to build proposed filesystem while setting up superblock

---

df -a -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/hda1 ext3 20161172 5885384 13251648 31% /
none proc 0 0 0 - /proc
usbdevfs usbdevfs 0 0 0 - /proc/bus/usb
none devpts 0 0 0 - /dev/pts
none tmpfs 192288 0 192288 0% /dev/shm


---

Can someone point me in the right direction?

je_fro 05-06-2003 02:25 AM

I don't get it....
 
So you want to format /dev/hda3 ext3?
I use:
mke2fs -j /dev/hda3
Or is your problem that you're not seeing the partition using df?
Is it mounted?

slakmagik 05-06-2003 02:52 AM

Yeah, I was going to say I didn't get it, either, but was going to let somebody else post first. *g*

I think he was saying he tried formatting and couldn't. Not sure what the problem is, but I don't trust extended partitions. If you've only got two primaries, why not make a third? I'd just delete the unformatted extended, recreate it as primary, and then try formatting that.

Wait... there is that. If it's an extended, shouldn't it be /dev/hda5? I think that might be what fdisk is complaining about - it sounds like it wants to reorder and rewrite the table, because it's messed up. I don't know.

Like I say, I'd either change the flag to make it 83, or just delete and recreate as 83. Hate extended partitions.

je_fro 05-06-2003 02:57 AM

Ohh, I see...
 
He needs to make a logical partition, /dev/hda4

slakmagik 05-06-2003 03:06 AM

Hm. Well, if it was DOS, he'd need to create logical drives inside the extended. They'd get labeled D:, E:, etc. But in Linux, I think the extended's just the extended, and begins numbering from hdX5. I've been able to avoid the extended/logical stuff in Linux so far, so I'm not sure. So his table should read

/dev/hda1 83 Linux
/dev/hda2 82 Linux swap
/dev/hda5 5 Extended

and then, yeah, maybe he would need to create an 83 inside the 5? I dunno. But it wouldn't be /dev/hda4. It'd just be a subset of 5, I guess.

Or it should read

/dev/hda1 83 Linux
/dev/hda2 82 Linux swap
/dev/hda3 83 Linux

That last is what I'd do. Then do mkfs on it.

je_fro 05-06-2003 03:13 AM

Re: Formatting existsing unused partition
 
Quote:

Originally posted by rusium

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2550 20482843+ 83 Linux
/dev/hda2 2551 2677 1020127+ 82 Linux swap
/dev/hda3 2678 4865 17575110 5 Extended

---

mkfs.ext3 /dev/hda3
mke2fs 1.32 (09-Nov-2002)
/dev/hda3: Not enough space to build proposed filesystem while setting up superblock

/dev/hda3 2678 4865 17575110 5 Extended

I think he's trying to format an extended partition ext3. That's not allowed. The next partition, the logical one, should be /dev/hda4. I think.
What do you think?

I like the idea of getting rid of the extended the best, though. Use that scheme above, I think.
L8TR

slakmagik 05-06-2003 03:37 AM

Yeah - just ditch the extended. :)

michaelk 05-06-2003 08:21 AM

An extended partition in simple terms is a place holder for logical partitions. You don't format it.

Use fdisk to create a logical drive and then format as you wish. It will be /dev/hda5 as stated above.

FYI
Primary partitions are 1-4. An extended partition is a primary.
Logical partitions are 5-64.

Getting rid of the extended would limit your self to only one additional partition since there are only 4 primaries allowed. Some like to use different partitions for /, /home, /boot, /var etc. which can be more than 4.

rusium 05-06-2003 12:41 PM

Sorry, i posted late last night I was pretty lazy.

Im trying to partition /dev/hda3 which was intended to be an extended partition, but I get errors when trying to format it...


ok i got rid of the extended partition and created a primary, formatted it, mounted it, and it works fine, thanks for the help :D


-Dan


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