Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm somewhat new to working with commandline tools when dealing with partitioning, so you'll have to excuse my newness.

I'm basically trying to create a new logical partition on /dev/sdb and would like to install ext3 on it. How would I do this, step by step, in parted? It's a brand-new hard drive with absolutely nothing on it.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

First, make sure you understand the difference between primary, extended and logical partitions. To create a logical partition, you first need to create the extended partition that will contain it. If there's only one partition on a drive, there's no point in not making it primary. Below I'll give instructions for a logical partition; creating a primary partition is similar, only simpler, so you should be able to figure it out.

Parted isn't the easiest tool for a straightforward task, a dedicated partitioning tool such as cfdisk or even fdisk may be easier to apprehend. But here goes (untested, make sure you understand what's going on and don't proceed blindly if you see error messages). You'll need to enter the size of the device when creating the partition (parted displays it).

mklabel msdos
mkpart extended 0 123456
mkpart logical 0 123455

Then run mkfs.ext3 /dev/sdb5 outside Parted.

If you choose to use cfdisk, you should be able to navigate its menu-driven interface. If you prefer fdisk, the sequence of instructions is:

n             create partition
e             extended
1             number (1–4)
<return>      accept default start
<return>      accept default end
n             create partition
l             logical
<return>      accept default start
<return>      accept default end
p             show the current table, review it
w             write changes
q             exit
share|improve this answer
Thanks, I did end up using fdisk and it was a lot easier than parted. I did create a primary partition, as that's all I really needed. Thanks for the help with parted, though, I just assumed it would be easier to specify the size of the drive, as per fdisk, which defaulted to using all the space. –  Naftuli Tzvi Kay Apr 11 '11 at 22:41
Out of curiosity, why do you advocate creating an extended+logical partition, over simply creating a primary partition? If you're just putting one big partition across the entire disk and thus don't need 5+ partitions (as made possible by the extended partition) I just don't see any point to doing it this way over just mkpart primary 0 123456. Not trying to start a discussion on this, just seeking clarification of your answer. –  Kromey Apr 11 '11 at 23:48
@Kromey: I don't advocate a logical partition, I'm just focusing on it because that's what the question requested. In fact I advocated using a primary partition; hopefully my edit makes this a bit clearer. –  Gilles Apr 12 '11 at 0:01
Sorry, I must have mis-read both question and answer, unless your edit was to add the "not" in front of "making it primary". –  Kromey Apr 12 '11 at 0:09
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.