Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
partition planning issue
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
pappice
n00b
n00b


Joined: 18 Dec 2012
Posts: 6

PostPosted: Tue Dec 18, 2012 4:25 pm    Post subject: partition planning issue Reply with quote

Hi all,
I am a new gentoo user, I am going to install Gentoo on my laptop (DELL xps l702x). I want to use a whole 500 Gb disk for the installation and I wanted to try a parttion setup that allow me to keep separated the home, user and root directories. This organization of the partition scheme is for security reason (for security i mean keep separated data, apllications and system). I have 8 GB of RAM and i thought to set swap to 2 GB because I have a lot of space thus i can waste it :D. My issue is how to choose a correct dimension for the other partitions and how to create them. I thank you in advance for any suggestion. Just to drive you in giving suggestions, The main use of this system would be for programming and 3D modelling.
Back to top
View user's profile Send private message
Crooksey
Apprentice
Apprentice


Joined: 26 Apr 2006
Posts: 239
Location: Vatican City

PostPosted: Tue Dec 18, 2012 4:43 pm    Post subject: Reply with quote

Well /boot needs to be no more than 500MB absolute max.

/ can be 50GB and this will leave you plenty

I usually allow 3GB for /tmp, but you wont need this on a laptop.

You can allocate more or less root space, but 50GB should be more than sufficient (30GB would probably do).

I would also encrypt your home partition.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Tue Dec 18, 2012 7:25 pm    Post subject: Reply with quote

pappice wrote:
I have 8 GB of RAM and i thought to set swap to 2 GB because I have a lot of space thus i can waste it :D


On a laptop, I strongly recommend creating swap space that's at least as large as your RAM. This is because the hibernate/suspend-to-disk functionality stores your memory contents in swap, so if you lack a large enough swap partition, you won't be able to do this.

Crooksey wrote:
Well /boot needs to be no more than 500MB absolute max.


If by this you mean that it needs to be no bigger than 500MB, then I agree. If you mean that it should never exceed 500MB, then I disagree.

Quote:
/ can be 50GB and this will leave you plenty


If /usr is being separated out onto its own partition, then 50GB is excessive for root (/). Mine is 6GiB and only 22% used. My /usr, though, is 20GiB and is 58% full. (That varies a lot, though, since /usr/portage/ is there, and holds all the package files that portage downloads. Cleaning that directory out from time to time is necessary.)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Dec 18, 2012 8:35 pm    Post subject: Reply with quote

pappice,

Consider using LVM, so that you can move space around and grow logical volumes.
You must choose filesystems that support resizing.

I don't know what anyone does with a /boot bigger than 64Mb. If you go with LVM you must have a separate /boot but everything else can be in logical volumes.
_________________
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
LiamOS
n00b
n00b


Joined: 06 Jun 2012
Posts: 56
Location: Kerry/Dublin, Ireland

PostPosted: Tue Dec 18, 2012 10:50 pm    Post subject: Reply with quote

Personally, I'd allow:
15G for /
35G for /usr
~100MB for /boot
and the rest for /home

keep in mind that if you're using a separate /usr, you will need an initramfs to boot. Genkernel can create one for you.
_________________
CFLAGS=" -O999999"
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Wed Dec 19, 2012 12:37 am    Post subject: Reply with quote

NeddySeagoon wrote:
Consider using LVM, so that you can move space around and grow logical volumes.
You must choose filesystems that support resizing.


I also like LVM, although it's a more advanced configuration that can be confusing to newbies.

Quote:
I don't know what anyone does with a /boot bigger than 64Mb. If you go with LVM you must have a separate /boot but everything else can be in logical volumes.


Many distributions that use binary kernels provide kernel/initrd pairs that are 15-25MB in size. You could only fit two to four of those on a 64MB /boot partition. Likewise if you enable certain types of debugging information, even under Gentoo; that can radically increase the size of your kernel and initrd files. Fedora creates ~500MB /boot partitions by default.

Of course, if you're using Gentoo exclusively, your needs may be more modest. The kernels on the Gentoo system on which I'm typing are all 2MB, and my initrd files range from 4MB to 4.5MB. Thus, you could fit about ten of those on a 64MB partition. Still, it's better to err on the side of being too big than too small. I generally create ~200MB /boot partitions on my installations, although I sometimes go a bit higher than that if I'm not sure what size the distributions' kernel/initrd pairs are.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Dec 19, 2012 12:48 am    Post subject: Reply with quote

srs5694,

Well, I do have an initrd, since I need to assemble raid, start LVM, mount /, /usr and /var (including fsck if required) but there is nothing in the initrd that is kernel specific. No kernel modules.
The kernels have everything needed to boot built in and almost everything else as loadable modules.

My kernels only have to boot in one place - unlike the generic kernels that a binary distro must provide.
_________________
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
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Thu Dec 20, 2012 7:27 am    Post subject: Reply with quote

I have a fair amount of software installed right now, and my /usr is only 4.5GB, I gave it 100GB which is fairly excessive. If you have separate /usr you probably will need no more than 500MB on /, and even that is probably excessive. If you plan on having a small /, watch out for software that installs itself into /opt. For this reason I have separate /opt as well as /boot, /var, /tmp, /home, and /usr.
_________________
"To design the perfect anti-Unix, make all file formats binary and opaque, and require heavyweight tools to read and edit them." - The Art of Unix Programming
Back to top
View user's profile Send private message
pappice
n00b
n00b


Joined: 18 Dec 2012
Posts: 6

PostPosted: Mon Dec 24, 2012 7:13 am    Post subject: Reply with quote

Thank you for your advices, I will try to understand better LVM and follow your suggestion using it. I will update this tread as soon as I come out with working partitions on my HD.
Anyway this forum works pretty well, fast answers and good tips!!! Thank you all very much!!!
Back to top
View user's profile Send private message
pappice
n00b
n00b


Joined: 18 Dec 2012
Posts: 6

PostPosted: Mon Dec 24, 2012 7:52 am    Post subject: Reply with quote

One more question, it is possible to encrypt home partition while using LVM? and... does LVM entail performance drawbacks?
Back to top
View user's profile Send private message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 124

PostPosted: Mon Dec 24, 2012 8:13 am    Post subject: Reply with quote

Yes, it is possible to encrypt LVM partitions and yes, it is a performance drawback since it's an additional layer (LVM itself and encryption also). However, the penalty is not that huge and you have a very good CPU, so shouldn't be a problem.

You can read about LVM: http://wiki.gentoo.org/wiki/LVM
And about encryption: http://wiki.gentoo.org/wiki/DM-Crypt_LUKS and http://en.gentoo-wiki.com/wiki/DM-Crypt_with_LUKS

Regarding the partitioning, you can use the following scheme:
/boot 100MB
/ 5GB
/usr 5GB
/var 5GB
/opt 500MB
/tmp 500MB
/home as needed

Boot and root on normal partitions, the rest is dedicated to LVM - usr, var, opt, home, tmp is a logical volume. You can enlarge any of those as needed.
Back to top
View user's profile Send private message
pappice
n00b
n00b


Joined: 18 Dec 2012
Posts: 6

PostPosted: Mon Dec 24, 2012 8:21 am    Post subject: Reply with quote

Thank you, I am going to read from the links you posted :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Dec 24, 2012 1:12 pm    Post subject: Reply with quote

pappice,

root inside LVM works too and you will need an initrd to mount /usr and /var from inside LVM so that udev can start.
_________________
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
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Mon Dec 24, 2012 7:21 pm    Post subject: Reply with quote

hydrapolic wrote:
Yes, it is possible to encrypt LVM partitions and yes, it is a performance drawback since it's an additional layer (LVM itself and encryption also). However, the penalty is not that huge and you have a very good CPU, so shouldn't be a problem.


Initially, I'd expect that any performance penalty for LVM would be so tiny as to be unnoticeable. Both standard partitions and LVM just tell the OS what range of sectors on a hard disk correspond to a filesystem -- say, that sectors 2048 to 1,212,850 are one partition, 1,212,851 to 976,768,064 are another, and so on. LVM does add a layer of complexity to decoding this information, but that will take a fraction of a second at system start time to compute; the kernel doesn't need to re-read the data structures or decode them afresh with every disk access, so it's a one-time performance penalty.

Where LVM could degrade performance is if you make significant changes to your logical volumes over time. That is, if you shrink Volumes A and B, and create Volume C; and then later delete Volume A, create Volume D, and increase the size of Volume C. Such actions are like creating, deleting, and resizing files on a filesystem, and they can result in fragmentation just as can similar actions on files in a filesystem. The result can be increased seek times for intra-filesystem accesses compared to what you'd get if the filesystem were entirely contiguous. If you're careful about how you make your changes, though, you may be able to minimize such effects. This will require studying the layout of the logical volumes, as reported by the various LVM tools. On the flip side, of course, LVM makes such changes both easier and quicker to implement, so the net effect may be minor even if there's a noticeable performance hit -- you'll just pay the temporal cost in little bits over months rather than all at once.

OTOH, LVM can offer performance improvements, particularly if you've got multiple physical disks. In particular, striping logical volumes across two or more physical disks can improve performance because you spread the I/O across those disks. This can result in a noticeable performance improvement. The downside is that it makes your system more vulnerable to damage should one of the disks fail -- if one disk dies catastraphically, you'll lose all the data on all the volumes that are stored on it, even partially.

Encryption, as you say, will have a performance impact because it will require extra CPU time when reading or writing data.
Back to top
View user's profile Send private message
pappice
n00b
n00b


Joined: 18 Dec 2012
Posts: 6

PostPosted: Fri Dec 28, 2012 12:01 pm    Post subject: Reply with quote

do you think the following set up is fine? (I dropped LVM idea by now)

--->partition 1 primary:
/boot: ~256MB
--->partition 2 primary:
/swap: 8GB
-->partition 3 extended:
/: 20GB

/usr: 50GB

/tmp: 4GB

/home: ~200GB [encrypted]
--->partition 4 primaty:
/bkp: ~200GB (backup partition)
Back to top
View user's profile Send private message
akaoni
n00b
n00b


Joined: 18 Dec 2011
Posts: 17

PostPosted: Fri Dec 28, 2012 12:47 pm    Post subject: Reply with quote

I dont this it is worth to have /usr, /tmp and /boot separated, it is somehow lost space.
Then for / you should make it bigger as you have to store all portage stuff especially if you have /usr inside it.

For swap 8Gb is big but it depends on what you run, I have 4Gb RAM on my laptop and almost never use the swap.
It is however useful if you want to hibernate.

On thing I have a /data instead of /home to store all files for all users (like iso/movies/distroCD/ebook ... ) that are shared between all users.
Then I create /data/home inside this to store home dirs.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Dec 28, 2012 3:28 pm    Post subject: Reply with quote

pappice,

If you ever use more than 512Mb of swap, you are either doing something wrong or you don't have enough RAM.
There is a single exception to that. You want to hibernate to swap.

If you have enough RAM to need 8G of swap for hibernation, /tmp should be in tmpfs. There is no need for it to be on the HDD.

A separate /usr is a security improvement but it comes at a price. You either use an old almost unmaintained udev, an initrd, to mount /usr before udev starts, or some modified init scripts that delays udev starting until after the local-mount script has run. There is another alternative in the the works - eudev but its not ready for general use quite yet.

When you were going to use LVM, you were going to use and initrd anyway. Once that decision is made, anything else is moot, its just a few chnanges to int initrd contents for other things.
Is it worth an initrd just to mount a separate /usr ... thats up to you.
_________________
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
pappice
n00b
n00b


Joined: 18 Dec 2012
Posts: 6

PostPosted: Fri Dec 28, 2012 4:41 pm    Post subject: Reply with quote

NeddySeagoon,
I have 8 GB RAM and sometimes I use Hibernate, do I need to perform hibernate operation to swap? and how much swap space is needed to hibernate (given my RAM)?
I would like to have a separate /usr but. After reading your advices, I think I am too new to linux to add such a complexity, thus I think I will keep /usr: under /: by now.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Dec 28, 2012 5:14 pm    Post subject: Reply with quote

pappice,

With the gentoo-sources kernel, you can hibernate to swap. With the tuxonice kernel, you can choose between hibernate to swap and hibernate to a file.
The hibernate image is compressed, so with reasonable use of swap and all of RAM in use, an 8G swap, should provide all the hibernate space you need.

Take care that hibernating does not compromise your encrypted /home. I don't use filesystem encryption and make very little use of hibernation. Its installed on my netbook, it works, but save me very little time, so I tend to shut down rather than hibernate. Thats just my workflow and old habits.
_________________
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
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