2

I recently installed Ubuntu in my computer, which I was crazily looking forward to as this was my first big step in installing an open source OS by myself. So I created a 20Gb partition for Ubuntu and installed it via USB. After installing and setting up Ubuntu, I found that the Ubuntu partition was reduced by approx. 4Gb (it was 16.49 Gb). Now I am panicking whether that some of the partition cannot be recovered if I decide to remove Ubuntu and still won't get it back even when I delete the partition. Can you please help me?

1
  • 1
    You will have to be more specific. What exactly are you looking at to come up with these numbers?
    – psusi
    Mar 20, 2015 at 22:16

2 Answers 2

5

On installing with the defaults Ubuntu will have created at least two partitions:

  1. The root partition to hold Ubuntu and your data.
  2. A swap partition to extend your virtual memory in case it was needed.

The Swap partition will not be accessible from your desktop but you can see and list all of your partitions from a terminal with

sudo fdisk -l

or from the "Disks" utility (search the Dash for it):

enter image description here

The size of the Swap partition (on my disk 10 GB) depends on the amount of RAM in your computer and will roughly equal it.

Therefore it seems very likely that the 4 GB you can't see is just this Swap partition.

On removing Ubuntu (or other Linux distributions) you will also have to manually remove this swap partition.

0
1

Takkat's answer is almost certainly the correct one, or at least it's probably the bulk of the correct answer. There might be something else going on in addition to what Takkat wrote, though, which might be a small part of the answer.

Disk, partition, and filesystem sizes have long been measured in two ways:

  • Using SI units -- power-of-10 multiples of bytes (B) or bits (b), as in kilobytes (kB, 1,000 bytes), gigabytes (GB, 1,000,000,000 bytes), or megabits per second (Mb/s, 1,000,000 bits per second).
  • Using IEEE 1541 units -- power-of-2 multiples of bytes (B) or bits (b), as in kibibytes (KiB, 1024 bytes) or gibibytes (GiB, 1,073,741,824 bytes).

The IEEE 1541 units are relatively new. In the past, SI prefixes were applied to both power-of-10 and power-of-2 units, with rounding occurring to get similar values -- for instance, "kilo" was applied to multiples of 1024. This was inaccurate when applied to power-of-2 units, but the difference was small. At the kilobyte scale (as for instance when measuring the capacity of 5.25-inch floppy disks), the difference is only 2.4%. The difference between an SI terabyte and an IEEE 1541 tebibyte, however, is almost 10%. Disk manufacturers tended to stick to the canonical SI meanings of the prefixes, probably because it made their disks sound a little bigger than they were, given that most everybody else used the power-of-2 meanings.

Today, people unfamiliar with these distinctions can become confused when they see that their 4TB hard disk shows up in a disk utility as having just 3.6TiB of space. Both figures describe the same capacity, though.

In your case, the difference between a GB and a GiB is nowhere near enough to explain the difference you see. That's why I say that this distinction might be just a small amount of the effect, and Takkat's answer is probably the bulk of what's happening.

As a side note, please notice that I described an uppercase "B" as the abbreviation for byte and a lowercase "b" as the abbreviation for bit. In most contexts, a byte is 8 bits, so a 20Gb partition is really just 2.5GB. In the context of your question, your intended meaning (GB or GiB, not Gb) is clear, but that might not be the case in some situations. Data transfer rates are often expressed in (multiples of) bits per second, which can lead you to very wrong conclusions if you mis-read the abbreviation!

As a second side note, although a lot of programs and manufacturers are now taking greater care to distinguish between SI and IEEE 1541 units for disk capacities, RAM is still often being mis-measured using SI prefixes to refer to IEEE 1541 units. This is worth noting so that you don't misjudge something.

3
  • Out of interest, what contexts don't use 8 bits per byte?
    – Holloway
    Mar 21, 2015 at 6:53
  • There are some exotic computers (mostly old ones) that use(d) other values. See this Stackexchange question/answer for more information.
    – Rod Smith
    Mar 21, 2015 at 14:05
  • Thank you so much for the deep information, highly appreciate it. Believe me or not, you just gave me a new way to think about space!
    – Arthrax
    Mar 27, 2015 at 0:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .