Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing to multiple partitions?
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
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Fri Oct 03, 2014 9:53 pm    Post subject: Installing to multiple partitions? Reply with quote

Hello! I am coming from the Debian world. I have been there since 1999 or so. I have always loved it, always done my own installs via network install, and I partition my disks out base don how I use them. With systemd in the pipe for Jessie (Debian 8), I am leaving as many others are. So far my two choices are Gentoo and Slack. I used Slack years ago, but have always wanted to toy with Gentoo. To be honest, I wanted to try a stage 1 install at one point, but never did.

Anyway, I have partitioned my disk (20GB VirtualBox running in Debian 7) and am at a stopping point. The guides show a very primitive setup of a boot partition, a swap partition, and a home partition. I have eleven partitions! I have no clue how to install at this point. My current layout is below and works VERY well in Debian.

400MB - /
100MB - /boot
1.0GB - /var
1.0GB - /var/cache
500MB - /var/lib
1.0GB - /var/log
6.0GB - /usr
19.3GB - /home
200MB - /tmp
1.0GB - /usr/src
1.0GB - <swap>

I am not in front of my laptop but I believe that is right. Why do I break it down so much? I like to prevent fragmentation since we STILL do not have a defragmentation system for ext4. I know that is a topic for debate, but I can show you systems with one or two partitions that are over 50% fragmented. This layout has proven to be very solid for me and I am attempting to carry it over to Gentoo. How would I mount this setup and install to it?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2575

PostPosted: Fri Oct 03, 2014 10:07 pm    Post subject: Reply with quote

May I start off by saying welcome to Gentoo!

6.0 GB for /usr is rather small.
1.0 GB for /usr/src is absolutely not going to work since that is where your kernel sources will install to.
Also, your portage tree is going to take up most of /usr space so you should add a /usr/portage/ with maybe 10-20 GB or so. There is also no good reason not to use a tempfs for /temp

400 MB for boot is also excessive, but it won't hurt anything.

As for how to proceed, just mount them and keep going. Just don't forget which partition is which when you get to modifying your fstab.

EDIT: I'll just add this. The handbook is more what you would call guidelines than actual rules. If you want to You could also set up an alternate /dev manager or boot loader, or even something more exotic like encryption, lvm volumes, random highly patched kernels, etc. You just have no know enough about the tool to use it.

Of course, following the handbook is the easiest way to get a working system.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Fri Oct 03, 2014 10:45 pm    Post subject: Reply with quote

400MB is for the root, "/". I only allocate 100MB to "/boot" so I can try other kernels or roll my own from time to time.

Now, on my work laptop (Debian 7), 6.0GB with full KDE4 and all kinds of shell utilities is not even half full. I am assuming that Gentoo uses partitions differently than Debian. I am also assuming that I will somehow have massive amounts of sources with Gentoo since 1.0GB is more than enough. To be honest, I develop MaNGOS (WoW server) and it has only recently grown to need more than a gig, and that includes the other sources in there (nVidia, kernel, etc). So I am kind of shocked that I will have more than a gig here without doing a stage 1 install, which I thought was no longer an option.

Also, Debian's apt-get (or aptitude) stores its data in /var and /var/cache. I was under the impression that /var was to be used for data which was worked with a lot. Kind of like storing a Microsoft Office document in "My Documents" instead of the "Program Files" directory. Are you telling me that programs store data around the entire file-system? If so, it kind of throws everything I learned with Slack, Redhat (years ago, before Fedora and such), and Debian off. I could always depend on programs storing their data somewhere in "/var", so I separated it to keep fragmentation down. In fact my first move years ago to prevent fragmentation was to put "/var/log" on its own partition.

Also, how would I mount all of this? I am guessing I need to mount /dev/sda1, then create the other directories and mount the other partitions into them?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1733
Location: St. Wendel

PostPosted: Fri Oct 03, 2014 11:13 pm    Post subject: Reply with quote

You forgot you need a complete build toolchain to run Gentoo, this takes a bit space. Also your Builds will happen in /var/tmp, like you said data which is worked with, which will even take more space, Firefox needs 6GB or so and Libreoffice asks for 12G free space to build.

A full blown Gentoo will never be as small as a binary Distribution and it uses the same basic layout.

My active /usr/src/linux has 614M source + object files and this in only one Version.

With newer UDEV Versions you will also will run into trouble with /usr on a different Partition then /, you will be forced to use a initramfs/initrd.

Sizes on my Notebook for comparison, Gentoo + KDE:

Code:

6,8M    /bin
28M     /boot
1,2M    /dev
12M     /etc
4,0K    /lib
7,1M    /lib32
234M    /lib64
178M    /opt
112K    /root
936K    /run
9,4M    /sbin
8,0K    /tmp
17G     /usr
854M    /var


If you want to just try out Gentoo, keep it simple like described in the Manual.

Bye
Py
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2575

PostPosted: Fri Oct 03, 2014 11:23 pm    Post subject: Reply with quote

Quote:
400MB is for the root, "/". I only allocate 100MB to "/boot" so I can try other kernels or roll my own from time to time.
Sorry, I misread it.
Quote:
Now, on my work laptop (Debian 7), 6.0GB with full KDE4 and all kinds of shell utilities is not even half full. I am assuming that Gentoo uses partitions differently than Debian.
Mine has about 16 GB with just i3, although I do have a few games that probably installed a lot of extra stuff. torcs and flightgear probably. 6 GB might work, or it might not depending on how much you install.
Quote:
I am also assuming that I will somehow have massive amounts of sources with Gentoo since 1.0GB is more than enough.
You will have kernels. They take a fair amount of space to configure and build. I have 5 gigs for that and it is a bit small. I can only fit 3 or 4 kernels into that space. Old kernel sources are generally kept around for a while since they need to be cleaned manually. This is by design to preserve the user configuration.
Quote:
Are you telling me that programs store data around the entire file-system?
No, but portage is the package manager and it stores a snapshot of its tree and source files in /usr/portage by default. It keeps all its files in /var.
Quote:
Also, how would I mount all of this? I am guessing I need to mount /dev/sda1, then create the other directories and mount the other partitions into them?
If sda1 is your root partition, then yes. You would follow the same directions that apply to /boot, but just keep doing it for /usr, /var, etc.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Oct 03, 2014 11:24 pm    Post subject: Reply with quote

Just as sample: at my box /usr occupies 7.8 Gb. It includes portage tree (420Mb) and sources tarballs (6.6 Gb). Kernel sources and modules - another 800 Mb (for one kernel).
I have no too much apps installed though.
If you will remove sources tarballs immediately after install and cleanup portage tree time to time, 6.0 Gb for /usr seems to be enough. But if you will reinstall something (for some reason), you will have to fetch sources again. Though such a things occurs no so frequently.
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Sat Oct 04, 2014 2:36 am    Post subject: Reply with quote

Thanks for all the help. I had no idea installs were done from sources. This is what REALLY had me excited for Gentoo when I was learning C++ years back. The idea of the stuff coming down the pipe and building FOR YOUR SYSTEM was cool! Now I see the need for more space.

I do have another question however. I normally delete /var/tmp and symlink it to /tmp, which I lock down with noexec, nosuid, and nodev. Also why I create a /tmp directory. That and I do not like /tmp eating RAM. So, with Gentoo, is this advisable?

Finally, I will install in a basic fashion to test in VBox. If I can get the hang of things, I see a switch coming. This systemd blob has me mad. Binary logs and EVERYTHING tied to it is not cool. I may as well use Windows at that point.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sat Oct 04, 2014 8:18 am    Post subject: Reply with quote

WEll i suggest you stay to less partitions for your setup or at least use lvm with your desired layout, so you can move your free space around.

You will run into problems when you constraint your system like that. Your free space on one partition won t be used where it will be needed on another end.

It makes sense to separate /boot, /home, /root, /var/tmp but the others may be not that useful to keep separate.
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Sat Oct 04, 2014 8:47 am    Post subject: Reply with quote

You can also allocate much on external usb-disk or a fileserver or even RAM for temp-files.

I have all portdir, source and distfiles (Config in /etc/portage/make.conf) on a fileserver that serves several Gentoo-systems.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Sat Oct 04, 2014 10:06 am    Post subject: Reply with quote

The_Great_Sephiroth,

If you really feel the need for such fine grained control over partitions, use LVM.
Then at least you can move space around.

I have
Code:
df -T
Filesystem                  Type   1K-blocks      Used Available Use% Mounted on
/dev/mapper/ssd-olde--root  ext4      999320    522640    407868  57% /
/dev/mapper/ssd-olde--usr   ext4    20511356  16471864   3058428  85% /usr
/dev/mapper/ssd-olde--var   ext4     3030800   2022884    834248  71% /var
tmpfs                       tmpfs    1641236       140   1641096   1% /run
shm                         tmpfs    8206160         0   8206160   0% /dev/shm
cgroup_root                 tmpfs      10240         0     10240   0% /sys/fs/cgroup
/dev/mapper/vg-home         ext4  1056763060 834954184 168105404  84% /home
/dev/shm                    tmpfs    8206160       168   8205992   1% /tmp
/dev/mapper/ssd-olde--local ext4      999320      4848    925660   1% /usr/local
/dev/mapper/vg-portage      ext2     2046355    438049   1503449  23% /usr/portage
/dev/mapper/vg-local        ext4    92760056  72262648  16078080  82% /usr/portage/distfiles
/dev/shm                    tmpfs    8206160         0   8206160   0% /var/tmp/portage
/dev/mapper/vg-var          ext4    60764220  34029088  23626116  60% /mnt/oldvar
/dev/md125                  ext2       38792     30860      5929  84% /boot

/dev/mapper/vg-portage is ext2 with a 1k block size, so the tree fits into 2G. Its 4x that with a 4k block size.
This install has root on LVM too, so it needs an initrd to get LVM started before the kernel can mount root.
/tmp and /var/tmp/portage are both in RAM. With 16G RAM, /dev/shm is 8G by default, which is enough to build most things in RAM.
There is a common fallacy that having /var/tmp/portage in RAM speeds builds. It doesn't, since if you have the RAM for /var/tmp/portage in RAM, the kernel will keep things in buffers anyway. It does save writes to disc, which are subsequently never read.

I never flush /usr/portage/distfiles, so thats been accumulating since April 2009.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Mon Oct 20, 2014 2:41 pm    Post subject: Reply with quote

Sorry for the delay in my response! I took my vacation (two weeks) and just got back. Now that I have cleared my head, I have an idea about a better way to go about this.

Which directories are read/written to the most? I normally separate these into their own partitions to prevent fragmentation. For example, /var/log is on its own partition since it is used frequently by the system. With that said, where are the following directories in Gentoo?


  • Cache (like /var/cache in Debian)
  • Package repository (is this /usr/portage?)
  • Source-code location (like /usr/src in Debian)

I believe that will be a good start. I also separate boot and home for obvious reasons. I also create a /vm partition for use by VirtualBox should I be using it on the system.

My goal is to prevent fragmentation as long as possible since we haven't been able to defragment our systems since ext2. I have had a few systems which users set up with a single partition which have 40% or more fragmentation now. My systems are partitioned out, but good.

Finally, I am asking this because I have decided to redo my laptop (this system I am on) from Wheezy to Gentoo and I do not wish to do it a dozen times. Thanks for your help! So far I am loving this community.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1747

PostPosted: Mon Oct 20, 2014 5:53 pm    Post subject: Reply with quote

Quote:
My goal is to prevent fragmentation as long as possible since we haven't been able to defragment our systems since ext2
That's not really true. You can shake it. The point is filesystems used by linux don't need defragmentation as long as they are used the way they were intended.
E.g. ext family doesn't like being filled to more than 90% of it's capacity.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Mon Oct 20, 2014 6:37 pm    Post subject: Reply with quote

The_Great_Sephiroth,

/var/cache is var/cache in gentoo too

/usr/portage is the portage tree.
/usr/portage/distfiles is the downloaded source files.
/usr/portage/packages is the binaryies you build for yourself
There are only the defaults, you can change the locations with entries in make.conf

/usr/src will be home to your kernels. They are unpacked here, ready for you to configure and build.
Personally, I do my kernel building in my users ~ so I don't need to be root.

The build location is /var/tmp/portage over time, it gets cluttered up with broken builds.
You need to flush it from time to time if its on disk.

Code:
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
are the make.conf entries you might want to play with.
Code:
emerge --info
will show the current settings.
My PKGDIR above is not the default because I have several installs I want to keep the binary packages separate for but they all share the Portage tree and distfiles.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Mon Oct 20, 2014 7:35 pm    Post subject: Reply with quote

I usually use something like the following setup:
Code:

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda8       16524084 14086440   1598252  90% /
/dev/sda9       16524084 14393876   1290816  92% /home
/dev/sda10      16524084  9277620   6407072  60% /usr/portage
/dev/sda12       7868656  5045204   2404128  68% /var


And there's a boot partition of 128 MB.

/var is separate because stuff (eg: news) comes and goes there, and it is in fact the only partition I've ever
known corrupted (once in the last ten years). It's overfull because I've parked a lot of large source files there,
and 4G would usually be ample.

There's another partition, not shown, of 40G or so for VirtualBox images, and yet another, 32G or so for music;
they are on a second drive.

My /usr/src/linux directory takes up 800MB or so, with a single set of kernel sources. Obviously if you start
tinkering with kernels (eg. crosscompiling them) the space needed mounts up pretty quickly. I don't bother
compiling the big packages, firefox and libre-office; if I did I'd need more tmp space.

That's a pretty complete install, with a number of large packages: libreoffice, librecad, tex (a _huge_ package),
a couple of cross-compilers, and so on.

Will
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Mon Oct 20, 2014 11:20 pm    Post subject: Reply with quote

Thank you for the information. Based on this, I am considering the following setup for my laptop. Feel free to tell me if it is bad or good.

  • / - 10GB
  • /boot - 128MB
  • /var - 2GB
  • /var/cache - 2GB
  • /var/log - 1GB
  • /usr - 32GB
  • /usr/portage - ??GB
  • /usr/portage/distfiles - ??GB
  • /usr/portage/packages - ??GB
  • /vm - 256GB (for VBox VMs)
  • /home - Remaining space
  • /tmp - 1GB (do I need this? I normally use it and lock it down with noexec,nosuid,nodev)
  • /usr/src - 10GB
  • <swap> - 4GB (I have 8GB of RAM but never needed more than 4GB to hibernate)

Also, I normally symlink /var/tmp to /tmp so /var/tmp is also locked down. Is that safe to do in Gentoo? Finally, how big should I make the portage partitions based on running a KDE4 desktop with VBox, LibreOffice, Firefox, Thunderbird, FileZilla, etc? I have a 1TB SATA 3Gbps drive in this laptop.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue Oct 21, 2014 11:15 am    Post subject: Reply with quote

The_Great_Sephiroth wrote:
Also, I normally symlink /var/tmp to /tmp so /var/tmp is also locked down. Is that safe to do in Gentoo?

No; though it may be okay if you have a separate /var/tmp/portage.

Here's my setup; as you can see I have about as many partitions as you do ;) Easier to read that than discuss the permissions etc here.

I recommend lvm, as others have mentioned.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Tue Oct 21, 2014 4:55 pm    Post subject: Reply with quote

The_Great_Sephiroth,

/var needs to be >10G if it will hold /var/tmp/partage as thats the build space.
/tmp need not be on HDD but you do need if.
/usr/portage contains a lot of small files, It needs to be 2G if you use a 1k block size or bigger if not.
If your 1Tb drive is an Advanced Format drive, use a filesystem with 4k blocks and make in aboutt 8G.
If you feel thats a waste, research portage in squashfs, then its well less than 1G

/usr/portage/distfiles can be flushed from time to time. If you remove a file that is needed for a rebuild, it will be fetched again.
Try 30G for starters. An entire distfiles mirror is about 250G last time I asked but you will not need all that.

/usr/portage/packages is not required. You do not have to save the as built binaries.

This makes LVM attractive, so you don't have to get it right first time.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1364
Location: Fayetteville, NC, USA

PostPosted: Tue Oct 21, 2014 6:28 pm    Post subject: Reply with quote

When you say I can flush the distfiles, is that similar to "aptitude clean / apt-get clean" on Debian? How would I do such a thing with emerge?

I also see I was told not to symlink /var/tmp to /tmp. Why? I like a secure system and I can easily lock down /tmp. Just asking to learn here, not disputing your answer.

And yes, my drive is advanced format and I did align my partitions (parted -a optimal /dev/sda) and use a 4k size on the ext2 and ext3 partitions. I will use ext4 on my laptop however, in place of ext3.
Back to top
View user's profile Send private message
mrbassie
Guru
Guru


Joined: 31 May 2013
Posts: 538

PostPosted: Tue Oct 21, 2014 6:41 pm    Post subject: Reply with quote

The_Great_Sephiroth wrote:
When you say I can flush the distfiles, is that similar to "aptitude clean / apt-get clean" on Debian? How would I do such a thing with emerge?


emerge gentoolkit and once you have that the command is:
Code:
eclean-dist


It is essentially the same thing as apt-get clean (afaik, somebody correct me if I'm wrong).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Tue Oct 21, 2014 7:13 pm    Post subject: Reply with quote

The_Great_Sephiroth,

There are degrees of flushing.
Code:
eclean distfiles -d
removes all of the distfiles exceft those you would need to rebuild your system.
Code:
rm -rf /usr/portage/distfiles
removes all the distfiles. Go careful with that as you need to run it as root.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Oct 22, 2014 7:12 am    Post subject: Reply with quote

Not recommended as you need the source to rebuild packages. You will have to download them again and you put pressure on the mirrors, which is not good behaviour.

when you are fussed about the space used up, put the distfiles to somewhere they do not matter

therefore in your /etc/make.conf add something like that / this is from my box
Code:
DISTDIR="/mnt/sdb2/usr/portage/distfiles"
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Wed Oct 22, 2014 12:00 pm    Post subject: Reply with quote

I clear out distfiles not used in the current build every year or so, and the portage directory
never goes above 12G. On the whole, life's a lot easier if you keep the sources around
(which is why I use Gentoo in the first place).

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