Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Partitioning? Sizes? Best filesystems? LVM?
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
xahodo
n00b
n00b


Joined: 17 May 2007
Posts: 16
Location: Gouda, the Netherlands

PostPosted: Thu Aug 24, 2017 5:23 am    Post subject: Partitioning? Sizes? Best filesystems? LVM? Reply with quote

Hello,

After about 6 years of being away from Gentoo, I decided to try my hand at it again on an Acer Aspire 7750G with about 650GB of HDD space (ought to be enough for my purposes).

But I'm already running into some simple issues.

In the past I have run into the problem of not having enough inodes for a build (it was open office, with ccache being in use, had one big filesystem where I put everything on). So I figured I'd put /usr/portage and /var/tmp on their own partitions.

Basically, my layout would be as follows:

  • /dev/sda1 128MB /boot ext2 not always mounted to keep the kernel and grub safe.
  • /dev/sda2 50GB / ext4 ought to be enough for my purposes.
  • /dev/sda3 2GB /usr/portage not sure about filesystem, symlink to /var/tmp for distfiles.
  • /dev/sda4 30GB /var/tmp not sure about filesystem.
  • /dev/sda5 rest /home ext4


Here's some things of note:

  • This laptop is going to be used as a home system.
  • The largest build is probably going to be libre office.
  • I'm not going to play any games on it, so not much in /opt.
  • Some software and web development is going to be don on it.


Now on to the actual questions:

  • Is 50GB enough for / or do I need to consider that some (git?) eats a lot of /var?
  • Is 2GB enough for the portage tree these days? What filesystem is best to use?
  • Is that 30GB for /var/tmp enough? What filesystem can I best use?


I have 6GB of RAM in that machine and don't intend to use hybernate. So, no swap partition.
Back to top
View user's profile Send private message
russK
Guru
Guru


Joined: 27 Jun 2006
Posts: 520

PostPosted: Thu Aug 24, 2017 5:54 am    Post subject: Reply with quote

I have become a fan of root on LVM. Everything on LVM (except /boot and EFI). The rest of the disk is one large partition for the physical volume. The mounted filesystems and swap if needed are all logical volumes either ext4 or xfs or other online resizable filesystem. They can be resized at will. I use genkernel to build the requisite initramfs. I've looked at rolling my own but the small gains from doing so have not seemed worth the effort because genkernel just works. Sysrescuecd understands it and is capable of creating everything for the install too so there is no real added risk if rescue is needed.
Back to top
View user's profile Send private message
russK
Guru
Guru


Joined: 27 Jun 2006
Posts: 520

PostPosted: Thu Aug 24, 2017 6:04 am    Post subject: Reply with quote

If you go the LVM route, one word of advice - keep the size of all of the volumes you create just comfortably large enough. Keep space as unused in the volume group so that later you can grow the filesystems that need to grow.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2379

PostPosted: Thu Aug 24, 2017 6:58 am    Post subject: Reply with quote

russK wrote:
... The mounted filesystems and swap if needed are all logical volumes ...

Regarding swap. if you want to use it for hibernation, see topic 1064568 and topic 1068042.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2302

PostPosted: Thu Aug 24, 2017 7:10 am    Post subject: Reply with quote

The answer really is "it depends."

LVM adds flexibility and complexity. I decided to ditch it once I ironed out exactly how much space my partitions where using. Entirely redundant in that case and an extra point of failure. But as always, the right tool for the right job. If you don't know how much space you need it is the right tool.

/tmp and /var/tmp should not be partitions at all. They should be a tmpfs in ram. If necessary your can redirect portage to a different tmp for large packages. This is very rare. So far only icedtea has given me any problem.

Right now my configuration is both a little extreme in terms of partition numbers and mostly satisfactory, for reference. Part of the complexity is due to splitting the system over an SSD and a mechanical storage drive. I've attempted to make the best of both. Here is my system for reference:

/boot ~99 Mib (Also the EFI partition. Only two kernels reside there.)
/ 30 GiB, 16 used
/usr/src 5 GiB, full (only kernels there. Easy enough to clean up. Also only split so keep off the SSD. I would not do so again)
/usr/portage 20 Gib, 17 GiB used (I went to using the binary package feature and this is slightly inadequate. I frequently run out of space and have to do some cleaning)
/var 15G, 775 Mib used
/home, the rest

At the vary least I would make /var its own partition. You never know when log spam may be an issue. I'm entirely on ext4. These days there simply isn't a major difference when it comes to performance. Also, if you decide to use LVM, keep in mind that many file systems do not resize well. Most will happily grow to fill new space but they may not be shrinkable. That may or may not be a major pain should you need to free up some space.

I also wouldn't throw your distfiles away. If you need to rebuild something then you would have to download it again which is both time consuming and bad netiquette. As you can see, my /var is about half of what you budgeted and barely used. That space would better be spent storing distfies.

Quote:
(it was open office, with ccache being in use, had one big filesystem where I put everything on).
I'm a bit confused about this. For your intended use ccache is not helpful at all. It is to make rebuilding a package easier. A normal user will see no benefit and a major hit to performance.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 178

PostPosted: Thu Aug 24, 2017 8:26 am    Post subject: Reply with quote

The Doctor wrote:
/tmp and /var/tmp should not be partitions at all. They should be a tmpfs in ram.

I fully agree on /tmp, but disagree for /var/tmp. IMHO - and in line with the standard file system hierarchy - /var/tmp should reside on persistent storage as otherwise data which is temporarily stored there doesn't survive a crash, a power outage or a simple reboot. The prime candidate for me is vi and its recovery files if midway through an editing session something nasty happens.

If /var/tmp is on persistent storage (and vi is configured to store its recovery files there - which, if I recall correctly, is the default) you are able to recover the file you were editing prior to disaster striking. I guess there are other programs as well which make use of temporary files destined to survive a reboot.

See also https://en.m.wikipedia.org/wiki/Filesystem_Hierarchy_Standard which states that /var/tmp is for
Quote:
Temporary files to be preserved between reboots.
- and for obvious reasons that simply doesn't work for a tmpfs.

Atom2
Back to top
View user's profile Send private message
russK
Guru
Guru


Joined: 27 Jun 2006
Posts: 520

PostPosted: Thu Aug 24, 2017 1:47 pm    Post subject: Reply with quote

charles17,

Very good point about hibernation and swap. I'm not using a laptop so I never hibernate.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Aug 24, 2017 2:41 pm    Post subject: Reply with quote

xahodo,

I'm a LVM fan. I tend to migrate from one install to another and create logical volumes that are about 50% full at install time.
I take the baggage with me, so I know what 50% is.

Code:
$ df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/static-root     976M  794M  116M  88% /
/dev/mapper/static-usr      158G   90G   62G  60% /usr
/dev/dm-12                  5.8G  3.3G  2.3G  59% /var
tmpfs                       1.6G  164K  1.6G   1% /run
shm                         7.9G  156K  7.9G   1% /dev/shm
cgroup_root                  10M     0   10M   0% /sys/fs/cgroup
/dev/mapper/vg-home         1.5T  955G  474G  67% /home
/dev/shm                    7.9G  1.1M  7.9G   1% /tmp
/dev/mapper/static-opt      976M  362M  548M  40% /opt
/dev/mapper/static-local    976M  5.6M  904M   1% /usr/local
/dev/mapper/static-portage  3.0G  338M  2.5G  12% /usr/portage
/dev/mapper/vg-distfiles        118G  105G  8.6G  93% /usr/portage/distfiles
/dev/shm                    7.9G     0  7.9G   0% /var/tmp/portage


A few comments. Its all ext4 with some fine tuning. Things that can be regenerated are -O ^has journal, because I don't mind throwing them away.
/usr/portage has a 1k black size and 1 i-node per block. Its a lot of small files. Think carefully before you do that. If you HDD has 4k physical blocks, you really don't want a filesystem with 1k blocks on it. I never prune distfiles or packages, so my collection goes back to 2009.

Separate /var and /usr comes from old habits. Separate /var is good. Its a very bad thing to have logs fill /.
You can't boot, you can't chroot even until you delete something.

This install is split over a SSD and raid5, both using LVM. The rotating rust is good for large sequential files, so distfiles is there.
I thought packages was too, so I must have messed up.
_________________
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
xahodo
n00b
n00b


Joined: 17 May 2007
Posts: 16
Location: Gouda, the Netherlands

PostPosted: Thu Aug 24, 2017 8:10 pm    Post subject: Reply with quote

Thanks for all the replies.

I ended up going with a simple MBR partition scheme, nothing special, no LVM or raid.
/dev/sda1 /boot 128MB - ought to be enough to hold the kernel and grub.
Then comes the logical partition holding a bunch of partitions.
/dev/sda5 /usr/portage 2GB - ought to be enough, distfiles is a symlink to a /var/tmp/distfiles
/dev/sda6 /var/tmp 30GB - if I remember correctly, this should be enough.
/dev/sda7 / 50GB
/dev/sda8 /home the rest.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2302

PostPosted: Fri Aug 25, 2017 12:51 am    Post subject: Reply with quote

You know you can just alter the path portage looks to for for its distfiles. No need to bother with the symbolic link. The PORTDIR directory changes the location of the portage tree and DISTDIR changes the distfile location
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
russK
Guru
Guru


Joined: 27 Jun 2006
Posts: 520

PostPosted: Fri Aug 25, 2017 2:49 am    Post subject: Reply with quote

Also if you use buildpkg or quickpkg, you may end up needing more for portage. The packages default to going into /usr/portage/packages/

Regards
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Aug 25, 2017 8:50 am    Post subject: Reply with quote

xahodo,

You will need to manage the i-node count to fit portage into 2G.
Its a large number of very small files.
Code:
$ df -ih
/dev/mapper/static-portage   4.0M  166K  3.9M    5% /usr/portage

$ df -h
/dev/mapper/static-portage  3.0G  338M  2.5G  12% /usr/portage


That's 166k files using 338M on a filesystem with 1k blocks.
On a filesystem with 4k blocks, it would be the same number of files but it would want over 1.2G.
Each file must be allocated one or more filesystem blocks. The exception is rieserfs with the tail packing option.
This may be academic now, since most disks have a 4k physical sector size, which make a filesystem with a 1k block size very slow.

If you struggle for space for portage, it can go into a squashfs file.
_________________
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: 1951

PostPosted: Fri Aug 25, 2017 1:08 pm    Post subject: Reply with quote

I _think_ 'mkfs -t ext4 -T news' will give you enough inodes for a portage tree on
a 2GB filesystem, but it's some time since I tried it. The default number of inodes
won't be sufficient.

Will
Back to top
View user's profile Send private message
gen2saurus
n00b
n00b


Joined: 20 Aug 2017
Posts: 10

PostPosted: Fri Aug 25, 2017 2:06 pm    Post subject: Reply with quote

cwr wrote:
I _think_ 'mkfs -t ext4 -T news' will give you enough inodes for a portage tree on
a 2GB filesystem, but it's some time since I tried it. The default number of inodes
won't be sufficient.

Will


I would recommend ReiserFS v3 (not v4!) as a filesystem for /var/tmp/portage/ and /usr/portage (excluding /usr/portage/distfiles/ and /usr/portage/packages/).
It works very good with many small files (typical for portage) and allows to avoid i-nodes problem as well.
Also it is recommended to use the fastest drives for these FS.
Back to top
View user's profile Send private message
nokilli
Apprentice
Apprentice


Joined: 25 Feb 2004
Posts: 152

PostPosted: Wed Aug 30, 2017 10:41 am    Post subject: Reply with quote

The Doctor wrote:
Right now my configuration is both a little extreme in terms of partition numbers and mostly satisfactory, for reference. Part of the complexity is due to splitting the system over an SSD and a mechanical storage drive. I've attempted to make the best of both.


Have you considered creating a bcache device? Just found out that this was available in the kernel maybe a month ago and made the switch and I couldn't be more pleased with the results. Very well done.

So I create the bcache device and then put LVM atop of that, then either dm-crypt or go straight to ext4, depending. It's saved me so much grief trying to move stuff around to best take advantage of the SSD.

I agree that after awhile LVM becomes unnecessary as your system matures but I've found that I like to make many backups of root as I go and LVM with a sufficiently large HD as backing store makes all of that very painless. I also make use of LVM's snapshot feature often enough to make it worth keeping around.
Back to top
View user's profile Send private message
xahodo
n00b
n00b


Joined: 17 May 2007
Posts: 16
Location: Gouda, the Netherlands

PostPosted: Wed Aug 30, 2017 12:19 pm    Post subject: Reply with quote

Thanks for all the replies. I'd like to add that the machine in question doesn't have a SSD.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Aug 30, 2017 2:04 pm    Post subject: Reply with quote

xahodo,

The nature of your HDD no longer matters.

There was a time when SSDs were 4G or 8G when a Gentoo install could wear out the SSD before the install was complete.
There was no wear levelling then either.
_________________
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