Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] How to get the best partition scheme ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
apinsard
n00b
n00b


Joined: 24 Mar 2012
Posts: 74
Location: France

PostPosted: Fri Apr 06, 2012 4:19 pm    Post subject: [SOLVED] How to get the best partition scheme ? Reply with quote

Hi,

For many reason, I'm about to reinstall Gentoo on my computer.

I use my computer exclusively for office and programming.

After reading here an there on the internet, I planned this partition scheme :
Code:

100 GB  /home
 14 GB  /
 50 MB  /boot
  6 GB  swap
 50 GB  /var
 50 GB  /var/tmp/portage
 30 GB  /usr
 30 GB  /usr/portage
 40 GB  /usr/portage/distfiles


The /home would contain all my documents. I think I can short it to 80GB if necessary
/var would be useful for my web apps.

I'm not quite sure about the space I grant for /usr and portage, and I don't know how to choose the best filesystem within the partition, as well.

Could you give me some tips to help me getting the best partition scheme.

I would also appreciate some other helpful tricks about installing Gentoo.

I've just a slight 2 weeks experience with Gentoo. I used Debian for 2 years.

Thank you.


Last edited by apinsard on Sat Apr 07, 2012 1:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
Arkhelion
Apprentice
Apprentice


Joined: 07 Sep 2010
Posts: 151
Location: France

PostPosted: Fri Apr 06, 2012 5:00 pm    Post subject: Reply with quote

I believe that you could encounter quite a lot of difficulties if you get /usr outside of /. /usr/portage can very well be put on a separate partition though (or even a loop device).

What's the point of giving 30GB to /usr/portage if you keep your distfiles elsewhere (and 40GB of distifiles is quite a bit too)?
I also find it quite strange to get a separate partition for /var/tmp/portage, which is... well... temporary files only. If you predict a lot of files for web apps, I'd rather put /var/www on a separate partition.

As a rule of thumb, I like the simplicity of handling partition within LVM. So I tend to use a system-VG and a home-VG (you can also use a single system-wide-VG). That way you can start with small partitions and grow/shrink them as needed. With ext4 or BtrFS (just an example) you can even do that online (grow... shrink is a little bit dangerous online for ext4).

I really believe that you'll loose a _lot_ of space if you put your partitions that way (especially with 50GB /usr/portage without the distfiles and with /var/tmp/portage which is only used while emerging).
_________________
Arkhelion
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Sat Apr 07, 2012 7:59 am    Post subject: Reply with quote

If you look at the various discussions about the next changes to udev, you'll see that having /usr or /var on a different partition to / will require you to use a kernel with an initramfs. If you plan to use that sort of kernel, then it's not an issue, but if you want avoid an initramfs you might need to keep /, /usr and /var in the same partition. That might not be the final case - there are various attempts at fixing udev's problem in other ways, but that's just speculation.

My current partitioning (set up before this udev stuff surfaced) is /boot, /home, /var, /var/tmp and / for everything else. In turn, I bind mount a subdirectory of /var/tmp as /tmp. The idea is that /var/tmp and /tmp are stuff I don't need to backup. /var was separate because I wasn't sure how big to make it due to portage's sometimes heavy use, but in fact I believe that's really in /var/tmp anyway. My portage distfiles directory is in /var/tmp too.

I'm not sure I'd have a separate /boot if I did it again. IIUC the original reason was to handle BIOS limits on addressing bootable partitions, though I thought there's supposed to be a slight security gain by not having the kernel binaries mounted under normal circumstances.
_________________
Greybeard
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 528

PostPosted: Sat Apr 07, 2012 9:09 am    Post subject: Reply with quote

Arkhelion wrote:
I believe that you could encounter quite a lot of difficulties if you get /usr outside of /. /usr/portage can very well be put on a separate partition though (or even a loop device).


In your opinion is better (as performance) on a separate partion or a loop device with ext2? Or the difference is tiny?
Which file system shall I use for loop device? Ext2?


Last edited by yellowhat on Sat Apr 07, 2012 10:07 am; edited 1 time in total
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sat Apr 07, 2012 9:25 am    Post subject: Reply with quote

I use a setup where most partitions are 16G; that's /, /home, /var, and /usr/portage. I find messing
with grub nerve-wracking, since I have a multibooting laptop, and so put /boot on a separate
partition of 128MB; that way after the initial grub install I have only to edit grub.conf (this is
grub 0.9x; I have no idea how to control the "automatic" grub 2.0, which is why I don't use it).
There's also a swap partition of 2x RAM, in case I feel the need to hibernate.

I have other partitions storing large amounts of data, which are generally mounted under /home,
and if I need more space for building stuff I can mount a temporary, empty partition on /var/tmp/portage.
All the partitions are ext4, except for /boot, which is ext2.

I don't think you will need more than 16G for any of your main partitions, though /home of course
may need to be much larger, and that layout has served me pretty well for some time.

Good luck - Will
Back to top
View user's profile Send private message
apinsard
n00b
n00b


Joined: 24 Mar 2012
Posts: 74
Location: France

PostPosted: Sat Apr 07, 2012 11:12 am    Post subject: Reply with quote

Thank you all for your answers.

I don't need an initramfs, so I'll drop the idea of /usr and /var partitions.

I gave 30GB to /usr/portage because à thought that /usr/portage/packages also take a lot of space.

The point with /var/tmp/portage is that with my current installation (15GB for the root partition and the rest for /home). I were not able to emerge libreoffice as it required 9GB disk space at /var/tmp/portage. I got around this problem by changing PORTAGE_TMPDIR. But 50GB is certainly too much. xD

Maybe this could be better :

Code:

ext4  14 GB  /
ext4  15 GB  /usr/portage
ext4  15 GB  /usr/portage/distfiles
ext4  15 GB  /var/tmp/portage
ext4  55 GB  /var/www
ext4 200 GB  /home
ext2 100 MB  /boot
swap   6 GB  swap


I'm not sure about filesystems. This is what I'm used to.

I'm also used to LVM but I always made only one VG. What's the advantage with having a system-VG and a home-VG ?
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 444
Location: Kraków, PL

PostPosted: Sat Apr 07, 2012 11:24 am    Post subject: Reply with quote

I personally see no point in separating distfiles from portage tree, /usr/portage will be sufficient.
Also setting different /var/tmp/portage just in case of libreoffice build seems an overkill to me. Nothing prevents you from bindmounting it just for one time when it is needed.
Third thing - are you sure you need separate /var/www with 55GB space? I personally cannot imagine a home system needing this.

So my suggestion:
Code:

/
/boot
/home
/usr/portage

And if you are sure you need it, then separate /var/www

In the above scheme you may need to give a little bit more to / partition - like 25GB or something like this.
ext4 is fine as a filesystem.
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
apinsard
n00b
n00b


Joined: 24 Mar 2012
Posts: 74
Location: France

PostPosted: Sat Apr 07, 2012 12:03 pm    Post subject: Reply with quote

Actually I don't either need more than 50GB for my home partition. So why not be wide for others as well ?

But you're right. I'm alone on my computer, since it's my laptop...

So no need to protect some parts of my filesystem by mounting a partition read-only for instance.

Eventually, maybe I just need this :

Code:

ext4  64 GB  /
ext4 250 GB  /home
ext2 100 MB  /boot
swap   6 GB  swap


I wonder if making backups on the same disk make any sense ? I mean making a 125GB /home partition and a 125GB /home/backups partition.
Put another way, can a filesystem crash ? Or is a crash disk always about hardware ?


Last edited by apinsard on Sat Apr 07, 2012 1:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 444
Location: Kraków, PL

PostPosted: Sat Apr 07, 2012 12:12 pm    Post subject: Reply with quote

Looks reasonable :)
Backups on the same disk makes sense, it won't help you in case of a failed disk or a stolen laptop but may be used to recover a file that was deleted by mistake, or taken away by a crashed filesystem.

Still it is good to have a separate offsite backup :)
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Apr 07, 2012 12:19 pm    Post subject: Reply with quote

I usually go with small /boot/, 20-50 GB for /, /var/ size depends on what I use the machine for (and moving the portage tree and distfiles to sensible places in /var/), and the rest as /home/. udev has made it unreasonably difficult to keep doing this however.
Back to top
View user's profile Send private message
apinsard
n00b
n00b


Joined: 24 Mar 2012
Posts: 74
Location: France

PostPosted: Sat Apr 07, 2012 1:03 pm    Post subject: Reply with quote

OK fine, I'm gonna do this. Of course, I make a backup once in a while on my external HDD, as well.

Have any suggestion on the way to make backups on the same disk ? Kinda RAID0. Or maybe a tool which provides automatic backups with versions and the ability to delete old versions to save space ?
Back to top
View user's profile Send private message
gorkypl
Guru
Guru


Joined: 04 Oct 2010
Posts: 444
Location: Kraków, PL

PostPosted: Sat Apr 07, 2012 1:20 pm    Post subject: Reply with quote

You've probably meant RAID1, but no, RAID is definitely not a backup. When you delete a file it will be deleted from all disks in array. It also won't save you from filesystem crashes, as FS is one level 'higher' than RAID array.

If there is a simple backup tool I will gladly read about it, because currently I am using hand-crafted bash scripts which just call app-backup/dar in regular periods of time.

There are some good backup suites (like amanda or bacula), but they are usually too powerful for such needs.
You may want to list all packages in app-backup/* and check the ones that seem to be relevant.
_________________
BTW, TWM FTW!
Back to top
View user's profile Send private message
apinsard
n00b
n00b


Joined: 24 Mar 2012
Posts: 74
Location: France

PostPosted: Sat Apr 07, 2012 1:43 pm    Post subject: Reply with quote

Thanks, writing one's own backup scripts sounds good too and might be more scalable.

I think I have all what I need to reinstall now.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sun Apr 08, 2012 9:40 pm    Post subject: Reply with quote

The other thing, if you've got space, is to have a second install (mine is shell only) which comes
in handy when you want to mess with the filesystems of your main installation. You can boot
a CD or USB stick to do that - I just find it handier to have a second menu entry to boot the
same kernel on a different / partition (home and swap stay the same). It needn't even be
Gentoo - for a while, mine was a recent Ubuntu while I looked at the GUI.

Will
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum