Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Partitioning ideas for older system...
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: Sat Apr 01, 2017 10:59 pm    Post subject: Partitioning ideas for older system... Reply with quote

I am about to wipe and reload my wife's Dell Latitude D820. It is a Centrino Duo, 32bit system. It has a 250GB disk (~232GiB) in it and 4GB of RAM, as well as a dedicated nVidia card. Great for browsing the web, YouTube, email, and office work. Heck, it can even do old games!

Anyway, I have fallen in love with BTRFS and am using it religiously. However, if I do whole-disk BTRFS I will have no swap. No biggy, I can use ZRAM to make a 1GB swap partition in RAM. The issue is /tmp. Normally I would use ext2 or tmpfs for this, but with limited RAM and building things like Plasma, this would fail horribly. I could do a BTRFS subvolume with data and metadata being single, but am not sure this is a good idea.

My other option is to do a GPT disk, make a partition for BTRFS and its subvolumes, make a partition for /tmp, and one for swap. This is what I may have to do due to RAM being limited to 4GB, what I already have. What is your input in this matter? How would you handle this?

Oh and I will have subvolumes for home, etc, and possibly others for snapshots and/or other use. Probably subvolume for /usr/portage to be on the safe side.
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Apr 02, 2017 8:26 am    Post subject: Re: Partitioning ideas for older system... Reply with quote

The_Great_Sephiroth wrote:
Anyway, I have fallen in love with BTRFS and am using it religiously. However, if I do whole-disk BTRFS I will have no swap. No biggy, I can use ZRAM to make a 1GB swap partition in RAM.

The_Great_Sephiroth ... think about it, you are going to put swap in RAM, which is what would normally be swapped out (to disk). Doing that means that the RAM that would be available to MM will be tied to swap ... better to have no swap at all, as at least the RAM would be available to MM, and not tied up on the off-chance that swap is needed. In my case (2GB RAM) swap is barely ever used, the primary reason for having is to suspend to disk (hibernate), so if you don't need to hibernate then you could create swap as a file, or go without swap.

The_Great_Sephiroth wrote:
The issue is /tmp. Normally I would use ext2 or tmpfs for this, but with limited RAM and building things like Plasma, this would fail horribly.

/tmp isn't used for portage, portage uses /var/tmp ... /tmp is unlikely to require very much, and with tmpfs you can set the size to something reasonable, and the kernel will only use this (RAM) when it's needed. My tmpfs is only 10M and rarely uses any more that a few kbytes.

Code:
% mount | grep '/tmp'
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=10240k)
% du -hs /tmp
8.0K    /tmp

best ... khay
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1747

PostPosted: Sun Apr 02, 2017 9:46 am    Post subject: Reply with quote

4 GB is not THAT limited. With LXDE I'm hardly ever going above 1GB, at least as far as it's office work or browsing the internet. Your wife is not going to run a bunch of VM there, is she?
Regarding /tmp: you can make it tmpfs of pretty much arbitrary size instead of default 50%. Only used space is actually allocated. However, since some packages require more space in /tmp than RAM you have, I'd rather put it on disk instead.
And if you really feel like you need that swap... BTRFS doesn't prevent you from using a swap file, right?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Apr 02, 2017 10:22 am    Post subject: Reply with quote

The_Great_Sephiroth,

With 4GB RAM in a 64 bit system, I build everything in RAM except libreoffice and firefox.

There in no need to limit the size of tmpfs. It will expand up to the limit set or 50% of RAM by default.
It can also be swapped if you have a swap.

Personally, I always have a small swap. Its not the only mechanism the kernel has for swapping, you just don't see the others.
Swap is only used for dynamically allocated RAM. Not having a swap space deprives the kernel of one of its swapping options.
_________________
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: Sun Apr 02, 2017 2:55 pm    Post subject: Reply with quote

Couple of things. The system is only 32bit, if it matters. I have servers that use ZRAM for swap do to whole-disk BTRFS and they work wonderfully. I read an article a few weeks ago that stated that Linux needs swap, even if you have enough RAM not to physically page to disk when running applications. You are saying this is not true and I can do without a swap partition? What happens if I manage to eat all four gigs of RAM?

Also, since stuff still uses /tmp, I symlink /var/tmp to /tmp. This has the added bonus of allowing me to lock it down (noexec, nosuid, nodev) sicne I lock /tmp down. With only four gigs of RAM, using a tmpfs would be enough to build everything Plasma has to offer? I would think that it would get so far then after X number of applications have been built, the tmpfs is full. I use binary Firefox, Thunderbird, and LibreOffice on her system due to it being 32bit and taking eons to build them.

I also cannot do swapfiles in BTRFS per this information on the BTRFS wiki. So I have to either do ZRAM or a GPT setup with a partition for swap. Is this correct?
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1747

PostPosted: Sun Apr 02, 2017 3:40 pm    Post subject: Reply with quote

Quote:
What happens if I manage to eat all four gigs of RAM?
Same thing that would happen if your SWAP was full: OOMK tries to kill the children first. If naughty parents keep making more children, they will eventually be killed too.
SWAP is not strictly required by linux, unless you hibernate to disk.
It is merely a way to survive without killing any processes when you're running out of resource you actually need: RAM. As long as your internal state + overhead does not exceed your RAM size, you're totally fine without SWAP. Or maybe I should say: "I'm totally fine without SWAP", since my gentoo doesn't use it.

Regarding that info on swapfile not supported on btrfs, this thing is as interesting as it's ridiculous. You're probably familiar with an old saying comparing OS to a birthday cake (hint: layers). "If the jelly leaks down to the table, it's time to change the cook". FS should not know or care what data goes into that file. Application should not know or care how FS handles that file. File is an interface between two independent entities. If this assumption fails, there's something very wrong.


/tmp: there are very few things that need any significant amount of RAM at build time, and if you really happen to run out of RAM, you can change /tmp from tmpfs to an actual filesystem located on your hard drive. It will be wiped on every boot anyway, so don't worry about leftovers. You can also add ZRAM later if you find out you really need it. Don't think too much in advance, just start with basic stuff and see how it works for you.

Quote:
So I have to either do ZRAM or a GPT setup with a partition for swap.
You can also start with a small filesystem and some unused space, and then repartition and grow your FS as needed. LVM makes this very convenient, though at this point I'm almost expecting btrfs to stand in your way should you attempt following this path.
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: Sun Apr 02, 2017 5:09 pm    Post subject: Reply with quote

I went with 1-7 being for BIOS, 7-246GB for the OS, and 246-250 for swap so the laptop can hibernate. I only have one question remaining I cannot seem to find the answer to. Can a BTRFS subvolume contain different mount options and such? For example, I format the big partition as BTRFS with metadata and data duplicated for resilience. I make a subvolume for "/" and want it to be single for metadata and data. That would require a separate partition, I believe. But What if I simply want a subvolume compressed? Like "/usr/portage". Could I mount it compressed even though the parent is not compressed? I have never tried and am curious.

*UPDATE*

I cannot set compression per subvolume, this is planned though. I can set the compress flag on the root directory of a mounted subvolume and make it compress though. So I am good.
_________________
Ever picture systemd as what runs "The Borg"?
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