Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
# fdisk -l

Disk /dev/sda: 34.4 GB, 34359738368 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d5d11

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1265    10155008   83  Linux
/dev/sda2            1265        1457     1544192   82  Linux swap / Solaris

My virtual machine have 34.4 GB disk, I had already divided it into 2 partitions /dev/sda1 (9.68 GiB) for root path and /dev/sda2 (1.47 GiB) for swap area, so that I have remain free space about 20.84 GiB

I can format unallocated space via Gparted, but If I want to use command line such as mke2fs to handle this job, how I can refer to that free space to complete this command line.

mke2fs -jv /dev/<xxx>
share|improve this question
up vote 2 down vote accepted

You don't. You create a partition using the free space, and format that.

share|improve this answer
how I can do that? I need command line version for this job. – Smile.Hunter Jan 22 '13 at 20:36
@Smile, with fdisk of course, or parted is a bit friendlier. – psusi Jan 23 '13 at 15:30
finally, I ended up with gparted :/ – Smile.Hunter Jan 23 '13 at 20:17

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.