Partition type order

Asked by laptoplinux

First let me apologize if this is a noob question. I don't consider myself one but I have NEVER really been able to get my head around partitioning. So I guess in some ways I am one. Anyway...

I decided that I wanted to be able to encrypt my home partition as outlined in http://ubuntuguide.org/wiki/Ubuntu:Hardy#Encrypt_home_partition_with_cryptsetup_.26_LUKS but discovered that the HOME directory has to be a separate partition.

Since I was dealing with a relatively clean install I figured it would be easier to reinstall Hardy and use the manual partitioning option vs messing around with something such as this:http://www.psychocats.net/ubuntu/separatehome

My frustration is that every time I look at documentation for partitioning and the tools used it isn't nearly as clear to me as it is to others.

Question 1:
When creating partitions is there any advantage/disadvantage to the order of the partition types. For example, in this guide, https://help.ubuntu.com/community/DiskSpace, it outlines the following :

swap; size of RAM
/; at least 3GB, at most 15 GB
/home;the rest of the disk

That is fine and well but is that ACTUALLY the order that they should be created? In my original install the Ubuntu live cd installed / and then Swap.

I have created:
SDA1 Primary ext3 for /
SDA2 Primary ext3 for /home
Swap

Have I botched it and if so what are the consequences? Should I re-install again?

Question 2:
Why is it that the partition editor NEVER keeps even numbers. I requested on a 100GB drive:

SDA1 Primary ext3 for / 15GB
SDA2 Primary ext3 for /home 83GB
Swap 2GB

and I always get some wacky numbers when formatted:
SDA1 Primary ext3 for / 13.9GB
SDA2 Primary ext3 for /home 76.7GB
Swap 1.9GB

plus

gvfs-fuse-daemon 13.9GB

Why doesn't it keep nice clean number and where did my missing 7.5 GB's of disk space go!? Clearly I am screwing up somewhere.

Question 3:
Any feedback on using the disk encryption as outlined on the Ubuntu site. Worthwhile or a potential horror story?

Thanks and once again sorry for the noob question. Also if I am suppose to break this out into separate threads let me know and I shall.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Hutchinson
Solved:
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

I'm not sure I have all your answers but I'll try.

Answer 1 - I don't it really matters where on the disk the partitions are. I suppose there could be some performance gains if it's done one way over another - like if it were to minimize head movement but I suspect it's minimal. Of course putting partitions on separate drives should have a bigger impact on performance - especially swap if you computer tends to use swap a lot. Fwiw, I always partition this way:

/
/home
swap

I usually give 20GB to /, 2GB to swap and the rest to /home. I have 2GB of ram so the standard formula says 4-6GB of swap but with 2GB of ram swap is rarely used on my system. I currently have a 320GB drive. If you had a really small drive then 20GB for / may be too much. It can work with just 4 but I like having space to add things without worrying about space. I currently still have 13GB free on /.

So in short, I don't think you botched anything and no real need to change it.

Answer 2 - I can really answer this but I see the same thing. My guess is that the formatting process eats up a small bit of space or maybe there are bits that are just not usable (no drive is 100% flawless). It could also have something to do with the different ways in which space is measured. Different programs tend to report space differently. Some use the 1,000 KB = 1GB approach and other use powers of 2 so a KB is really 1024 bytes and a GB is 1,073,741,824 bytes. I think it's 2 to the 10 for a KB, 2^20 for a MB and 2^30 for a GB. Obviously 1,073,741,824 bytes is not equal to 1,000,000,000 bytes so some discrepancy shows up if one programs uses the decimal method and another uses binary. I have seen this difference even at install when the partition editor uses decimal and then later it's reported using binary - I think. In any case, while annoying if you like round numbers it's really not an issue to worry about and you can't really change it anyway.

Not sure about the fuse part. Haven't got a handle on that myself yet.

Answer 3 - as for encryption I only tried it out once for fun but currently I'm not using it. It seemed more of a hassle than it was worth - at least on a desktop. If you have a laptop with sensitive info then I think it makes a lot more sense. I don't think it's a horror story. I've never heard of any problems but it adds a layer of complexity and will probably slow things down a bit but may or may not be all that noticeable. I didn't notice much difference but then I only used it for a day or so. Personally I don't find it worthwhile but if you have any reason to not want data compromised and you think there is a measurable probability of that then it probably is worthwhile.

It's kind of like locking your bike. If you park it with a million other bikes and no one locks theirs but you then it's going to be really safe, but even you don't there is only a 1 in a million chance yours will be stolen anyway. You have to decide if that is too much risk or not.

Hope that helps. It is generally advised to asked questions separately but yours are more or less related so no worries. You might want to ask the encryption question on its one if you want a better answer.

Revision history for this message
laptoplinux (laptoplinux) said :
#2

Jim,

Thank you very much for your detailed reply. It was very helpful and clarified some stuff that I was clearly fuzzy with.

I have a 100GB drive on a laptop and I was attempting to partition it in just the way you outlined. I think I understand your explanation in answer 2 but it seems to me that over 7GB's missing is a big hit. On my initial install, allowing Ubuntu to partition the disk (root and ext3), I didn't lose any disk space so I guess that is why I am a little concerned.

The box will be used for work and it will indeed have sensitive information on it so I would really like to try the encryption as outlined in the link I posted. Thanks for the feedback.

At the end of the day if the added security (encrypted home directory) requires a 7GB trade off I can probably live with it but it still baffles me.

I would like to mark this as problem solved but would like to pursue the missing disk space further. Should I start it as another topic or leave this one open?

Once again, Thank you.

Revision history for this message
laptoplinux (laptoplinux) said :
#3

Also do you know in which way the Ubuntu Installer measures space when partitioning?

Revision history for this message
Best Jim Hutchinson (jphutch) said :
#4

I'm thinking the missing 7GB is just the decimal-binary issue. I have a 320GB drive with 20GB for /, 2GB for swap and 298GB for /home.

df -h tells me I have 18GB for / and 274GB for /home. Therefore I'm missing 24GB on my /home which is roughly 3 times what you are missing and 3 times the size.

I think the installer uses the decimal measurement so 83GB is 83,000,000,000 bytes divided by the binary number of bytes in a GB - 1,073,741,824 - gives 77.3GB which is almost exactly what you are reporting. My best guess is that is basically where the discrepancy lies. Perhaps there is also a bit lost with the encryption but I really don't know.

Revision history for this message
laptoplinux (laptoplinux) said :
#5

Thanks again Jim. Based on the math it sounds like you are correct so I will close this out as solved. If I come across any new information at a later date re: the MIA disk space I will ping you or post an update.

Revision history for this message
laptoplinux (laptoplinux) said :
#6

Thanks Jim Hutchinson, that solved my question.

Revision history for this message
laptoplinux (laptoplinux) said :
#7

Jim Hutchinson's explanantion about the missing disk space was spot on. When I used df -h to check my disk it returned the odd numbers I had been seeing. But when I df -H it returned the numbers I expected to see. When I checked the --help for df I noticed this:

-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
-H, --si likewise, but use powers of 1000 not 1024

clearly the Ubuntu apps are using powers of 1024.

Thanks again

Revision history for this message
laptoplinux (laptoplinux) said :
#8

I would also add just for the record that I have noticed an increase in boot time with my new partition set-up

SDA1 Primary ext3 for / 15GB
SDA2 Primary ext3 for /home 83GB
Swap 2GB

vs when the box was just root and swap but nothing so severe that I can't live with it.